Cool stuff for Raspberry Pi, Arduino and all electronics hobby projects
Notifications
Clear all

[Solved / Archived] Witty Pi 4 fails to boot after packages upgrade (Raspberry Pi OS 64bits - Bookworm)

25 Posts
4 Users
6 Likes
1,401 Views
JeromeBriot
(@jeromebriot)
Posts: 10
Active Member
Topic starter
 

Hello,

Fresh install of the Raspberry Pi OS 64bits on a Rpi 4B using the latest image (i.e. 2023-12-05-raspios-bookworm-arm64.img.xz).

Install latest Witty Pi's software. Reboot the Rpi => no problem.

Update packages using "sudo apt update" and "sudo apt upgrade". Reboot the Rpi => shutdown immediately after startup.

Here is the wittypi.log content (packages upgrade between 22:31:47 and 22:43:44, Witty Pi removed at 22:44:07):

[xxxx-xx-xx xx:xx:xx] Witty Pi daemon (v4.14) is started.
[xxxx-xx-xx xx:xx:xx] Running on Raspberry Pi 4 Model B Rev 1.1
[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-03-14 22:29:17] Done :-)
[2024-03-14 22:29:17] Firmware ID: 0x26
[2024-03-14 22:29:17] Firmware Revison: 0x01
[2024-03-14 22:29:17] Current Vout=5.18V, Iout=0.49A
[2024-03-14 22:29:17] System starts up because the button is clicked.
[2024-03-14 22:29:22] Send out the SYS_UP signal via GPIO-17 pin.
[2024-03-14 22:29:22] File "schedule.wpi" not found, skip running schedule script.
[2024-03-14 22:29:22] Pending for incoming shutdown command...
[2024-03-14 22:31:05] Internet detected, apply network time to system and Witty Pi...
[2024-03-14 22:31:05] Applying network time to system...
[2024-03-14 22:31:10] Done :-)
[2024-03-14 22:31:10] Writing system time to RTC...
<2024-03-14 22:31:10> Done :-)
[xxxx-xx-xx xx:xx:xx] Witty Pi daemon (v4.14) is started.
[xxxx-xx-xx xx:xx:xx] Running on Raspberry Pi 4 Model B Rev 1.1
[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-03-14 22:31:42] Done :-)
[2024-03-14 22:31:42] Firmware ID: 0x26
[2024-03-14 22:31:42] Firmware Revison: 0x01
[2024-03-14 22:31:42] Current Vout=5.19V, Iout=0.79A
[2024-03-14 22:31:42] System starts up because the button is clicked.
[2024-03-14 22:31:47] Send out the SYS_UP signal via GPIO-17 pin.
[2024-03-14 22:31:47] File "schedule.wpi" not found, skip running schedule script.
[2024-03-14 22:31:47] Pending for incoming shutdown command...
[xxxx-xx-xx xx:xx:xx] Witty Pi daemon (v4.14) is started.
[xxxx-xx-xx xx:xx:xx] Running on Raspberry Pi 4 Model B Rev 1.1
[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-03-14 22:43:44] Done :-)
[2024-03-14 22:43:44] Firmware ID: 0x26
[2024-03-14 22:43:44] Firmware Revison: 0x01
[2024-03-14 22:43:44] Current Vout=5.11V, Iout=0.79A
[2024-03-14 22:43:44] System starts up because the button is clicked.
[2024-03-14 22:43:49] Send out the SYS_UP signal via GPIO-17 pin.
[2024-03-14 22:43:49] File "schedule.wpi" not found, skip running schedule script.
[2024-03-14 22:43:49] Pending for incoming shutdown command...
[2024-03-14 22:43:50] Shutting down system because button is clicked or GPIO-4 is pulled down.
[2024-03-14 22:43:50] Halting all processes and then shutdown Raspberry Pi...
[xxxx-xx-xx xx:xx:xx] Witty Pi daemon (v4.14) is started.
[xxxx-xx-xx xx:xx:xx] Running on Raspberry Pi 4 Model B Rev 1.1
[xxxx-xx-xx xx:xx:xx] Witty Pi is not detected, retry in one second...
[xxxx-xx-xx xx:xx:xx] Witty Pi is not detected, retry in one second...
[xxxx-xx-xx xx:xx:xx] Witty Pi is not detected, retry in one second...
[xxxx-xx-xx xx:xx:xx] Witty Pi is not detected, retry in one second...
[xxxx-xx-xx xx:xx:xx] Witty Pi is not detected, retry in one second...
[xxxx-xx-xx xx:xx:xx] Witty Pi is not connected, skip I2C communications...
<2024-03-14 22:44:07> Witty Pi is not connected, skip schedule script...
<2024-03-14 22:44:07> Send out the SYS_UP signal via GPIO-17 pin.
<2024-03-14 22:44:07> Pending for incoming shutdown command...
<2024-03-14 22:44:09> I2C read 0x01 0x08 11 failed (result=), retrying 1 ...
<2024-03-14 22:44:10> I2C read 0x01 0x08 11 failed (result=), retrying 2 ...
<2024-03-14 22:44:11> I2C read 0x01 0x08 11 failed (result=), retrying 3 ...
<2024-03-14 22:44:11> I2C read 0x01 0x08 11 failed (result=), and no more retry.
<2024-03-14 22:44:11> Unknown/incorrect shutdown reason: I2C read 0x01 0x08 11 failed (result=), and no more retry.
<2024-03-14 22:44:12> I2C read 0x01 0x08 55 failed (result=), retrying 1 ...
<2024-03-14 22:44:13> I2C read 0x01 0x08 55 failed (result=), retrying 2 ...
<2024-03-14 22:44:14> I2C read 0x01 0x08 55 failed (result=), retrying 3 ...
<2024-03-14 22:44:14> I2C read 0x01 0x08 55 failed (result=), and no more retry.

