4

I am trying to install micropython on my esp32 cam.

I tried 3 differents ways to do it.

First one command and putty

I installed python and esptool with pip install esptool.

Then I looked wich COM was my esp32 (In my case COM5), then I ereased the flash with this command

esptool.py --chip esp32 --port COM5 erase_flash

Here is the result, it looks fine to me.

esptool.py v3.2
Serial port COM5
Connecting....
Chip is ESP32-D0WDQ6 (revision 1)
Features: WiFi, BT, Dual Core, 240MHz, VRef calibration in efuse, Coding Scheme None
Crystal is 40MHz
MAC: 58:bf:25:83:bd:64
Uploading stub...
Running stub...
Stub running...
Erasing flash (this may take a while)...
Chip erase completed successfully in 14.3s
Hard resetting via RTS pin...

After that I flashed the firmeware that I got from github lemariva/micropython-camera-driver, I also tried with the one from official website of micropython

esptool.py --chip esp32 --port COM5 --baud 460800 write_flash -z 0x1000 micropython_cmake_9fef1c0bd_esp32_idf4.x_ble_camera.bin

Each time I got a result like this:

0bd_esp32_idf4.x_ble_camera.bin
esptool.py v3.2
Serial port COM5
Connecting....
Chip is ESP32-D0WDQ6 (revision 1)
Features: WiFi, BT, Dual Core, 240MHz, VRef calibration in efuse, Coding Scheme None
Crystal is 40MHz
MAC: 58:bf:25:83:bd:64
Uploading stub...
Running stub...
Stub running...
Changing baud rate to 460800
Changed.
Configuring flash size...
Flash will be erased from 0x00001000 to 0x00181fff...
Compressed 1575808 bytes to 1010481...
Wrote 1575808 bytes (1010481 compressed) at 0x00001000 in 23.8 seconds (effective 529.5 kbit/s)...
Hash of data verified.

Leaving...
Hard resetting via RTS pin...

After that I tried to connect to it with putty

enter image description here

I tried to unplug the esp32, press the reset button, hit CTRL + enter / CTRL + D. But each times i got a black window and I'm unable to write something

enter image description here

Using Thony

I tried to flash the firmeware with Thonny Click on bottom Right "Micropython (ESP32)" > Configure Interpreter > Install or update firmware

But after the installation I always have a error and cant type python

enter image description here

uPyCraft

I also tried to do it with uPyCraft, when I select the COM port, it asks me to flash the firmware, it seems to works, but when i select again the port it ask again.

Problem

I can't find a way to use micro python with my esp32 cam, every time it seems to flash the firmware but can't connect to the ESP32 after that.

My esp card is: enter image description here

And the usb converter is a CH340 serial converter

EDIT 20/03/2022

I found out that my problem is not about the firmware, but about the communication between my computer (Windows 10) and the esp 32 card.

I tried to install the firmware from a other computer (Macbook pro) and this time I was able to execute python on the card.

Later without any modifications I tried again to just plug my card on my original computer and connect to it, but still unable to execute python.

So I think that it could be a dirver problem or anything else, but related to my computer. For now I still don't know what I could try.

4
  • 1
    ESP32Cam boards generally have PSRAM on them. I'm not confident the normal MicroPython build will run on those boards. There's a separate build with support for PSRAM; I would recommend trying that with the board.
    – romkey
    Mar 17, 2022 at 0:17
  • I tried it, but same results. I also tried all esp32 firmewares that start with "esp32-S" from official website and same results. I added the model of my board on the post. Mar 17, 2022 at 21:43
  • @romkey I just edited my post to add some informations, I was able to communicate like I wanted with the card, from an other computer with the firmware form the github link in my post. So it must be a problem with the communication between my computer and my card. Do you have any idea what could go wrong ? Mar 20, 2022 at 18:36
  • Did you succeed to transfer the file from ESP32 micropython ? Aug 17, 2022 at 18:17

3 Answers 3

1

on my cheapo esp32cam module, I was able to use lemariva's firmware after flashing it with esptool at 115200 baud, but only after adding this to my Thonny preferences under the [ESP32] section:

dtr = False
rts = False

without that, I think the USB serial tries to use the wrong flow control. My camera init still fails, but everything else incl Wifi works and at least I can talk to the resident MicroPython via Thonny now.

1
  • Inside the lemariva/micropython-camera-driver repository there is two firmware. Which on did you chose ? When i used micropython_cmake_9fef1c0bd_esp32_idf4.x_ble_camera.bin I had an error on my camera.init, but with micropython_camera_feeeb5ea3_esp32_idf4_4.bin i have no errors Apr 3, 2022 at 18:41
1

As @Helmut Hissen mentioned, I edited my Thonny preferences.

To do it I opened the thonny data folder: enter image description here

After opening the folder I closed Thonny.

Then I opened configuration.ini with notepad, and there is an [ESP32] part that, at first only contained the port (COM6 for me, might be different for each person), I added two lines.

[ESP32]
port = COM6
dtr = False
rts = False

After that I reopened Thonny, and reflashed my ESP32 with a firmware from github lemariva/micropython-camera-driver.

After the flash I was able to execute some python on the board. enter image description here

Two firmwares are available:

  • micropython_cmake_9fef1c0bd_esp32_idf4.x_ble_camera.bin
  • micropython_camera_feeeb5ea3_esp32_idf4_4.bin

They both worked, and was able to comunicate with the ESP32. But with the second one there is a PSRAM module so a could init the camera, I wasn't able to do it with the first one.

To my understanding it was a communication problem between my windows and the ESP32. I assume that I could use other software than Thonny, like putty. But only if I can find the right configuration.

If someone have a better explanation, about the why, I would like to hear it.

0

Hi Helmut Hissen and Gregory Boutte, thanks a lot for sharing your experiences. I am using a cheap ESP32-CAM (ESP32-S Version) together with a ch341 UART converter on a Linux Mint machine and had to do things slightly different. First I tried to follow your suggestion, modifying the configuration.ini file, restarting Thonny, and flashing the firmware with Thonny. But Thonny removed the extra lines from the configuration file and Micropython would not run. Although the image was flashed perfectly, which i checked with esptool.py verify_flash --diff yes 0x1000 firmware.bin I had no success. So I did the following.

  1. First I flashed this firmware built by shariltumin not using Thonny but using esptool.py directly:
esptool.py --chip esp32 --port /dev/ttyUSB0 write_flash -z 0x1000 WIFI+TLS/firmware.bin
  1. Then I added the following lines to my Thonny configuration.ini file:
[ESP32]
dtr = False
rts = False
  1. After this I was able to run Micropython using Thonny on my ESP32-CAM an run some commands. Micropython on ESP32-CAM using Thonny IDE
New contributor
Jimra is a new contributor to this site. Take care in asking for clarification, commenting, and answering. Check out our Code of Conduct.

Your Answer

By clicking “Post Your Answer”, you agree to our terms of service and acknowledge that you have read and understand our privacy policy and code of conduct.

Not the answer you're looking for? Browse other questions tagged or ask your own question.