Sonoff basic tasmota time resets to 1970 after reboot

Sonoff basic running Tasmota 9.3.1
Openhab 3 on ubuntu on raspberry pi 4

Hi All,

It looks like the time configured on my sonoff devices does not survive a reboot/power cut. It defaults to 1970 after a reboot. Has anyone faced and resolved this?

Thanks

Changing the time manually, then back to ntp server: (UTC+4)

02:47:17.601 CMD: timezone
02:43:14.242 MQT: stat/tasmota-FBD17F/RESULT = {"Timezone":"+04:00"}
02:47:13.494 CMD: status 7
02:47:13.504 MQT: stat/tasmota-FBD17F/STATUS7 = {"StatusTIM":{"UTC":"1970-01-01T02:47:13","Local":"1970-01-01T02:47:13","StartDST":"1970-01-01T00:00:00","EndDST":"1970-01-01T00:00:00","Timezone":"+00:00","Sunrise":"20:13","Sunset":"05:47"}}
02:47:14.688 CMD: time
02:47:14.695 MQT: stat/tasmota-FBD17F/RESULT = {"Time":"1970-01-01T02:47:14"}
02:47:17.601 CMD: timezone
02:47:17.608 MQT: stat/tasmota-FBD17F/RESULT = {"Timezone":"+04:00"}
//set the time using epoch converter
02:47:27.722 CMD: time 1643738279
02:47:27.729 MQT: stat/tasmota-FBD17F/RESULT = {"Time":"1970-01-01T02:47:27","Epoch":1643738278}
21:58:15.064 CMD: ntpserver
21:58:15.071 MQT: stat/tasmota-FBD17F/RESULT = {"NtpServer1":"mu.pool.ntp.org","NtpServer2":"nl.pool.ntp.org","NtpServer3":"0.nl.pool.ntp.org"}
//switch back to ntp server
21:58:17.806 CMD: time 0
21:58:17.813 MQT: stat/tasmota-FBD17F/RESULT = {"Time":"2022-02-01T21:58:17","Epoch":1643738297}
21:58:43.490 CMD: time
21:58:43.499 MQT: stat/tasmota-FBD17F/RESULT = {"Time":"2022-02-01T21:58:43"}
21:58:43.539 CMD: status 7
21:58:43.549 MQT: stat/tasmota-FBD17F/STATUS7 = {"StatusTIM":{"UTC":"2022-02-01T17:58:43","Local":"2022-02-01T21:58:43","StartDST":"1970-01-01T00:00:00","EndDST":"1970-01-01T00:00:00","Timezone":"+04:00","Sunrise":"11:20","Sunset":"20:46"}}

After reboot:

//back to 1970
00:00:58.467 MQT: Attempting connection...
00:00:58.491 MQT: Connected
00:00:58.494 MQT: tele/tasmota-FBD17F/LWT = Online (retained)
00:00:58.496 MQT: cmnd/tasmota-FBD17F/POWER = 
00:00:58.507 MQT: tele/tasmota-FBD17F/INFO1 = {"Module":"Sonoff Basic","Version":"9.3.1(tasmota)","FallbackTopic":"cmnd/DVES_FBD17F_fb/","GroupTopic":"cmnd/tasmotas/"}
00:00:58.514 MQT: tele/tasmota-FBD17F/INFO2 = {"WebServerMode":"Admin","Hostname":"tasmota-FBD17F-4479","IPAddress":"192.168.1.10"}
00:00:58.527 MQT: tele/tasmota-FBD17F/INFO3 = {"RestartReason":"Software/System restart"}
00:00:58.534 MQT: stat/tasmota-FBD17F/RESULT = {"POWER":"ON"}
00:00:58.538 MQT: stat/tasmota-FBD17F/POWER = ON
00:02:20.599 MQT: Attempting connection...
00:02:20.613 MQT: Connected
00:02:20.617 MQT: tele/tasmota-FBD17F/LWT = Online (retained)
00:02:20.619 MQT: cmnd/tasmota-FBD17F/POWER = 
00:04:40.479 MQT: Attempting connection...
00:04:40.500 MQT: Connected
00:04:40.504 MQT: tele/tasmota-FBD17F/LWT = Online (retained)
00:04:40.508 MQT: cmnd/tasmota-FBD17F/POWER = 
00:07:15.498 MQT: Attempting connection...
00:07:15.512 MQT: Connected
00:07:15.516 MQT: tele/tasmota-FBD17F/LWT = Online (retained)
00:07:15.519 MQT: cmnd/tasmota-FBD17F/POWER = 
00:08:13.480 CMD: status 7
00:08:13.488 MQT: stat/tasmota-FBD17F/STATUS7 = {"StatusTIM":{"UTC":"1970-01-01T00:08:13","Local":"1970-01-01T00:08:13","StartDST":"1970-01-01T00:00:00","EndDST":"1970-01-01T00:00:00","Timezone":"+00:00","Sunrise":"20:13","Sunset":"05:47"}}
00:08:31.325 CMD: time
00:08:31.331 MQT: stat/tasmota-FBD17F/RESULT = {"Time":"1970-01-01T00:08:31"}
00:08:35.509 CMD: timezone
00:08:35.516 MQT: stat/tasmota-FBD17F/RESULT = {"Timezone":"+04:00"}

Is your tasmota device able to reach the internetand does it reach the DNS server? Apart from that, I would look in the tasmota community for support. e.g there is an already closed issue on Github, but some think it could be related to a bad network connection which causes the timesync to fail

1 Like

Are you using the precompiled bin files or are you compiling your own?

What is the output of

NtpServer

in your Tasmota device console?

Ups, i just checked your logs again ans saw the output of NtpServer

Try to set your NtpServers to

NtpServer1 pool.ntp.org

NtpServer2 africa.pool.ntp.org

NtpServer3 0.africa.pool.ntp.org

for reference have a look here

1 Like

Oh dear! Forgot that I configured all the IOT devices to communicate on the intranet only on my mesh network for added security. I’ve rolled out an internal ntp server now and the issue is fixed.
Correct time after reboot :slight_smile:

11:48:32.986 CMD: status 7
11:48:32.995 MQT: stat/tasmota-FB7A71/STATUS7 = {"StatusTIM":{"UTC":"2022-02-02T07:48:32","Local":"2022-02-02T11:48:32","StartDST":"2022-03-27T02:00:00","EndDST":"2022-10-30T03:00:00","Timezone":"+04:00","Sunrise":"11:18","Sunset":"20:48"}}

Thanks @Sascha_Billian

Thanks @Rolli

I’ve rolled out an internal ntp server with this configuration and connected tasmota to it. Looks good now!

# Use servers from the NTP Pool Project. Approved by Ubuntu Technical Board
# on 2011-02-08 (LP: #104525). See http://www.pool.ntp.org/join.html for
# more information.
pool 0.africa.pool.ntp.org iburst
pool 1.africa.pool.ntp.org iburst
pool 2.africa.pool.ntp.org iburst
pool 3.africa.pool.ntp.org iburst