Gordon999 / RPiCamGUI

44 stars 4 forks source link

Does it work with Raspberry pi zero 2W connected to a camera module 3? #2

Closed biprav closed 8 months ago

biprav commented 9 months ago

Hi. I have tried using the GUI with Raspberry pi zero 2W which is connected to a 12 MP camera module 3. But I have came across an error which I am unable to solve -

python3 ~/RPiCamGUI.py
<frozen importlib._bootstrap>:228: RuntimeWarning: Your system is neon capable but pygame was not built with support for it. The performance of some of your blits could be adversely affected. Consider enabling compile time detection with environment variables like PYGAME_DETECT_AVX2=1 if you are compiling without cross compilation.
pygame 2.5.2 (SDL 2.0.14, Python 3.9.2)
Hello from the pygame community. https://www.pygame.org/contribute.html
Traceback (most recent call last):
  File "/home/biprav/RPiCamGUI.py", line 193, in <module>
    Pi = int(mod[3])
ValueError: invalid literal for int() with base 10: 'Zero'

I am unable to resolve this issue. I wanted to know whether the RPiCamGUI will work with the pi zero 2W? Please help me out. Thank you.

Gordon999 commented 9 months ago

Sadly l think the answer is it won't work on a pi zero 2. Not enough ram ?

I will fix the error but it still won't run.

biprav commented 9 months ago

That is what I thought. Still can you kindly fix the error and let me know so that I can atleast try with pi zero 2. Thank you.

Gordon999 commented 9 months ago

It will be fixed when l upload v4.83.

biprav commented 9 months ago

Thank you. By the way, can you tell me which variant of Pi 4 or 5 would be needed to run the GUI?

Gordon999 commented 9 months ago

Try v4.83 on the pi zero2w with Bookworm 32bit, try setting it to x11 rather than wayland, it should work , if slowly...

Gordon999 commented 9 months ago

Any pi4 or 5 should be OK.

biprav commented 9 months ago

Try v4.83 on the pi zero2w with Bookworm 32bit, try setting it to x11 rather than wayland, it should work , if slowly...

Thank you for the fix. I will try running the GUI and let you know of the outcome.

biprav commented 9 months ago

Try v4.83 on the pi zero2w with Bookworm 32bit, try setting it to x11 rather than wayland, it should work , if slowly...

I tried using the new v4.83 on pi zero 2w, the following error comes,

`python3 ~/RPiCamGUI.py

:228: RuntimeWarning: Your system is neon capable but pygame was not built with support for it. The performance of some of your blits could be adversely affected. Consider enabling compile time detection with environment variables like PYGAME_DETECT_AVX2=1 if you are compiling without cross compilation. pygame 2.5.2 (SDL 2.0.14, Python 3.9.2) Hello from the pygame community. https://www.pygame.org/contribute.html Pi 0 sh: 1: rpicam-vid: not found No Camera Found` I am using Bullseye as the OS. Not able to install bookworm. What are your thoughts on the issue? Thank you.
Gordon999 commented 9 months ago

The problem appears to be that Legacy Bullseye doesn't have rpicam-apps, so I have made a version using libcamera-apps. Try LibCamGUI.py

biprav commented 9 months ago

The problem appears to be that Legacy Bullseye doesn't have rpicam-apps, so I have made a version using libcamera-apps. Try LibCamGUI.py

It works with Lib cam GUI but it is very very slow. Not so usable with the laggy nature of pi zero 2w.

Gordon999 commented 9 months ago

Try v4.84 should work faster, particularly to button clicks...

biprav commented 9 months ago

Try v4.84 should work faster, particularly to button clicks...

Okay I will try that. By the way how to install the LibCamGUI? The installation steps are not included in the readme. Also, will 4 GB of Pi4 or Pi5 variant be enough to run the GUI smoothly? And which should I prefer?

Gordon999 commented 9 months ago

Simply copy LibCamGUI.py to your /home/USERNAME directory. Install opencv with sudo apt install python3-opencv Run LibCamGUI.py however you usually do, either python3 LibCamGUI.py or through idle/ Thonny etc.

Pi4 or 5 4GB will be fine.

Let me know what you think is working slowly.

biprav commented 9 months ago

Simply copy LibCamGUI.py to your /home/USERNAME directory. Install opencv with sudo apt install python3-opencv Run LibCamGUI.py however you usually do, either python3 LibCamGUI.py or through idle/ Thonny etc.

Pi4 or 5 4GB will be fine.

Let me know what you think is working slowly.

I tried with the LibcamGUI. The UI and the buttons all are very laggy and slow. The GUI crashes after a while. I dont think it will work on pi zero 2W

Gordon999 commented 8 months ago

Sorry it doesn't meet your needs. I find the UI and buttons acceptable even on a PiZero2W. It takes about twice the times of a Pi4 which is expected when you go for capturing a video/still/timelapse. Taking a still takes about 7 secs, a pi4 takes 6 seconds. It's just the way it works. Videos will start in about 7 seconds, about 4 if you turn off v_ preview. The pi zero2w is running about 85% cpu so trying to do anything else whilst it's running is not recommended.

biprav commented 8 months ago

You have developed a phenomenal GUI for the pi camera. Unfortunately my system does not support it efficiently. But I have ordered a Pi 5 today and cannot wait to use your GUI for my work.

biprav commented 8 months ago

Another thing, is there any way I can talk with you personally regarding a project like through Email?

Gordon999 commented 8 months ago

No , sorry. Just use this method.

What is it you are trying to achieve? Capturing fast etc is not what is for, unless you use timelapse with an interval of 0.

Gordon999 commented 8 months ago

LibcamGUI now merged into RpiCamGUI.py, so only one version needed.

Gordon999 commented 8 months ago

Assumed resolved