Log of the packages upgrade attached below.

Note: I2C and Serial Port activated. 1-Wire desactivated.

Thank you

 
Posted : 14/03/2024 11:25 pm
JeromeBriot
(@jeromebriot)
Posts: 10
Active Member
Topic starter
 

Sorry, I didn't notice that a new firmware was released a few days ago.

But same behavior with 2024-03-12-raspios-bookworm-arm64.img.xz

No need to update the packages this time. Just burn the image and install the Witty Pi software.

 
Posted : 15/03/2024 8:44 am
(@admin)
Posts: 479
Member Admin
 

Please double check your connection, Witty Pi's software complained that it can not find the I2C device.

When you Witty Pi gets powered, does its white LED blink?

 

 
Posted : 15/03/2024 9:16 am
JeromeBriot
(@jeromebriot)
Posts: 10
Active Member
Topic starter
 

Connection is OK. I only had to remove the Witty Pi to start the RPi and check the log.

I have used the Witty Pi 4 for months now. There was an issue with Bookworm in January that you fixed with the version 4.14. Everything worked perfectly until recently when I did some updates.

My guess is that there is something wrong with the new kernel 6.6.20

 

Edit: yes the LED blinks.

 
Posted : 15/03/2024 9:37 am
(@admin)
Posts: 479
Member Admin
 

Can you boot up your Pi with Witty Pi 4 mounted, by connecting power supply to your Raspberry Pi directly?

If so, you can then run "i2cdetect -y 1" and check if it can see your Witty Pi 4.

 

 
Posted : 15/03/2024 1:19 pm
JeromeBriot
(@jeromebriot)
Posts: 10
Active Member
Topic starter
 

@admin Yes I2C address of the board is listed :

     0  1  2  3  4  5  6  7  8  9  a  b  c  d  e  f
00:                         08 -- -- -- -- -- -- --
10: -- -- -- -- -- -- -- -- -- -- -- -- -- -- -- --
20: -- -- -- -- -- -- -- -- -- -- -- -- -- -- -- --
30: -- -- -- -- -- -- -- -- -- -- -- -- -- -- -- --
40: -- -- -- -- -- -- -- -- -- -- -- -- -- -- -- --
50: -- -- -- -- -- -- -- -- -- -- -- -- -- -- -- --
60: -- -- -- -- -- -- -- -- -- -- -- -- -- -- -- --
70: -- -- -- -- -- -- -- --

