Testing ESP32-CAM

I just got an ESP32-CAM from a friend, but he's not sure if it's working properly. I'm testing it using the Arduino IDE with the example camera code. I’ve wired the ESP32-CAM to an Arduino as the programmer. The code uploads successfully, but I gett this error in the serial monitor:
E (396) quad_psram: PSRAM ID read error 0xffffffff, PSRAM chip not found or not supported
E (396) quad_psram: PSRAM ID read error 0xffffffff, PSRAM chip not found or not supported
62 Replies
melta101
melta1012mo ago
interesting... i never gotten this error
melta101
melta1012mo ago
in the code did you choose the correct board?
melta101
melta1012mo ago
there are like 4 - 5 boards when i was tested it with arduino IDE
wafa_ath
wafa_ath2mo ago
Since the code uploaded ,i think it's the correct board...
melta101
melta1012mo ago
i mean the board selection from the code itself, not arduino IDE
melta101
melta1012mo ago
because the soc family is same, it would upload but PSRAM changes in different soc spec
32bitSaviour
32bitSaviour2mo ago
Either the psram is faulty or misconfigured. Or could there be esp32cam variants that come without the psram?
32bitSaviour
32bitSaviour2mo ago
I think arduino offered a way to configure the psram, no?
melta101
melta1012mo ago
when i used the example it used #defines boards where you uncomment the board, you want to use
32bitSaviour
32bitSaviour2mo ago
I also know that the camera can work without the psram but do not expect fancy resolutions.😅
melta101
melta1012mo ago
i think the stream would slower havnt had one without PSRAM to confirm
32bitSaviour
32bitSaviour2mo ago
@wafa_ath maybe ask google how you can manually configure your psram in arduino and see if the issue persists. I imagine your model will need some decent resolution.
wafa_ath
wafa_ath2mo ago
Ow yes i did that too
melta101
melta1012mo ago
as @32bitSaviour said try manually configure the PSRAM
wafa_ath
wafa_ath2mo ago
Okay, thank i will see
32bitSaviour
32bitSaviour2mo ago
@wafa_ath

west build -b esp32s3_devkitm/esp32s3/procpu samples/boards/espressif/cache_coex

