I have a bach in the far north that has a Raspberry Pi controlling a couple of Hue lights - lights come on in various patterns when the place is unoccupied. The bach has no internet access. The north suffers from occasional, short duration, power outages and so it is possible for the time to be lost and therefore the light show may not occur at the right time of day. To compensate for this I have equipped the Pi with a Pico UPS board and so can stand a power outage of about 30 mins before a controlled power down occurs. The Pico board has an onboard realtime clock and so, theoretically, when power is restored the Pi will have the correct date and time. I would like to be able to check this remotely. To this end I have installed a Huawei USB Stick 4G modem and, with the help of some 'programming by google' I am able to send an SMS to the Raspberry Pi and have it respond, via a text message, with its view of the date and time. It will also text me when it is running on battery, when it changes back to mains and if it has rebooted for any reason - all accomplished via some Python code and Node-Red. What I am trying to do now is send the Pi an sms with a date string and have it reset its date and time, just in case a power outage exceeds the time that the battery can keep the rtc working - not likely, but it is now a challenge. Problem is I seem to be unable to get the Pi to accept a datetime change. If I run 'sudo date -s' with a date and time string I get all the appearance of success but then a simple 'date' command shows nothing has changed. I am now confused. Should I be looking to reset the system time and then synch the hardware clock, or do I target the hardware clock (I assume with 'hwclock') and assume it will then manage the system time. I would appreciate it if someone could point me at the right sequence and save me a lot of googling. Oh, NTP processing has been removed - no internet.
Thanks