Here are the last lines of dmesg:

[   13.121223] i2c-bcm2835 fe804000.i2c: i2c transfer timed out
[   15.549553] bcmgenet fd580000.ethernet eth0: Link is Up - 1Gbps/Full - flow control rx/tx
[   16.843831] Bluetooth: RFCOMM TTY layer initialized
[   16.843867] Bluetooth: RFCOMM socket layer initialized
[   16.843889] Bluetooth: RFCOMM ver 1.11
[   17.245224] i2c-bcm2835 fe804000.i2c: i2c transfer timed out
[   20.413207] i2c-bcm2835 fe804000.i2c: i2c transfer timed out
[   24.477243] i2c-bcm2835 fe804000.i2c: i2c transfer timed out
[   30.519468] export_store: invalid GPIO 4
 
Posted : 15/03/2024 1:48 pm
JeromeBriot
(@jeromebriot)
Posts: 10
Active Member
Topic starter
 

Here some info from journalctl when the WittyPi board is connected and the RPi tries to start:

Mar 15 14:13:00 raspberrypi systemd[1]: Starting wittypi.service - LSB: Witty Pi 4 initialize script...
Mar 15 14:13:00 raspberrypi wittypi[566]: Starting Witty Pi 4 Daemon...
Mar 15 14:13:01 raspberrypi wittypi[584]: Witty Pi daemon (v4.14) is started.
Mar 15 14:13:01 raspberrypi wittypi[584]: Running on Raspberry Pi 4 Model B Rev 1.1
Mar 15 14:13:01 raspberrypi wittypi[714]: cat: /home/ornitho/wittypi/tmp/BUILD-DATA: No such file or directory
Mar 15 14:13:01 raspberrypi systemd[1]: Started wittypi.service - LSB: Witty Pi 4 initialize script.
Mar 15 14:13:01 raspberrypi wittypi[584]: Seems RTC has good time, write RTC time into system
Mar 15 14:13:01 raspberrypi wittypi[584]:   Writing RTC time to system...
Mar 15 14:13:02 raspberrypi sudo[784]:     root : PWD=/ ; USER=root ; COMMAND=/usr/bin/timedatectl set-ntp 0
Mar 15 14:13:02 raspberrypi sudo[784]: pam_unix(sudo:session): session opened for user root(uid=0) by (uid=0)
Mar 15 14:13:03 raspberrypi sudo[784]: pam_unix(sudo:session): session closed for user root
Mar 15 14:13:03 raspberrypi sudo[838]:     root : PWD=/ ; USER=root ; COMMAND=/usr/bin/date -s @1710508477
Mar 15 14:13:03 raspberrypi sudo[838]: pam_unix(sudo:session): session opened for user root(uid=0) by (uid=0)
Mar 15 14:14:37 raspberrypi sudo[838]: pam_unix(sudo:session): session closed for user root
Mar 15 14:14:37 raspberrypi wittypi[584]:   Done :-)
Mar 15 14:14:37 raspberrypi wittypi[584]: Firmware ID: 0x26
Mar 15 14:14:37 raspberrypi wittypi[584]: Firmware Revison: 0x01
Mar 15 14:14:37 raspberrypi wittypi[584]: Current Vout=5.19V, Iout=0.6A
Mar 15 14:14:37 raspberrypi wittypi[584]: System starts up because the button is clicked.
Mar 15 14:14:42 raspberrypi wittypi[584]: Send out the SYS_UP signal via GPIO-17 pin.
Mar 15 14:14:42 raspberrypi wittypi[584]: Pending for incoming shutdown command...
Mar 15 14:14:42 raspberrypi wittypi[1331]: Traceback (most recent call last):
Mar 15 14:14:42 raspberrypi wittypi[1331]:   File "<stdin>", line 22, in <module>
Mar 15 14:14:42 raspberrypi wittypi[1331]: RuntimeError: Error waiting for edge
Mar 15 14:14:42 raspberrypi wittypi[584]: Shutting down system because button is clicked or GPIO-4 is pulled down.
Mar 15 14:14:43 raspberrypi wittypi[584]: Halting all processes and then shutdown Raspberry Pi...
Mar 15 14:14:43 raspberrypi systemd[1]: Stopping wittypi.service - LSB: Witty Pi 4 initialize script...
Mar 15 14:14:43 raspberrypi wittypi[1387]: Stopping Witty Pi 4 Daemon...
Mar 15 14:14:43 raspberrypi wittypi[1387]: /etc/init.d/wittypi: line 25: kill: (743) - No such process
Mar 15 14:14:43 raspberrypi systemd[1]: wittypi.service: Deactivated successfully.
Mar 15 14:14:43 raspberrypi systemd[1]: Stopped wittypi.service - LSB: Witty Pi 4 initialize script.
 