west build -b esp32s3_devkitm/esp32s3/procpu samples/boards/espressif/cache_coex
You can flash this to your board to test PSRAM with zephyr. https://github.com/zephyrproject-rtos/zephyr/blob/main/tests%2Fboards%2Fespressif%2Fcache_coex%2Fsrc%2Fcache_coex.c#L263
GitHub
zephyr/tests/boards/espressif/cache_coex/src/cache_coex.c at main ·...
Primary Git Repository for the Zephyr Project. Zephyr is a new generation, scalable, optimized, secure RTOS for multiple hardware architectures. - zephyrproject-rtos/zephyr
wafa_ath
wafa_ath2mo ago
Happy news @32bitSaviour, the ESP32-CAM worked fine,but the model I trained is in YOLOv5, and I need to retrain or convert it to TensorFlow Lite (a fairly simple process) to make it compatible for deployment on the ESP32-CAM.
ZacckOsiemo
ZacckOsiemo2mo ago
yes I want to see hoe the Tensorflow Lite model works
32bitSaviour
32bitSaviour2mo ago
With Zephyr?
wafa_ath
wafa_ath2mo ago
Absolutely that why i tagged you
wafa_ath
wafa_ath2mo ago
I take (simple process) back 🙂, apparently Yolov5 and tansorflow lite have different architecture make Yolov5 much faster training an object detection model, in tansorflow lite it took sooo much time comparing (not doing much but the waiting is killing )
ZacckOsiemo
ZacckOsiemo2mo ago
wait but why are you training in tensorflow lite. Why not the Tensorfloe then we convert to lite?
wafa_ath
wafa_ath2mo ago
My mistake, i mean tansorflow and not tansorflow lite
wafa_ath
wafa_ath2mo ago
Yes exactly what am trying to do
ZacckOsiemo
ZacckOsiemo2mo ago
thank you keep trying!
daleonpz
daleonpz2mo ago
i did it actually. I deployed a YoloV5 model on a esp32 . https://github.com/daleonpz/POC_CV_tinyml I have scripts in python that may help you. Also I documented step by step the process
GitHub
GitHub - daleonpz/POC_CV_tinyml: Screw type detection using ESP-EYE...
Screw type detection using ESP-EYE and TensorFlow Lite Micro for real-time classification on ESP32. - daleonpz/POC_CV_tinyml
wafa_ath
wafa_ath2mo ago
That’s great! So, after training the model with YOLOv5, you converted it to TFLite format for quantization, right? Since YOLOv5 is trained with PyTorch and TensorFlow Lite uses a different architecture, how did it handle the conversion process?
attachment 0
daleonpz
daleonpz2mo ago
the python library handles it for me.. you just need to give the right parameters to convert from pytorch to tf, then i convert the tf to tflite using a script I wrote, which gives me at the end the C array
wafa_ath
wafa_ath2mo ago
Oh i see , so you go from yolo pytorch to tf than convert it to tf lite , in case like me witch i already have Yolov5 trained model it would help me , but if someone wants to build from the beginning don't you think it's an extra steps or does it have butter results?
daleonpz
daleonpz2mo ago
I cannot say, I did'nt compare the outputs. But I got a pytorch model and I needed a tflite, so I did what was necessary to get the format I wanted
wafa_ath
wafa_ath2mo ago
Thank you so much for sharing this, it's really helpful
wafa_ath
wafa_ath5w ago
Setting up the environment is harder than the actual work (ps: it's my first time with zephyr) 😅
32bitSaviour
32bitSaviour5w ago
Are you stuck? Do you need assistance?
madness
madness5w ago
i'm working with zephyr too, pretty new to it, it's really difficult
32bitSaviour
32bitSaviour5w ago
what challenges are you having?
daleonpz
daleonpz5w ago
Interrupt
Practical Zephyr - Zephyr Basics (Part 1)
A community and blog for embedded software makers
daleonpz
daleonpz5w ago
that may help
wafa_ath
wafa_ath5w ago
am just trying to figure out how to setup esp32-cam with zephyr
wafa_ath
wafa_ath5w ago
what are you working on
ZacckOsiemo
ZacckOsiemo5w ago
what part is difficult Wafa?
madness
madness5w ago
just all the configuration that is in there. when something doesn't compile, it's not always easy to understand why because there are so many settings behind the scenes. i have no problem with writing code as that is basically the same. also the rtt screwed me up at one point because i didn't have it set to automatically look for the address but use a fixed one and for a few days things were working sometimes and sometimes they weren't and it drove me nuts until i saw that and fixed the rtt setting.
madness
madness5w ago
it's a sensor, battery powered, using nordic's processor with nrf connect sdk
madness
madness5w ago
you're trying to run zephyr on the esp32? i played with esp32 cam but for me the arduino-style code worked the best/quickest.
wafa_ath
wafa_ath5w ago
Yes i did the Arduino-style code and it worked fine , but i am trying to learn zephyr 😅
madness
madness5w ago
that's a great reason actually. i would suggest to use a different processor, nrf52840 and use nordic nrf connect sdk. i don't know about esp32 on this but nordic has really good zephyr tutorials in the form of courses. 2 boards come to mind, Seeed Studio XIAO nRF52840, only $14 to $17, and nrf52840 dk, costs about $50. take a look at their beginner course to see what i mean: https://academy.nordicsemi.com/courses/nrf-connect-sdk-fundamentals/
Nordic Developer Academy
nRF Connect SDK Fundamentals - Nordic Developer Academy
Firmware Development nRF Connect SDK Fundamentals Course description nRF Connect SDK Fundamentals is a self-paced hands-on online course focusing on learning the essentials of firmware development using the highly extensible and feature-rich nRF Connect SDK. The nRF Connect Software Development Kit contains a highly configurable real-time operat...
ZacckOsiemo
ZacckOsiemo5w ago
Wafa what is the difficulty with running Zephyr on Esp32, @32bitSaviour and I have done it with ease
wafa_ath
wafa_ath5w ago
Oh maybe because am new 😅 , so i saw Zephyr does support ESP32 boards, but it doesn't provide direct, support for the ESP32-CAM module. that require custom configuration.
ZacckOsiemo
ZacckOsiemo5w ago
Oh I see, is the CAM module closed source
ZacckOsiemo
ZacckOsiemo5w ago
I would think there is support
melta101
melta1015w ago
i remember there is OV series recently got added
melta101
melta1015w ago
by charles
melta101
melta1015w ago
if i am not wrong
ZacckOsiemo
ZacckOsiemo5w ago
yeah that's what I thought, if we identlgy what image sensor it is
ZacckOsiemo
ZacckOsiemo5w ago
the rest is just hooking up
melta101
melta1015w ago
i am also almost done with SPI driver
melta101
melta1015w ago
but it's very hacky at this point need to clean it up🫠
ZacckOsiemo
ZacckOsiemo5w ago
I want to see the hacky version
ZacckOsiemo
ZacckOsiemo5w ago
please can we have a session on it?
melta101
melta1015w ago
GitHub
GitHub - malto101/zephyr at k3_mcspi_testing
Primary Git Repository for the Zephyr Project. Zephyr is a new generation, scalable, optimized, secure RTOS for multiple hardware architectures. - GitHub - malto101/zephyr at k3_mcspi_testing
ZacckOsiemo
ZacckOsiemo5w ago
digging into this after OH
melta101
melta1015w ago
feedback is very much welcome
32bitSaviour
32bitSaviour5w ago
Just some overlay files to tell Zephyr what and where things are. We can do this.

Did you find this page helpful?