ESP32-WiFi-Robot
ESP32-WiFi-Robot copied to clipboard
(Question) Camera Resolution
Great looking project. I have a question or two. There seems to be some great improvements on the ESP32 cammera library in Arduino. What is the limiting factor for the choice of the camera resolution for the robot? Would it be possible to use the OV2640 camera?
The limiting factor is mostly WiFi bandwidth. The 160px streams already creates 2Mbit and doen't work over greater distances than a few metres. Mudassar Tamboli has programmed a nice interface that lets you select the resolution: https://medium.com/@mudassar.tamboli/esp32-ov7670-websocket-video-camera-26c35aedcc64 Also, with the next-higher resolution, 320x240 the internal memory of the ESP32 ist not big enough to store an entire frame. So you have to split the picture in two parts. There are OV7670 versions with built in FIFO for this application. But I haven't tried those yet. The OV2640 seems very interesting because if its compression feature and I'm planning to order one just to see if I can get it to work with the PCB I made. It is even available with the same pinout as the OV7670.
There have been some great looking boards popping up lately. One in particular looks like a fantastic candidate for this project, https://www.seeedstudio.com/ESP32-CAM-Development-Board-with-camer-p-3153.html They have extra memory in the form of 4MB PSRAM and the OV2640 camera. I would be happy to hear how it goes with your tests on the OV2640, if it works I think this project is going to be really fun, especially with a higher resolution that the board could offer. https://github.com/espressif/arduino-esp32/tree/master/libraries/ESP32/examples/Camera/CameraWebServer
@CoretechR Like what @just-jason mentioned, it would be interesting to see how this code can be updated to make use of the camera library that is now available in the Arduino-ESP32 core. It also probably means we can easily just use the ESP32-CAM board with a motor driver board to implement this.
Can I check if my understanding of your code is correct?
- Main HTML interface is served by port 80.
- Websocket opened on port 81, through which streaming of video and inputs (buttons, etc.) get fed between ESP32 and web browser.
If that's the case, I think it should just be a matter of using the CameraWebServer.ino example as a base, add in the event handlers for the various buttons, and converting the HTML file to hex for inclusion into camera_index.h Doable?
@vivian-ng Sorry for responding so late. Yes, I would love to have the camera library running on the robot. It would enable much higher resolutions and the code could be made compatible with the esp32-cam. Over the past few days I tried to make this work but in the end I just got the error "Camera probe failed with error 0x20004". But I can't find any errors in the wiring or pin definitions. I might have another looks at porting the websocket stuff to the esp32-cam board.
@vivian-ng So I tried porting the websocket stuff from my robot to the bare ESP32-CAM board. It basically works but the wifi connection is somehow not stable and the stream only shows up every few tried. You can give it a try: CameraWebServerRobotTest.zip After editing the html file it now has to be converted using the cyberchef link in the folder.