Posted : 15/03/2024 2:18 pm
JeromeBriot
(@jeromebriot)
Posts: 10
Active Member
Topic starter
 

The problem is clearly related to GPIO 04:

Python 3.11.2 (main, Mar 13 2023, 12:18:29) [GCC 12.2.0] on linux
Type "help", "copyright", "credits" or "license" for more information.
>>> import RPi.GPIO as GPIO
>>> GPIO.setwarnings(False)
>>> GPIO.setmode(GPIO.BCM)
>>> pin = 4
>>> pull = GPIO.PUD_UP
>>> GPIO.setup(pin, GPIO.IN, pull)
>>> edge = GPIO.FALLING
>>> GPIO.wait_for_edge(pin, edge)
Traceback (most recent call last):
  File "<stdin>", line 1, in <module>
RuntimeError: Error waiting for edge
 
Posted : 15/03/2024 2:40 pm
(@admin)
Posts: 479
Member Admin
 

@jeromebriot Your new log shows no error on I2C communication now. The firmware ID, firmware revision, current output voltage and current etc., they are are values from the I2C registers, which are correctly printed out.

What I see in the log, is that it claimed the GPIO-4 was pulled down, so Witty Pi shut down the Pi. If you didn't tap the button, or short GPIO-4 to GND, then the problem may come from gpio-util again.

You may do this test: enter the wittyPi directory, and then run "sudo ./daemon.sh", if something goes wrong you will see error message on screen.

 

 
Posted : 15/03/2024 2:42 pm
JeromeBriot
(@jeromebriot)
Posts: 10
Active Member
Topic starter
 

@admin Here is the result of the daemon script:

Witty Pi daemon (v4.14) is started.
Running on Raspberry Pi 4 Model B Rev 1.1
mount: (hint) your fstab has been modified, but systemd still uses
       the old version; use 'systemctl daemon-reload' to reload.
cat: /home/ornitho/wittypi/tmp/BUILD-DATA: No such file or directory
umount: /home/ornitho/wittypi/tmp: target is busy.
[ raspi-gpio is deprecated - try `pinctrl` instead ]
Witty Pi is not detected, retry in one second...
Witty Pi is not detected, retry in one second...
Witty Pi is not detected, retry in one second...
Witty Pi is not detected, retry in one second...
Witty Pi is not detected, retry in one second...
Witty Pi is not connected, skip I2C communications...
Witty Pi is not connected, skip schedule script...
Send out the SYS_UP signal via GPIO-17 pin.
Pending for incoming shutdown command...
Traceback (most recent call last):
  File "<stdin>", line 22, in <module>
RuntimeError: Error waiting for edge
Error: Read failed
Error: Read failed
Error: Read failed
Error: Read failed
Unknown/incorrect shutdown reason: I2C read 0x01 0x08 11 failed (result=), and no more retry.
Error: Read failed
Error: Read failed
Error: Read failed
Error: Read failed
/home/ornitho/wittypi/utilities.sh: line 475: I2C read 0x01 0x08 55 failed (result=), and no more retry.&0xBF: syntax error in expression (error token is "read 0x01 0x08 55 failed (result=), and no more retry.&0xBF")

That's the same error I mentioned in my previous posts. The issue is at line 297 of gpio-util.sh

The script didn't wait for the falling edge to occur on GPIO 04. So the Witty Pi shutdown the RPi immediately.

Note that GPIO 04 is always at 1 (high level).

 
Posted : 15/03/2024 2:55 pm
JeromeBriot
(@jeromebriot)
Posts: 10
Active Member
Topic starter
 

