Setting Date & Time

I’ve got a RPi 3 Model B running Hassio and having problems setting the date and time.

Date should be 2018-02-19, but is showing as 2018-02-11. Time is also a couple of hours off. Logs in Hassio point to the correct date. I’ve opened port 123 for UDP, but not seeing any changes to the date after rebooting.

I’ve also connected a DS3231 hoping I could rely on a hardware clock instead. Config.txt seems to already have i2c enabled. I also tried updating the date over SSH with date -d 2018.02.19-18:49:20.
Running “hwclock” in SSH returns: hwclock: can’t open ‘/dev/misc/rtc’: No such file or directory

I know that the all-in-one installer for Hassio is supposed to limit what the user can do, but surely there must be an easy solution to updating the time and date? I’m not sure where to else to look. Is this a Hassio, Resio or Docker problem?

Thanks in advance!

In your configurations.yaml

What values do you have for:
latitude:
longitude:
time_zone:

Took the values from my old Pi that was running HA. Tried the values out at: https://www.findlatitudeandlongitude.com/find-address-from-latitude-and-longitude/

Values are something like:
latitude: 55
longitude: 10
time_zone: Europe/Copenhagen

Edit: Checking the map tab in Hassio, it’s showing my exact location.

Does this help? https://community.home-assistant.io/t/help-for-date-and-time/30218/8?

1 Like

Haven’t gotten around to trying it out, but think you might be right. Thanks! I’ll check it out.

No luck unfortunately.

RPi #1 has an updated config.json and an i2c clock added. Config looks like this:

{
“persistentLogging”: false,
“hostname”: “RpiOne”,
“uuid”: “# Removed for posting #”,
“deviceApiKey”: “# Removed for posting #”,
“ntpServers”: “0.resinio.pool.ntp.org 1.resinio.pool.ntp.org”,
“scripts”: {
“preinstall”: “bash deps.sh”,
“start”: “modprobe i2c-dev && node app.js”
}
}

RPi #2 has an empty config.json and no hardware clock. Port 123 UDP points to #2 as I’m not running Let’s Encrypt etc on it. Next step will be to update the config.json of #2 to see if that resolves the issue. I guess it would be enough for one of them to get the correct time, right?

Both pi’s show the same date in Hassio as when using date in the terminal. However the time was showing up as either 3 hours and xx min ahead or four hours and yy min ahead. Stopped Mosquitto broker on #1 as I think it was causing the weird time updates.

Any other suggestions for what to try? Is there any way, running Hassio that I can find out if the hardware clock is working?

I’m not ready to admit defeat just yet. :sunglasses: Thanks in advance!

Updated second rpi and waiting to see if the time and date will update.

Edit: No change. Removing the SD card to update settings in the config.json seems to reset the time and date to the date when Hassio image was first downloaded.

Was running the Pi over wifi from the start, but solution to my problem was to connect both RPi’s with an ethernet cable for a couple of minutes.