Monday, 9 June 2014

Wrong date and time on Raspberry Pi running Domoticz

I recently booted up an old instance of Domoticz home automation software on one of my Raspberry Pi's with a PiFace interface. I noted that the time and date were out by three months and even though I had a valid network connection and pinging the NTP time servers was possible, the date and time would never update.

I spent about 40 minutes on Mr Google trying various things and this is what worked.

  1. Login to your Pi using SSH
  2. Ensure your Pi can ping a time server
    ping 0.debian.pool.ntp.org
  3. Stop the NTP service
    sudo service ntp stop
  4. Force a time check
    sudo ntpd -gq
  5. Restart the NTP service
    sudo service ntp start
  6. Check the date and time
    ntptime

    Should now report back the correct date and time?