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

[Solved / Archived] WittyPi 3 mini on Pi Zero 2W and WittyPi 4 on Pi 4

32 Posts
4 Users
8 Likes
1,697 Views
(@msage)
Posts: 46
Trusted Member
Topic starter
 

Hi,

My wittypi's have been working fine for ages. I recently upgraded to bookworm and it everything was still working. I've just done updates (including a kernel upgrade) on both devices now neither of my wittypi's appear to be working to their schedules and aren't shutting down.

This is the log from one of the pis

 

[2023-12-08 05:30:31] Pending for incoming shutdown command...
[2023-12-08 05:30:31] Schedule next shutdown at: 2023-12-08 17:30:00
[2023-12-08 05:30:32] Schedule next startup at: 2023-12-11 05:30: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] Seems RTC has good time, write RTC time into system
[xxxx-xx-xx xx:xx:xx] Writing RTC time to system...
[2023-12-08 08:26:25] Done :-)
[2023-12-08 08:26:25] Firmware ID: 0x26
[2023-12-08 08:26:25] Firmware Revison: 0x01
[2023-12-08 08:26:25] Current Vout=5.02V, Iout=1.56A
[2023-12-08 08:26:25] System starts up because scheduled startup is due.
[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...
[2023-12-08 12:13:15] Done :-)
[2023-12-08 12:13:15] Firmware ID: 0x26
[2023-12-08 12:13:15] Firmware Revison: 0x01
[2023-12-08 12:13:15] Current Vout=5.02V, Iout=1.72A
[2023-12-08 12:13:15] System starts up because scheduled startup is due.
[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...
[2023-12-11 05:30:26] Done :-)
[2023-12-11 05:30:26] Firmware ID: 0x26
[2023-12-11 05:30:26] Firmware Revison: 0x01
[2023-12-11 05:30:26] Current Vout=5.03V, Iout=1.63A
[2023-12-11 05:30:26] System starts up because scheduled startup is due.
[2023-12-11 09:20:56] Copying "studypi.wpi" to "schedule.wpi"...
[2023-12-11 09:20:56] Running the script...
[2023-12-11 09:20:56] Schedule next shutdown at: 2023-12-11 17:30:00
[2023-12-11 09:20:56] Schedule next startup at: 2023-12-12 05:30:00
[2023-12-11 09:20:57] Done :-)
[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...
[2023-12-11 09:29:16] Done :-)
[2023-12-11 09:29:16] Firmware ID: 0x26
[2023-12-11 09:29:16] Firmware Revison: 0x01
[2023-12-11 09:29:16] Current Vout=5.01V, Iout=1.61A
[2023-12-11 09:29:16] System starts up because scheduled startup is due.
[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...
[2023-12-11 13:18:34] Done :-)
[2023-12-11 13:18:34] Firmware ID: 0x26
[2023-12-11 13:18:34] Firmware Revison: 0x01
[2023-12-11 13:18:34] Current Vout=5.02V, Iout=1.72A
[2023-12-11 13:18:34] System starts up because scheduled startup is due.

Interestingly if I look at the wittypi menu, I get the following:

>>> Current temperature: 44.625°C / 112.325°F
>>> Your system time is: 2023-12-11 22:18:49 GMT
>>> Your RTC time is:    2023-12-11 22:18:51 GMT
>>> Vout=5.10V, Iout=1.22A
Now you can:
  1. Write system time to RTC
  2. Write RTC time to system
  3. Synchronize with network time
  4. Schedule next shutdown [11 17:30:00]
  5. Schedule next startup  [12 05:30:00]
  6. Choose schedule script [in use]
  7. Set low voltage threshold
  8. Set recovery voltage threshold
  9. Set over temperature action
 10. Set below temperature action
 11. View/change other settings...
 12. Reset data...
 13. Exit
What do you want to do? (1~13)

 

As you can see the shutdown time is well past and the device hasn't shutdown. 

 

I am guessing this is a problem with a recent raspberry pi bookworm OS update as it's happening on both devices across two different types of pi.

 

Any advice?

 

Thanks

 
Posted : 11/12/2023 11:20 pm
causing4132 reacted
Topic Tags
(@causing4132)
Posts: 7
Active Member
 

@admin I don't have access to the device right now so I can't check the kernel version. Other than that it's December 5th 2023 bookworm release, Lite edition (no desktop), 64 bit on Pi Zero 2 W for me.

 
Posted : 02/01/2024 12:26 pm
(@msage)
Posts: 46
Trusted Member
Topic starter
 

@admin I'm not sure of the release date, are there any commands you want me to run?

My pi 4 is running bookworm 12, 6.1.0 64bit, full OS

My pi zero 2 is bookworm 12, 6.1.0 32bit, full OS

Both running raspberry pi OS fresh installs from the raspberry pi writer. 

As I think I said in an earlier post it initially worked, then I guess an update broke it, there is a chance that update has been "fixed" and it isn't a problem any longer. I can try uncommenting the changes at some point, but it might not be this week.

Could you advise what the commented out bit of the script actually does? Thanks

 
Posted : 02/01/2024 12:34 pm
(@admin)
Posts: 479
Member Admin
 

@msage I guess you mean this code block:

# delay until GPIO pin state gets stable
counter=0
while [ $counter -lt 5 ]; do  # increase this value if it needs more time
  if [ $(gpio -g read $HALT_PIN) == '1' ] ; then
    counter=$(($counter+1))
  else
    counter=0
  fi
  sleep 1
