ESP32-CAM-MB + Development Board CH340G

All ESP32 boards running MicroPython.
Target audience: MicroPython users with an ESP32 board.
bjames28
Posts: 14
Joined: Fri May 17, 2019 12:55 pm

Re: ESP32-CAM-MB + Development Board CH340G

Post by bjames28 » Wed Sep 29, 2021 9:17 am

Hi,

You can find the firmware in this repo: https://github.com/lemariva/micropython-camera-driver

The project description and more details : https://lemariva.com/blog/2019/09/micro ... hoto-esp32

If you have questions please feel free to ask, I hope I can answer, but better to open a new topic IMO.

remi_bertholet
Posts: 2
Joined: Mon Mar 15, 2021 6:17 pm

Re: ESP32-CAM-MB + Development Board CH340G

Post by remi_bertholet » Tue Jan 04, 2022 8:38 am

I am working on a micropython firmware modified specialy for esp32cam. I will deliver firmware version in the next few weeks (I working on documentation), but the archived version in git has been working perfectly as a motion detection camera for several months, the firmware can be easily rebuilded on linux.
https://github.com/remibert/pycameresp

User avatar
ernitron
Posts: 89
Joined: Fri Jun 03, 2016 5:53 pm
Location: The Netherlands

Re: ESP32-CAM-MB + Development Board CH340G

Post by ernitron » Sat Jan 08, 2022 4:05 pm

Long time I am away from the forum, and I guess I missed a LOT! Said that I am having very hard time to get micropython and esp-32 camera working. Therefore I will have a look to your git repo, @remi_bertholet.

Besides, I would like to recap what I achieved and especially what I DID NOT achieve (yet), and ask the community for help.

0) Most of the examples on arduino-esp32-cam in C work out of the box, but I really want to use all the weapons I know in micropython. So step 0 was just to testing my hardware (I have now at least 6+ ESP32 CAM devices from ali*xpress all of them work just fine). Upload firmware from Arduino works with both the USB-to-TTL and with the add-on chip with microusb). This is exatly the model I have.
Image

