Following on from:
If the emonPi does not have an active internet connection on bootup the system time might not be correct. This can happen after a power outage when the RasPi boots up before the router/modem has connected, or when using a 3G GSM modem which takes a while to connect. It’s possible to force an NTP update at anytime by running:
rpi-rw
sudo service ntp stop
sudo ntpd -q -g
sudo service ntp start
rpi-ro
I’ve wrapped up the above command into a bash script in the emonpi repo and a corresponding sudo_crontab entry to run every hr to force an NTP update. These additions won’t effect existing emonPi unless you add the following entry to the root contab:
rpi-rw
sudo crontab -e
add the following to the bottom:
0 * * * * /home/pi/emonpi/ntp_update.sh >> /var/log/ntp_update.log 2>&1
CTRL X
then Y
to save and exit