Today, whilst at work, I tried to SSH back home and couldn't get a response.My initial suspicion was that it was one of two things:1) Home internet down2) Power outage causing things to resetI got home to find that there had been a power out, which had caused my old Virgin router to reboot. I have this old router in modem only mode and it feeds internet only to a better Asus RT-AC56U router.My Asus router had restarted properly and had reinstated the home network but there was no WAN because the old Virgin router hadn't reset itself properly. I also have two Raspberry Pi's running Raspbian on my home net, and a headless server running Ubuntu. The Pi's had both restarted themselves but the server was still off. I logged into the Pi's and ran the 'uptime' command to see if I could work out what time the power went off. Both Pi's reported they had been up for 7h40m, so I calculated the power to have been restored at 1040.Both Pi's also had incorrect time. Both were behind by 23 minutes. I know that because the Pi doesn't have a hardware clock it has to rely on ntp to get the time on startup. When these Pi's were reset there would have been no Internet to get ntp from, so I'm guessing they took their time from some kind of last known configuration (maybe something in a log or systemd or something?).So, power back on at 1040. Pi time out by 23 minutes.1040 - 23m = Power off at 1017 and back on at 1040, right?I booted my headless server to check some custom logs I have running on a cron job. One of these is to check the hard disk temperatures every hour, at 29 minutes past the hour, and append the temperature to a text file. The last temperature check had occurred at 1029 and been logged before the server went down.But how/why were the times on both Raspberry Pi's 23 minutes behind?I have rebooted the Pi's now and they've picked up the correct time from ntp.I SSH'ed into the Pi's and checked uptimes and date before I restarted the Virgin box, so they hadn't had a chance to get any npt from external internet.
I have an ntp related mystery to solve
raspberry pi;power management;ntp