Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

PiJuice hat GUI not working with Pi5 #1106

Open
EnnPeeTee opened this issue Nov 30, 2024 · 6 comments
Open

PiJuice hat GUI not working with Pi5 #1106

EnnPeeTee opened this issue Nov 30, 2024 · 6 comments

Comments

@EnnPeeTee
Copy link

EnnPeeTee commented Nov 30, 2024

I wonder if anyone can help, please?

I am trying to get a PiJuice hat GUI working with a Pi5. Previous experiences with other PiJuice hats with 3B+ have been totally brilliant.

After installing pijuice_gui , the standard icon does not appear in the taskbar, and whilst PiJuice Settings appears in the Preferences menu, it produces the warning;

Failed to execute child process "/usr/bin/pijuice_gui_" (No such file or directory)._

Inspecting /usr/bin/ reveals that a multiplicity of pijuce_xxxx files are present. Is there a simple solution?

Incidentally, there is a further warning that pops up at boot telling me the PiJuice "... is not capable of supplying 5A
Power to peripherals will be restricted" - this is rather academic for my application only has a GPS device attached which consumes a mere 85mA from the USB bus. Can I disregard this warning or is there a method of telling Pi5 to downgrade the available power on the collective USB bus?

Any guidance or pointing in the right direction will be greatly appreciated!

@tvoverbeek
Copy link
Contributor

The default OS installation for the Pi5 uses Wayland for display (not X11).
pijuice_gui uses the "old" TkInter (TCL/Tk) for the displsy of the GUI.
TkInter is not supported under Wayland.
So for the Pi5 you can only use pijuice_cli in a terminal window.

If you really want to use the GUI you can run raspi-config (sudo raspi-config in a terminal),
Select. Advanced Options -> Wayland -> X11 -> OK
After a reboot pijuice_gui should work.
With a proper install of pijuice the output of ls -l /usr/bin/pijuice_gui should be:

$ ls -l --color=none /usr/bin/pijuice_gui
lrwxrwxrwx 1 root root 22 Jan  7  2024 /usr/bin/pijuice_gui -> /usr/bin/pijuice_gui64

To get the GUI working on Wayland it has to be completely rewritten with a graohics toolkit supported by Wayland (i.e PyQt5)

Regarding the message the PiJuice "... is not capable of supplying 5A Power to peripherals will be restricted"
The message is correct since the Pijuice can only deliver about 2A at 5V. For normal use (e.g. your academic case with only a GPS device) it should work without problems. Trying to use power hungry peripherals will be problematic)

@EnnPeeTee
Copy link
Author

Thank you so much for your excellent and most expansive guidance - it is greatly appreciated!

I shall have to look at command line operation, but I am new to the Pi and as a Windows person, [forgive me - it seemed a good idea at the time!] this means a new learning curve, but I coped with CP/M & DOS. It is just the brain is 50 years older....... Ha!

Many thanks again!

@tvoverbeek
Copy link
Contributor

@EnnPeeTee Just FYI pijuice_cli is a menu driven text based program. if you run it in. a terminal window on the desktop, you can even use mouse clicks to make a selection (no need to use the direction keys to get to the selection you want).

PS I also know what CP/M is. Also used Atari TOS which was derived from CP/M.

@tvoverbeek
Copy link
Contributor

tvoverbeek commented Dec 1, 2024 via email

@EnnPeeTee
Copy link
Author

EnnPeeTee commented Dec 2, 2024

Thanks for the info. The CLI variant will be perfectly adequate for my needs, if I ever [ever] get the device to shut down properly.

After yet another whole day stumbling through endless dead-ends I decided to perform a completely clean installation and start again. Not that I am aware it makes any difference, all actions were performed on the Pi, as opposed to via a mixture of SSH and VNC from a Windows machine.

'chmod 750 $HOME' stops any shutdown. In fact it prohibits Pijuice accessing /home/pi so it cannot see the shutdown.py file. All that happened was the Pi would never shut down when the power was pulled, and it just continued to power off the battery.

Reverting to 'chmod 755 $HOME' overcomes that problem but the only controlled shutdown period I can get when power is pulled is about 5 seconds. Setting the delay to 30 second, 1 minute etc has no effect. I therefore have no control over the duration. Incidentally I have modified the shutdown script to log the events and indeed pijuice is running the file but totally disregarding the set shutdown delay value.

Another matter which concerns me greatly is that despite a proud declaration that the Pijuice is factory-set to the correct battery as supplied, 3 of my pijuice hats were set for PJLIPO [12AH] batteries yet the standard BP&X [1.82AH] battery is fitted. I am concerned that overcharging will account for reduced capacity.

So I am well and truly stuck and beginning to wonder if PiJuice is compatible with Bookworm/Pi5. Regrettably I need to use Pi5s because of their processing speed and this means unfortunately I cannot revert to Bullseye, which I have running on Pi3B+s and PiJuice hats work brilliantly and shut down exactly as expected.

Any ideas?

@EnnPeeTee
Copy link
Author

EnnPeeTee commented Dec 3, 2024

Could this be a Python3 version issue? The perfectly performing 3B+ units are running Python3 v 3.9.2, whereas the P5s are running Python3 v 3.11.2

UPDATE: Fresh installation of Bookworm 64 on a Pi 3B+ - Python3 v3.11.2 - same problem as Pi5 - 4-5 seconds to shutdown, despite being set to 60 seconds - no control. Only saving grace is that when power is reapplied, at least it boots up automatically, unlike the Pi5 which requires a manual press of the On switch.

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
None yet
Projects
None yet
Development

No branches or pull requests

2 participants