Closed bplimley closed 8 years ago
So unfortunately, this isn't working... ntp-wait
doesn't seem to work inside dosenet.sh
even though it works outside of it.
To check (immediately after booting):
grep dosenet /var/log/messages
(you see that Waiting for NTP to be synced...
and Starting DoseNet script
happen very close to each other)
date; ntp-wait -v; date
(you see that ntp-wait
is waiting. On my device it generally takes 15 minutes for NTP to sync.)
When the pi is powered off, the CPU clock does not run. That means when it powers back on, the system time is incorrect, until it updates from the internet. This happens through the NTP protocol in the system (see
man ntp
andman ntpd
).Currently, the system time gets updated through
ntpd
typically sometime afterdosenet.sh
runs. This means that the system time update viantpd
throws off the time intervals thatManager
is tracking. (This is handled reasonably now as of #34).With issue #12 and the pi using its own timestamp on the data packets, however, the time stamp must be accurate from the beginning. Therefore, the
dosenet.sh
shell script should check whether NTP has updated the system time, and wait for that before runningpython manager.py ...
.