3

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.

niktoss
  • 51
  • 4
  • Can you describe the devices you are referring to? What OS are you running on the Rasberry Pi? – ryanjdillon Aug 05 '16 at 08:29
  • Hi. Im using rpi2 B+, OS Raspbian. My scipt is in python / shell. communication between devices is over Xbee PRO. – niktoss Aug 05 '16 at 08:43
  • It would help if you share a simplified version of you script/commands that you are using, and any errors you receive. Be sure to use the markdown syntax for code, so it is easier to read [link](http://stackoverflow.com/editing-help) – ryanjdillon Aug 05 '16 at 08:56
  • You need to provide a lot more information for us to help you. How are you sending the time to the RPi? What have you tested so far? Have you confirmed that you're using a proper value? Have you been able to isolate the problem at all (confirm valid data received over XBee connection, for example). Does the RPi script run as root, typically the only user account that can change a device's date? – tomlogic Aug 05 '16 at 17:36
  • I added the info you described through your comment – Billal Begueradj Aug 07 '16 at 09:51
  • raspbian build 'Linux log_525131 4.1.19-v7+ #853 SMP Wed Mar 9 18:09:16 GMT 2016 armv7l GNU/Linux' – niktoss Aug 11 '16 at 11:07

0 Answers0