Closed darksidelemm closed 1 year ago
Hi, I think it's more likely to be a power supply issue as we have seen these on other Pi Zeros running libcamera. @naushir might be able to suggest some configuration tweaks that may help.
Could temperature also be a factor? I was noticing that with the camera running continuously, I was quickly hitting >90 degrees C core temperature, and things would start to get a but unstable.
I've moved to only starting the camera on for the few seconds i'm doing image capture and then stopping it afterwards, which has kept the temperatures reasonable (<80 degrees C).
I'll definitely look into power issues, good point on that one.
Can you try adding over_voltage=4
at the bottom of /boot/config.txt
, reboot and see if things improve?
Will try that out when I get a chance next. What do different settings for over_voltage do? (e.g. I'm guessing it bumps up some core voltages?)
That's correct, it will help if the board is not drawing enough power at the nominal settings. More details can be found here
hi @darksidelemm,
did you fix your issue - if yes how?
how well does picamera2 work with Raspberry Pi Camera Module V3 and Raspberry Pi Zero W? is the cpu of the Raspberry Pi Zero W good enough?
i think of a similar project - make a photo or live video - and send it over wireless or LTE to a server. would that be possible?
Thanks
So this is probably not a memory issue, so I'm going to close the issue to avoid that confusion.
I ended up being able to use picamera2. + PiCam v3 in my application by shutting the camera down between image captures (one capture approx every 40 seconds). This was mainly to lower CPU usage and heat generated, as if I kept it on continuously I would end up overheating the RPi. This was at full resolution however, so at lower resolutions you might be OK.
@darksidelemm does it mean you use 2 cameras at the same time? do you have some code to share? i would like to try it to.
wouldnt the Raspberry Pi Zero 2 W better for what you do? - it has a faster cpu...
My code is pretty application specific, though:
Describe the bug I'm using the picamera2 library to capture JPEG images for transmission to ground from a high-altitude balloon payload. I've been using the legacy camera interface for many years with great success, but would now like to use the new Pi Camera v3, which requires using the new picamera2 library.
The process I am using is:
Every 'round' of transmission, I save 5x images to disk in sequence, pick the largest file (which when using JPEG is handily the one with the most 'detail' in it), and then do some processing (e.g. resizing) and transmit the image.
This runs fine for a while, but eventually the thread capturing the images crashes with a stack trace (it appears to occur when i call self.cam.capture_file)
I'm wondering if this is a lack-of-memory issue? The Pi Zero W doesn't have that much memory to begin with after all. (In fact enabling the legacy camera interface on bullseye on a Pi Zero W results in so much memory being used that the Pi will no longer boot...) Given I am only trying to get a single still image, is there any way to reduce the amount of buffers used even further (i believe buffer_count already defaults to 1, but I think there are still multiple buffers used).
To Reproduce Maybe a little bit difficult. The script linked above may work on other installs, but is expecting other hardware that will not exist.
Expected behaviour It keeps running without crashing :-)
Console Output, Screenshots
I get the following message in dmesg when the issue occurs:
A look at /proc/meminfo when things were happening normally showed:
... also i'm seeing the same amount of CmaFree once the capture software has crashed, so I'm guessing whatever buffers were allocated haven't been unallocated.
Hardware : Platform: Pi Zero W Camera: Pi Camera v3 Distro: Raspbian Bullseye