Hello all. I have a device, and old power-pc based environmental monitoring widget, which runs under busybox linux. I'm baffled by the hardware clock. The unit is accessed 99% of the time via its web interface, which has no provision for setting the clock. But the device is an environmental monitor, with graphs & history, so have the time set right is important.
There was once an advanced configuration utility, which one could run on a workstation, to configure it. It was written in Java, and is now unobtainium. Even if I had it, I'm not sure it would run in a modern environment.
The device has no ssh or telnet access, only a serial port and a 10/100 ethernet. So setting the time after a reboot requires a serial cable. Arrrg.
I ran nmap against it.
PORT STATE SERVICE
21/tcp open ftp
80/tcp open http
443/tcp open https
I was hoping that port 21 was a disguised telnet port, but no, it's really ftp.
I plugged into the serial port and can access a shell prompt. I managed to locate the root password and can kill the config program that runs for root at login, which gets me a prompt.
I can set the date/time, but that's lost when it reboots- It reverts to the hardware clock, which lets me set it, but then spools off into random times. I can set the hwclock as many times as I like, but it floats around by hours/days within a very short time.
I do see this in the bootup:
Looking for host 192.168.0.1 and service ntp
host found : 192.168.0.1
host found : 2610:20:6f15:15::26
root: NTP sync failed
But it's not on that network, and I can't figure out how to change the NTP server.
# uname -a
Linux EnvMon420 2.4.26 #1 Wed Oct 31 18:09:53 CDT 2007 ppc unknown
Last time I rebooted it, I set the linux clock and ran this to see how far off the hardware clock and linux clock are:
# date
Thu Jul 20 10:30:09 CDT 2023
# hwclock -r
Thu Jul 27 04:18:39 2023 0.000000 seconds
; write the linux clock to the hardware clock:
# hwclock -w
; read the hardware clock:
# hwclock -r
Thu Jul 20 10:39:38 2023 0.000000 seconds
; show linux clock:
# date
Thu Jul 20 10:31:52 CDT 2023
; read hardware clock within a second of 'date' command:
# hwclock -r
Thu Jul 20 11:14:23 2023 0.000000 seconds
; it's off by an hour
; compare again after 3 minutes or so:
# date;hwclock -r
Thu Jul 20 10:34:45 CDT 2023
Fri Jul 21 01:43:11 2023 0.000000 seconds
As you can see, it's off in space somewhere, having drifted a full day.
The other day, I ran a script that looped, writing the linux clock to the hardware clock, reading back the hardware clock, then 'sleep 10' -- I let it run over night. The readback immediately after the set was always pretty accurate. But as soon as I stop it, it jumps to random times/dates again.
Any ideas?
-T
"HEY YOU" (loud shouting) • Second Tops (Set Dancing) • FIND ME ON FACEBOOK
43° 7' 17.2" N by 88° 6' 28.9" W • Elevation 815' • Grid Square EN53wc
Sr. Systems Administrator • Open-source Dude • Musician • Registered Linux User 385531
--... ...-- / -.. . / -. ----. --.- --.- -...