done

This code repeatly reads GPIO-4 for every second, and will not stop until GPIO-4 has the same status for 5 readings in a row.

It may also be helpful if you can paste the complete error message you have saw.

 

 
Posted : 04/01/2024 11:40 am
(@msage)
Posts: 46
Trusted Member
Topic starter
 

@admin So the error was being generated by the systemctl this is all the errors I could find:

On the pi zero 2 (witty pi 3 mini), I'm getting this every second:
Dec 13 10:03:18 livingroompi wittypi[801]: /home/pi/wittypi/daemon.sh: line 119: [: too many arguments

On the pi 4 (witty pi 4) I'm getting this every second:
Dec 13 10:03:51 studykioskpi wittypi[589]: /home/pi/wittypi/daemon.sh: line 155: [: too many arguments

 
Posted : 04/01/2024 11:44 am
(@admin)
Posts: 479
Member Admin
 

@msage since you are using Witty Pi 3 Mini, the line that referred by the error message is this one.

It is exactly the same part of code as I previously mentioned. The error most probably comes from gpio function, which is provided by gpio-util.sh and is a wrapper of raspi-gpio. The change from raspi-gpio may indeed cause issue like this, but I can not reproduce it yet.

 
Posted : 04/01/2024 11:55 am
(@causing4132)
Posts: 7
Active Member
 

I checked the OS details on my device, here it is:

uname -a
Linux pi-zero2 6.1.0-rpi7-rpi-v8 #1 SMP PREEMPT Debian 1:6.1.63-1+rpt1 (2023-11-24) aarch64 GNU/Linux
 
Posted : 06/01/2024 5:06 pm
(@causing4132)
Posts: 7
Active Member
 

Posted by: @msage

As I think I said in an earlier post it initially worked, then I guess an update broke it, there is a chance that update has been "fixed" and it isn't a problem any longer. I can try uncommenting the changes at some point, but it might not be this week.

Unfortunately it's still happening, I just did an `apt update && apt upgrade`, uncommented the lines and it doesn't work (same error) 🙁

 

 
Posted : 06/01/2024 5:22 pm
(@msage)
Posts: 46
Trusted Member
Topic starter
 

I've just set up a pi zero wh with a mini 4, fresh install and I am still getting the issue, so I can't explain why your test version is working!

 
Posted : 07/01/2024 1:06 pm
Dobby
(@dobby)
Posts: 6
Active Member
 

Hello everyone,

Is there already a solution for this problem in connection with bookworm?
I'm using 20 Rapis, which are supposed to go into the field in the next few days but don't shut down when the power button on the WittyPi is pressed.

Many thanks in advance.

 
Posted : 15/01/2024 4:10 pm
(@msage)
Posts: 46
Trusted Member
Topic starter
 

@dobby The fix I posted earlier about commenting out the GPIO section is still working...

 
Posted : 15/01/2024 4:12 pm
Dobby reacted
(@admin)
Posts: 479
Member Admin
 

We managed to reproduce this issue after running "sudo apt upgrade" on bookworm system.

We confirm the issue is due to the change of raspi-gpio, which newly appended this text to the output of every command call:

[ raspi-gpio is deprecated - try `pinctrl` instead ]

We will have to modify the gpio-utils.sh to have this output properly processed.

The software for Witty Pi currently does not support Raspberry Pi 5, because raspi-gpio will not get updated to have RPi 5 supported. We will have to modify the gpio-utils.sh to use pinctrl to replace raspi-gpio, and this work is not that small.

 
Posted : 22/01/2024 6:01 pm
(@msage)
Posts: 46
Trusted Member
Topic starter
 

@admin I did say earlier in the thread I thought the extra output was causing the issue, but I couldn't work out how to fix.

With regard to the pi 5 I think that's probably a separate issue that needs it's own thread update?

 
Posted : 22/01/2024 6:04 pm
(@admin)
Posts: 479
Member Admin
 

@msage Supporting RPi 5 and this issue is somehow related, because they all request to modify the gpio-utils.sh.

We can either make a minor update on gpio-utils.sh first, to fix the output of raspi-gpio; or maybe we directly update gpio-utils.sh and use pinctrl instead -- which should also fixed this issue.

We will evaluate both ways and decide what to do. At the time being I think it is better to make minor update first, to make sure RPi4 can work. Updating to pinctl needs more time.

 

 
Posted : 22/01/2024 6:11 pm
msage reacted
(@admin)
Posts: 479
Member Admin
 

After further investigation, we realize that the culprit is actually not that appended text message, but the change of output format for raspi-gpio. The newer version of raspi-gpio removed the "fsel=" (function selection) from the output, which causes the error of result parsing. We checked the repository of raspi-gpio and surprisely found that this change had been made about 3 years ago! It turns out that Raspberry Pi OS includes a very old version of raspi-gpio until the recent change.

We have modified gpio-util.sh and made it work with both old and new versions of raspi-gpio. We also added some messages to tell users that the current software version doesn't support Raspberry Pi 5. The software is now officially upgraded to V4.14, and you can view the changes here.

 
Posted : 23/01/2024 2:48 pm
causing4132 reacted
(@msage)
Posts: 46
Trusted Member
Topic starter
 

@admin Will the witty pi 3 (and mini) get this update or should I manually make the changes?

 
Posted : 23/01/2024 6:22 pm
causing4132 reacted
Page 2 / 3
Join Waitlist We will inform you when the product arrives in stock. Please leave your valid email address below.