# Time appears to move back on reboot when not connected to internet

Source: https://forum.modalai.com/topic/2583/time-appears-to-move-back-on-reboot-when-not-connected-to-internet
Category: VOXL 2 and VOXL 2 Mini (https://forum.modalai.com/category/26/voxl-2-and-voxl-2-mini)
Tags: voxl-2
Posted: 2023-08-21 18:28:06 UTC by John Nomikos 0
Replies: 2 · Views: 754

## John Nomikos 0 · 2023-08-21 18:28:06 UTC

Good afternoon,

I am running into a bit of a weird issue on my VOXL2.

When I reboot the VOXL2, time appears to move back. This causes an issue with journalctl as logs displayed are now in the "future" so it is not displaying current logs.

An example:
```
voxl2:/$ journalctl -fu voxl-camera-server
-- Logs begin at Thu 2023-03-02 12:58:02 UTC. --
Mar 02 13:05:45 m0054 bash[3570]:     standby_enabled:     0
^C
voxl2:/$ date
Thu Mar  2 12:58:34 UTC 2023
```

Another example where I check date and then reboot VOXL2:

```
voxl2:/$ date
Thu Mar  2 12:58:34 UTC 2023
voxl2:/$ date
Thu Mar  2 12:58:58 UTC 2023
voxl2:/$ jnomikos@john:~/$ adb shell

                                                         ▂▂▂▂▂▂▂▂▂▂▂▂▂            
                                                    ▂▄▆▆██▛▀▀▀▀▀▀▀▀▜████▆▆▄▂      
 ███╗   ███╗ ██████╗ ██████╗  █████╗ ██╗         ▗▆████▀▔             ▔▔▀▀▀▀▚▄    
 ████╗ ████║██╔═══██╗██╔══██╗██╔══██╗██║       ▗▟████▀     ▗██▖    ▐█   ▝▀▆▄▄▄    
 ██╔████╔██║██║   ██║██║  ██║███████║██║      ▟████▀      ▗█▘▝█▖   ▐█       ▜█▀█▄ 
 ██║╚██╔╝██║██║   ██║██║  ██║██╔══██║██║      █▌ ▐█▌     ▗█▘  ▝█▖  ▐█       ▐▄ ▄█ 
 ██║ ╚═╝ ██║╚██████╔╝██████╔╝██║  ██║███████╗  ▀████    ▗█▘    ▝█▖ ▐█     ▂▄███▀  
 ╚═╝     ╚═╝ ╚═════╝ ╚═════╝ ╚═╝  ╚═╝╚══════╝    ▀▀██▄▄                ▂▆███▀     
                                                     ▀▀██▄▄ ▀▀▆▄▄▄▄▆██▀▀▀▘        

--------------------------------------------------------------------------------
system-image: 1.6.2-M0054-14.1a-perf
kernel:       #1 SMP PREEMPT Fri May 19 22:19:33 UTC 2023 4.19.125
--------------------------------------------------------------------------------
hw version:   M0054
--------------------------------------------------------------------------------
voxl-suite:   1.0.0
--------------------------------------------------------------------------------
no current network connection
--------------------------------------------------------------------------------

voxl2:/$ date 
Thu Mar  2 12:58:15 UTC 2023
```

Is there anything that could be causing this time discrepancy when turning off and on the VOXL2?

These examples I gave above were on hard reboot (cutting power from device). But this even happens on soft reboot.

Soft reboot example:

```
voxl2:/$ date
Thu Mar  2 13:00:22 UTC 2023
voxl2:/$ reboot
voxl2:/$ jnomikos@john:~$ adb shell

                                                         ▂▂▂▂▂▂▂▂▂▂▂▂▂            
                                                    ▂▄▆▆██▛▀▀▀▀▀▀▀▀▜████▆▆▄▂  
 ███╗   ███╗ ██████╗ ██████╗  █████╗ ██╗         ▗▆████▀▔             ▔▔▀▀▀▀▚▄    
 ████╗ ████║██╔═══██╗██╔══██╗██╔══██╗██║       ▗▟████▀     ▗██▖    ▐█   ▝▀▆▄▄▄    
 ██╔████╔██║██║   ██║██║  ██║███████║██║      ▟████▀      ▗█▘▝█▖   ▐█       ▜█▀█▄ 
 ██║╚██╔╝██║██║   ██║██║  ██║██╔══██║██║      █▌ ▐█▌     ▗█▘  ▝█▖  ▐█       ▐▄ ▄█ 
 ██║ ╚═╝ ██║╚██████╔╝██████╔╝██║  ██║███████╗  ▀████    ▗█▘    ▝█▖ ▐█     ▂▄███▀  
 ╚═╝     ╚═╝ ╚═════╝ ╚═════╝ ╚═╝  ╚═╝╚══════╝    ▀▀██▄▄                ▂▆███▀     
                                                     ▀▀██▄▄ ▀▀▆▄▄▄▄▆██▀▀▀▘        

--------------------------------------------------------------------------------
system-image: 1.6.2-M0054-14.1a-perf
kernel:       #1 SMP PREEMPT Fri May 19 22:19:33 UTC 2023 4.19.125
--------------------------------------------------------------------------------
hw version:   M0054
--------------------------------------------------------------------------------
voxl-suite:   1.0.0
--------------------------------------------------------------------------------
no current network connection
--------------------------------------------------------------------------------

voxl2:/$ date
Thu Mar  2 12:58:10 UTC 2023
```

This VOXL2 does not have an internet connection. It uses microhard radio. With access to the internet, the VOXL2 will synchronize it's clock on startup.

```
jnomikos@john:~$ adb wait-for-device shell

                                                         ▂▂▂▂▂▂▂▂▂▂▂▂▂            
                                                    ▂▄▆▆██▛▀▀▀▀▀▀▀▀▜████▆▆▄▂      
 ███╗   ███╗ ██████╗ ██████╗  █████╗ ██╗         ▗▆████▀▔             ▔▔▀▀▀▀▚▄    
 ████╗ ████║██╔═══██╗██╔══██╗██╔══██╗██║       ▗▟████▀     ▗██▖    ▐█   ▝▀▆▄▄▄    
 ██╔████╔██║██║   ██║██║  ██║███████║██║      ▟████▀      ▗█▘▝█▖   ▐█       ▜█▀█▄ 
 ██║╚██╔╝██║██║   ██║██║  ██║██╔══██║██║      █▌ ▐█▌     ▗█▘  ▝█▖  ▐█       ▐▄ ▄█ 
 ██║ ╚═╝ ██║╚██████╔╝██████╔╝██║  ██║███████╗  ▀████    ▗█▘    ▝█▖ ▐█     ▂▄███▀  
 ╚═╝     ╚═╝ ╚═════╝ ╚═════╝ ╚═╝  ╚═╝╚══════╝    ▀▀██▄▄                ▂▆███▀     
                                                     ▀▀██▄▄ ▀▀▆▄▄▄▄▆██▀▀▀▘        

--------------------------------------------------------------------------------
system-image: 1.6.2-M0054-14.1a-perf
kernel:       #1 SMP PREEMPT Fri May 19 22:19:33 UTC 2023 4.19.125
--------------------------------------------------------------------------------
hw version:   M0054
--------------------------------------------------------------------------------
voxl-suite:   1.0.0
--------------------------------------------------------------------------------
current IP: wlan0: 10.1.10.116
--------------------------------------------------------------------------------

voxl2:/$ date
Mon Aug 21 17:40:34 UTC 2023
voxl2:/$ jnomikos@john:~$ adb wait-for-device shell

                                                         ▂▂▂▂▂▂▂▂▂▂▂▂▂            
                                                    ▂▄▆▆██▛▀▀▀▀▀▀▀▀▜████▆▆▄▂      
 ███╗   ███╗ ██████╗ ██████╗  █████╗ ██╗         ▗▆████▀▔             ▔▔▀▀▀▀▚▄    
 ████╗ ████║██╔═══██╗██╔══██╗██╔══██╗██║       ▗▟████▀     ▗██▖    ▐█   ▝▀▆▄▄▄    
 ██╔████╔██║██║   ██║██║  ██║███████║██║      ▟████▀      ▗█▘▝█▖   ▐█       ▜█▀█▄ 
 ██║╚██╔╝██║██║   ██║██║  ██║██╔══██║██║      █▌ ▐█▌     ▗█▘  ▝█▖  ▐█       ▐▄ ▄█ 
 ██║ ╚═╝ ██║╚██████╔╝██████╔╝██║  ██║███████╗  ▀████    ▗█▘    ▝█▖ ▐█     ▂▄███▀  
 ╚═╝     ╚═╝ ╚═════╝ ╚═════╝ ╚═╝  ╚═╝╚══════╝    ▀▀██▄▄                ▂▆███▀     
                                                     ▀▀██▄▄ ▀▀▆▄▄▄▄▆██▀▀▀▘        

--------------------------------------------------------------------------------
system-image: 1.6.2-M0054-14.1a-perf
kernel:       #1 SMP PREEMPT Fri May 19 22:19:33 UTC 2023 4.19.125
--------------------------------------------------------------------------------
hw version:   M0054
--------------------------------------------------------------------------------
voxl-suite:   1.0.0
--------------------------------------------------------------------------------
no current network connection
--------------------------------------------------------------------------------

voxl2:/$ date
Mon Aug 21 17:40:34 UTC 2023

```

I tested, and this happens on platform 0.9.5 as well as 1.0.0. Is there a solution?

## Reply by Eric Katzfey (ModalAI staff) · 2023-08-22 15:09:06 UTC

@John-Nomikos-0 The VOXL2 has no battery backed real time clock so once it is powered off it no longer maintains time. If you are connected to the Internet then the NTP time protocol is used to update the time. If that is successful then it will save that initial time and use it on future reboots. So this is why it looks like time is going backward if you don't have an Internet connection. All it can do is load the time from a previous run and go from there. The only other possible way to update the time is if you have a valid GPS signal that can provide time. In that case it would be possible to update the system time with the time from GPS however that is currently not implemented on VOXL2. That will be added in a future release but it still will only help when you have a valid GPS signal.

## Reply by John Nomikos 0 · 2023-08-22 15:44:02 UTC (in reply to Eric Katzfey)

@Eric-Katzfey Makes sense to me. Thank you for the info. Threw me off because journalctl was showing most recent logs were from the future.