1a) Starting from LEMARIVA camera driver (https://github.com/lemariva/micropython-camera-driver) I struggled to integrate with all micropython/esp-idf versions without success. Also the firmware included in the repo ( https://github.com/lemariva/micropython ... r/firmware) doesn't not work with my development boards.

1b) However, my attempts with micropython v1.7 and esp-idf v4.2 + esp-camera following several blogs arrived at the linking status where for just 112 bytes link fails because IRAM overflow. And there were NO WAYS to reduce it (I check here too https://docs.espressif.com/projects/esp ... iram-usage). I am stuck here.

Code: Select all

../../../../xtensa-esp32-elf/bin/ld: micropython.elf section `.iram0.text' will not fit in region `iram0_0_seg'
../../../../xtensa-esp32-elf/bin/ld: IRAM0 segment data does not fit.
../../../../xtensa-esp32-elf/bin/[b]ld: region `iram0_0_seg' overflowed by 112 bytes[/b]
collect2: error: ld returned 1 exit status
1c) I did the same with pycopy and result was a little better (92bytes exceeds the IRAM) but not much. Besides pycopy lacks of uasyncio in frozen code so I cannot use it.

2) I had some success with a very old project of this guy (https://github.com/shariltumin/esp32-cam-micropython). The firmware in his repo works and also his code with camera management and 3 web servers in multi thread env (which is not very smart but effective (IMHO!!!)).

3) In all the cases when I flash firmware with esptool with the add-on chip it fails. On the other hand, the dongle USB-TO-TTL works.

Besides, I also struggled with picocom and recently I have a stable situation with thonny v.4.0.0-dev installed from development github.

Now I really would like to succeed with 1b) and looking for a simple solution to reduce IRAM occupation.

Thanks

ps: happy to got back to the community, hope you are all well and sound!
pps: I am going to give a try to your project @remi_bertholet and report status.

User avatar
ernitron
Posts: 89
Joined: Fri Jun 03, 2016 5:53 pm
Location: The Netherlands

Re: ESP32-CAM-MB + Development Board CH340G

Post by ernitron » Wed Jan 12, 2022 1:53 pm

remi_bertholet wrote:
Tue Jan 04, 2022 8:38 am
I am working on a micropython firmware modified specialy for esp32cam. I will deliver firmware version in the next few weeks (I working on documentation), but the archived version in git has been working perfectly as a motion detection camera for several months, the firmware can be easily rebuilded on linux.
https://github.com/remibert/pycameresp
I gave it a try. It's awesome, however:

1. Script and installation, compilation all went like a breeze
2. Installation on my ESP32 devices (like the one in the picture above) was straightforward (with both USB-To-TTL and USB add on,)
3. Applications are just incredible! Webserver, telnet, etc... piece of work!
4. Access through picocom, thonny, telnet, http, etc works out of the box
5. (this is the however) Camera was not recognized... camera.isinstalled() returns False. Therefore NO camera streaming or anything.
Same device with other software works (https://github.com/shariltumin/esp32-cam-micropython)

I just wonder, how many subtle hardware/software misconfigurations can go wrong with this hell of device!

Open to your hints (and I mean the whole community)

Thanks

User avatar
ernitron
Posts: 89
Joined: Fri Jun 03, 2016 5:53 pm
Location: The Netherlands

Re: ESP32-CAM-MB + Development Board CH340G

Post by ernitron » Sun Jan 16, 2022 7:55 am


modulusmath
Posts: 30
Joined: Thu Jun 30, 2022 3:21 am

Re: ESP32-CAM-MB + Development Board CH340G

Post by modulusmath » Wed Jul 06, 2022 2:56 am

uraich wrote:
Sat Sep 18, 2021 7:57 pm
I have a similar problem. It seems that the Linux serial driver sets RTS and DTR such that you are always in programming mode. I tried to run gtkterm on which you can individually reset DTR and RTS and if I do this, then I see REPL as expected.
It is therefore a problem of the serial driver and not a micropython problem.
Unfortunately, ampy and thonny use the normal serial driver and I can therefore not use these, which means that I cannot upload uP code.
It seems that the serial monitor in the Arduino IDE does not set DTR and RTS and this is the reason why things work ok for the Arduino.
Thank you. I have the same issue. Same board.

Just confirming .... gtkterm w/o DTR and RTS allows me to get to the REPL.

Thanks!

tepalia02
Posts: 99
Joined: Mon Mar 21, 2022 5:13 am

Re: ESP32-CAM-MB + Development Board CH340G

Post by tepalia02 » Wed Jul 06, 2022 1:02 pm

I don't know why, I cannot access the ebay link. However, I can see that other users have already come forward to help you. Someone has faced the same issue. I hope you'll solve the problem finally. And if you ever consider making an ESP32-cam board by yourself, you can consider this design. https://www.pcbway.com/project/sharepro ... r_PCB.html
This is an ESP32-CAM Adaptor PCB. This is quite simple and easy to use.

modulusmath
Posts: 30
Joined: Thu Jun 30, 2022 3:21 am

Re: ESP32-CAM-MB + Development Board CH340G

Post by modulusmath » Wed Jul 06, 2022 7:11 pm

bjames28 wrote:
Sun Sep 26, 2021 12:24 pm
I had the same issue, but found this solution (which is rather a workaround):

Open the Thonny configuration.ini file (Tools -> Open Thonny Data folder) and in [ESP32] section you need to add:

dtr = False
rts = False

Worked for me!

The longer story is here: https://github.com/thonny/thonny/issues/1462
- Confirming the same. I am using 4.0.0b3 and updating configuration.ini as per above works for me as well now.

TRMrNo
Posts: 15
Joined: Fri May 28, 2021 9:24 pm

Re: ESP32-CAM-MB + Development Board CH340G

Post by TRMrNo » Thu Jul 07, 2022 6:58 pm

Does anyone tried to use RGB565 format for esp32-cam ?

I am trying but it fails. Does anyone tried it in RGB565 ?

Code: Select all

state = camera.init(0, format=camera.RGB565, fb_location=camera.PSRAM)
print("Camera State: ",state)
True
camera.framesize(camera.FRAME_96X96)
buf = camera.capture()
buf
False

Post Reply