Not sure how you prefer to manage the questions. If this is better off as a new post I'll remove this and post as new.
New problem: sudo shutdown appears to reboot the pi, but then seconds later WittyPi kills the power
I expect the pi to receive power through the whole process.
Hopefully I'm not the problem again this time. The firmware updated, and it's not bouncing back on from the off state like it was with firmware 0x04, but now I can't reboot the pi without WittyPi powering it off. So kind of the opposite of the previous problem. I do have a scheduled shutdown and startup in place via script, but these are for 4 hours later, so I expect they would not affect this test.
Here's the reboot:
jeff@tweety:~:> date Wed 12 Jun 16:50:44 EDT 2024 jeff@tweety:~:> wittypi/wittyPi.sh ================================================================================ | | | Witty Pi - Realtime Clock + Power Management for Raspberry Pi | | | | < Version 4.21 > by Dun Cat B.V. (UUGear) | | | ================================================================================ >>> Current temperature: 43.25°C / 109.85°F >>> Your system time is: 2024-06-12 16:50:47 EDT >>> Your RTC time is: 2024-06-12 16:50:48 EDT >>> Vout=5.18V, Iout=0.94A Now you can: 1. Write system time to RTC 2. Write RTC time to system 3. Synchronize with network time 4. Schedule next shutdown [12 20:05:00] 5. Schedule next startup [12 20:15:00] 6. Choose schedule script [in use] 7. Set low voltage threshold [3.9V] 8. Auto-On when USB 5V is connected [Yes] 9. Set over temperature action [T>80°C ➔ Shutdown] 10. Set below temperature action [T<10°C ➔ Startup] 11. View/change other settings... 12. Reset data... 13. Exit What do you want to do? (1~13) 13 jeff@tweety:~:> sudo reboot Broadcast message from root@tweety on pts/1 (Wed 2024-06-12 16:51:03 EDT): The system will reboot now!
Based on a previous post here I had tried setting the power cut delay higher (20s), even though this pi shuts down in only a few seconds. The only other change in the 'other settings' menu was #1 default state when powered = ON.
TxD voltage readings started at ~0v when I hit enter for the reboot. Then:
- +~3 sec the Pi red LED flashes off and back on
- +5 more sec TxD up to +3.3v
- +4 more sec TxD drop to ~0v
- +20 more sec the white LED flashed twice
- +~1 more sec the power was off. White LED slow blink.
I pressed the power button ~3 minutes later to turn it back on. During the timing above, the pi had restarted successfully once. It then restarted again when I pressed the power button. Here's the shutdown:
Jun 12 16:51:05 tweety systemd-journald[231]: Received SIGTERM from PID 1 (systemd-shutdow). Jun 12 16:51:05 tweety systemd-journald[231]: Journal stopped
Startup:
-- Boot 955f363b42834998af284bb676ac3f4e -- Jun 12 16:51:05 tweety kernel: Booting Linux on physical CPU 0x0000000000 [0x410fd083]
Later in this startup, it's continuing to come online
Jun 12 16:51:05 tweety systemd[1]: Starting systemd-tmpfiles-setup-dev.service - Create Static Device Nodes in /dev... Jun 12 16:51:05 tweety systemd[1]: Started systemd-journald.service - Journal Service. Jun 12 16:51:05 tweety systemd[1]: Starting systemd-journal-flush.service - Flush Journal to Persistent Storage... Jun 12 16:51:05 tweety systemd[1]: Finished keyboard-setup.service - Set the console keyboard layout. Jun 12 16:51:05 tweety systemd-journald[232]: Time spent on flushing to /var/log/journal/1e7976f5557d4fa28d45c9a1ab4366a1 is 20.272ms for 403 entries.
But the logging ends there, early in the startup process. It didn't get to the WittyPi daemon startup, so no log entries in the wittyPi.log for that failed startup.
Then a new startup, from the manual power button press. The pi clock time eventually updated by the WittyPi daemon.
-- Boot 09e3638cff044d3286200893e1f25231 -- Jun 12 16:51:05 tweety kernel: Booting Linux on physical CPU 0x0000000000 [0x410fd083] … Jun 12 16:51:08 tweety wittypi[517]: Starting Witty Pi 4 Daemon... Jun 12 16:51:08 tweety systemd[1]: Starting wittypi.service - LSB: Witty Pi 4 initialize script… … Jun 12 16:51:09 tweety wittypi[526]: Witty Pi daemon (v4.21) is started. … Jun 12 16:51:09 tweety systemd[1]: Started wittypi.service - LSB: Witty Pi 4 initialize script. … Jun 12 16:51:10 tweety wittypi[526]: RTC offset register has value 0x79 Jun 12 16:51:10 tweety wittypi[526]: Seems RTC has good time, write RTC time into system Jun 12 16:51:10 tweety wittypi[526]: Writing RTC time to system... … Jun 12 16:51:11 tweety systemd[1]: Started ssh.service - OpenBSD Secure Shell server. Jun 12 16:51:11 tweety sudo[818]: root : PWD=/ ; USER=root ; COMMAND=/usr/bin/date -s @1718225654 Jun 12 16:51:11 tweety sudo[818]: pam_unix(sudo:session): session opened for user root(uid=0) by (uid=0) Jun 12 16:54:14 tweety systemd-resolved[385]: Clock change detected. Flushing caches. Jun 12 16:54:14 tweety sudo[818]: pam_unix(sudo:session): session closed for user root Jun 12 16:54:14 tweety wittypi[526]: Done :-)
Here's the wittyPi.log from that timeframe:
[2024-06-12 16:50:19] Pending for incoming shutdown command... [2024-06-12 16:50:19] Schedule next startup at: 2024-06-12 20:15:00 ^@^@^@^@^@^@^@^@^@^@^@^@^@^@^@^@^@^@^@^@^@^@^@^@^@^@^@^@^@^@^@^@^@^@^@^@^@^@^@^@^@^@^@^@^@^@^@^@^@^@^@^@^@^@^@^@^@^@^@^@^@^@^@^@^@^@^@^@^@^@^@^@^@^@^@^@^@^@^@^@^@^@^@^@^@^@^@^@^@^@^@^@^@^@^@^@^@^@^@^@^@^@^@^@^@^@^@^@^>[xxxx-xx-xx xx:xx:xx] System: Debian GNU/Linux 12 (bookworm), Kernel: Linux 6.6.31+rpt-rpi-v8, Architecture: arm64 [xxxx-xx-xx xx:xx:xx] Running on Raspberry Pi 4 Model B Rev 1.5 [xxxx-xx-xx xx:xx:xx] RTC offset register has value 0x79 [xxxx-xx-xx xx:xx:xx] Seems RTC has good time, write RTC time into system [xxxx-xx-xx xx:xx:xx] Writing RTC time to system... [2024-06-12 16:54:14] Done :-) [2024-06-12 16:54:14] Firmware ID: 0x37 [2024-06-12 16:54:14] Firmware Revison: 0x06 [2024-06-12 16:54:14] Current Vout=5.23V, Iout=1.11A [2024-06-12 16:54:14] System starts up because the button is clicked. [2024-06-12 16:54:19] Send out the SYS_UP signal via GPIO-17 pin. [2024-06-12 16:54:19] Schedule next shutdown at: 2024-06-12 20:05:00 [2024-06-12 16:54:19] Pending for incoming shutdown command... [2024-06-12 16:54:19] Schedule next startup at: 2024-06-12 20:15:00
Thanks for any guidance you can provide.
TxD voltage readings started at ~0v when I hit enter for the reboot. Then:
- +~3 sec the Pi red LED flashes off and back on
- +5 more sec TxD up to +3.3v
- +4 more sec TxD drop to ~0v
I can see something unusual here: the TxD pin should be pulled up when the Pi is running, and goes to ~0V when Pi is shut down. According to your description, the TxD was indeed pulled up at the beginning of startup, and later drop to ~0V. This most probably is the reason that Witty Pi cut the power - it considered this Pi has been shut down and the power cut action was triggered.
You can run "gpio readall" and see the status of the TxD pin. The normal status should be ALT0 and V=1.
You may check if there some (auto-run) software that may (incorrectly) configure the serial port (or that two GPIO pins).
That helped, thanks.