@admin Here is a quick (and maybe ugly) workaround by replacing RPi.GPIO by GPIO Zero in gpio-util.sh:

doWfi()
{
  if [[ $naming -eq $PHYSICAL ]]; then
    pin=${PHY_BCM["$2"]}
  else
    pin=$2
  fi
  edge=$3
  if ! python3 -c "import gpiozero" > /dev/null 2>&1 ; then
    echo 'Python 3 or GPIO Zero for Python 3 is not installed, using less efficient implementation now.'
    local running=1
    local prev=$(doRead '' $pin)
    while [[ $running -eq 1 ]]; do
	  local cur=$(doRead '' $pin)
	  if [[ ($edge == 'both' && $prev -ne $cur)
	     || ($edge == 'falling' && $prev -eq 1 && $cur -eq 0)
		 || ($edge == 'rising' && $prev -eq 0 && $cur -eq 1) ]]; then
	    running=0
	  fi
	  prev=$cur
	  sleep 0.2
    done
  else
# Python Code Begins
python3 - << EOF
from gpiozero import Button
import subprocess
getPin = subprocess.run(['printf', '$pin'], stdout=subprocess.PIPE)
pin = int(getPin.stdout.decode('utf-8'))
getPull = subprocess.run(['printf', '${PIN_PULL["$pin"]}'], stdout=subprocess.PIPE)
pull = getPull.stdout.decode('utf-8')
if pull == 'down':
  pull = False
else:
  pull = True

btn = Button(pin, pull_up=pull)

btn.wait_for_press()

EOF
# Python Code Ends
  fi
}

It solves my issue. Now the RPi starts with the Witty Pi connected and a click on the Witty Pi's button turns it off.

 
Posted : 15/03/2024 3:18 pm
msage reacted
(@msage)
Posts: 46
Trusted Member
 

I'll be trying this at the weekend, but it looks like this is the same issue as I reported here. Thank you so much! https://www.uugear.com/forums/technial-support-discussion/witty-pi-4-low-voltage-shutdown/

 
Posted : 15/03/2024 9:40 pm
(@dynalogic)
Posts: 1
New Member
 

Same problem with one of my rpi4+wp4

