device reboot without loosing time sync?


I am trying to implement a fail-safe systemd service that checks for internet connection and restarts the cellular modem (GPIO) and ModemManager if something fails. However most of the time a full system reboot is the only way of getting internet up and running again after some edge cases.

However I do not want to make a full reboot as I will loose system time synchronisation which is very important for my application.

So I would like to mimic a device reboot as much as possible without loosing time synchronisation.

Any ideas on how that can be done?


Hi there, if you have the ability to power the modem hardware off and on programmatically, then a simple watchdog service which would try to ping/connect to an external Internet host which is known to be always there and power off/on the modem if it fails.

Yes I have already done that but it is not enough to make it work after certain failures.


What device are you using?
The balenaFin for example has a coprocessor that you can use to control the power rail of the Raspberry Pi compute module. So your application in balenaOS could talk to the coprocessor and tell it to reboot the system. This way you’d have a lot more control as the coprocessor firmware can be programmed by you.
The coprocessor - which will continue to run while the compute module reboots - can store your time synchronization data.

Sorry forgot to mention that, I use a Raspberry Pi 3B only.

Do you think a hardware watchdog HAT would make sense for what you are trying to achieve?
See an example here -