I'm using raspberry without a connection to the Internet.
The time on a connected device is wrong, and I cannot change it with date -s @[epoch]
and similar commands.
The device is time 2017-01-xx
.
Some devices accept a command to change their system time, but after a reboot they again have the wrong time.
The time synchronization packet is sent every 10 minutes.
How can I change rtc system time?
EDIT:
I'm using rpi2 B+, OS Raspbian. My scipt is in Python / shell. communication between devices is over Xbee PRO.
EDIT2: My scripts starts after reboot of RPi, with root privileges. Devices have same FW and problem is only in some devices (10p of 40 pieces).
Im using my own protocol to communicate between gateway(GW) and hosts. Each packet is checked for correct values - length, minumal values (2016-01-01). GW is connected to network and it is the only device that i can access directly.
System time of GW is synchronised with NTP and has current time - TESTED. Only GW sends broadcast information about current time to hosts every 10 minutes.
Each host receive information about current time in epoch format (because packet limitation of xbee pro) and if there is a big difference between system and received time, fw call system command (shell) to change time - i TESTED it actually in office and it works.
NEW problem is, that some hosts could not change time less than 2017-01-01.