[xxxx-xx-xx xx:xx:xx] Witty Pi daemon (v4.13) is started.
[xxxx-xx-xx xx:xx:xx] Running on Raspberry Pi 4 Model B Rev 1.4
[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-03-11 21:39:01] Done :-)
[2024-03-11 21:39:01] Firmware ID: 0x26
[2024-03-11 21:39:01] Firmware Revison: 0x05
[2024-03-11 21:39:01] Current Vin=12.39V, Vout=5.06V, Iout=0.96A
[2024-03-11 21:39:01] System starts up because the button is clicked.
[2024-03-11 21:39:36] Send out the SYS_UP signal via GPIO-17 pin.
[2024-03-11 21:39:37] Pending for incoming shutdown command...
[2024-03-11 21:39:37] Schedule next shutdown at: 2024-03-12 05:46:00
[2024-03-11 21:39:37] Schedule next startup at: 2024-03-12 05:50:00
[xxxx-xx-xx xx:xx:xx] Witty Pi daemon (v4.13) is started.
[xxxx-xx-xx xx:xx:xx] Running on Raspberry Pi 4 Model B Rev 1.4
[xxxx-xx-xx xx:xx:xx] Witty Pi is not detected, retry in one second...
[xxxx-xx-xx xx:xx:xx] Witty Pi is not detected, retry in one second...
[xxxx-xx-xx xx:xx:xx] Witty Pi is not detected, retry in one second...
[xxxx-xx-xx xx:xx:xx] Witty Pi is not detected, retry in one second...
[xxxx-xx-xx xx:xx:xx] Witty Pi is not detected, retry in one second...
[xxxx-xx-xx xx:xx:xx] Witty Pi is not connected, skip I2C communications...
Error: Read failed
[2024-03-11 21:53:00] I2C read 0x01 0x08 58 failed (result=), retrying 1 ...
Error: Read failed
[2024-03-11 21:53:02] I2C read 0x01 0x08 58 failed (result=), retrying 2 ...
Error: Read failed
[2024-03-11 21:53:04] I2C read 0x01 0x08 58 failed (result=), retrying 3 ...
Error: Read failed
[2024-03-11 21:53:05] I2C read 0x01 0x08 58 failed (result=), and no more retry.
/home/pi/wittypi/utilities.sh: line 194: 0x7F&I2C read 0x01 0x08 58 failed (result=), and no more retry.: syntax error in expression (error token is "read 0x01 0x08 58 failed (result=), and no more retry.")
Error: Read failed
[2024-03-11 21:53:08] I2C read 0x01 0x08 59 failed (result=), retrying 1 ...
Error: Read failed
[2024-03-11 21:53:10] I2C read 0x01 0x08 59 failed (result=), retrying 2 ...
Error: Read failed
[2024-03-11 21:53:12] I2C read 0x01 0x08 59 failed (result=), retrying 3 ...
Error: Read failed
[2024-03-11 21:53:13] I2C read 0x01 0x08 59 failed (result=), and no more retry.
Error: Read failed
[2024-03-11 21:53:15] I2C read 0x01 0x08 60 failed (result=), retrying 1 ...
Error: Read failed
[2024-03-11 21:53:17] I2C read 0x01 0x08 60 failed (result=), retrying 2 ...
Error: Read failed
[2024-03-11 21:53:19] I2C read 0x01 0x08 60 failed (result=), retrying 3 ...
Error: Read failed
[2024-03-11 21:53:20] I2C read 0x01 0x08 60 failed (result=), and no more retry.
Error: Read failed
[2024-03-11 21:53:22] I2C read 0x01 0x08 61 failed (result=), retrying 1 ...
Error: Read failed
[2024-03-11 21:53:24] I2C read 0x01 0x08 61 failed (result=), retrying 2 ...
Error: Read failed
[2024-03-11 21:53:26] I2C read 0x01 0x08 61 failed (result=), retrying 3 ...
Error: Read failed
[2024-03-11 21:53:27] I2C read 0x01 0x08 61 failed (result=), and no more retry.
Error: Read failed
[2024-03-11 21:53:29] I2C read 0x01 0x08 63 failed (result=), retrying 1 ...
Error: Read failed
[2024-03-11 21:53:31] I2C read 0x01 0x08 63 failed (result=), retrying 2 ...
Error: Read failed
[2024-03-11 21:53:33] I2C read 0x01 0x08 63 failed (result=), retrying 3 ...
Error: Read failed
[2024-03-11 21:53:34] I2C read 0x01 0x08 63 failed (result=), and no more retry.
Error: Read failed
[2024-03-11 21:53:36] I2C read 0x01 0x08 64 failed (result=), retrying 1 ...
Error: Read failed
[2024-03-11 21:53:38] I2C read 0x01 0x08 64 failed (result=), retrying 2 ...
Error: Read failed
[2024-03-11 21:53:40] I2C read 0x01 0x08 64 failed (result=), retrying 3 ...
Error: Read failed
[2024-03-11 21:53:41] I2C read 0x01 0x08 64 failed (result=), and no more retry.

 

Had the latest firmware but not the v4.14 (was 4.13) software version. Updated to 4.14 but if it is a transient problem I am not sure it is definitely fixed by it. Will wait and see but if your POC fix makes sense @JeromeBriot I would also love for the uugear team to have a look and fix it in the code :).

Best,

 
Posted : 16/03/2024 2:48 pm
(@msage)
Posts: 46
Trusted Member
 

Just to add I've just updated my pi zero 2 with a witty pi 3 and it's exhibiting the same behaviour. I'm not going to get a chance to test the fix this weekend, but will probably do it on Monday. 

 
Posted : 16/03/2024 2:57 pm
(@msage)
Posts: 46
Trusted Member
 

@jeromebriot is that the complete file or just the alterations you've made? I need to update a couple of mine and want to make sure it's right 🙂

 
Posted : 16/03/2024 2:58 pm
Page 1 / 2
Join Waitlist We will inform you when the product arrives in stock. Please leave your valid email address below.