Author Topic: ESP32-WROOM and Arduino IDE, my first encounter.  (Read 81 times)

globoy and 6 Guests are viewing this topic.

Online pcprogrammerTopic starter

  • Super Contributor
  • ***
  • Posts: 4526
  • Country: nl
ESP32-WROOM and Arduino IDE, my first encounter.
« on: Today at 03:06:16 pm »
I ordered some ESP32-WROOM development boards on Aliexpress via the 3 for not much option (1,88 euro per board :)  https://nl.aliexpress.com/item/1005005623725652.html) and they arrived today.

Always test these kind of things when they arrive to make sure all is good, so connected them to my computer (USB-A to USB-C cable) and a LED was lit. The CH340 connected without problems, but no blinking LED, which I mostly find enough proof of working. So decided to test it with an example sketch in the Arduino IDE.

But that turned out to be not so simple and straight forward. I had no ESP boards installed, which was not a big problem. Open the boards manager and install the ESP boards. Version 3.07 was the newest available. This adds a ton of new boards and brings stress of choice.  :o

A search on the net showed that "ESP32 Dev Module" was the most likely choice for the 30 pin WROOM board. Selected a simple example sketch and pressed upload. No dice, it complained about the module serial not existing.

Code: [Select]
Traceback (most recent call last):
  File "/home/peter/.arduino15/packages/esp32/tools/esptool_py/4.6/esptool.py", line 34, in <module>
    import esptool
  File "/home/peter/.arduino15/packages/esp32/tools/esptool_py/4.6/esptool/_init_.py", line 41, in <module>
    from esptool.cmds import (
  File "/home/peter/.arduino15/packages/esp32/tools/esptool_py/4.6/esptool/cmds.py", line 14, in <module>
    from .bin_image import ELFFile, ImageSegment, LoadFirmwareImage
  File "/home/peter/.arduino15/packages/esp32/tools/esptool_py/4.6/esptool/bin_image.py", line 14, in <module>
    from .loader import ESPLoader
  File "/home/peter/.arduino15/packages/esp32/tools/esptool_py/4.6/esptool/loader.py", line 30, in <module>
    import serial
ModuleNotFoundError: No module named 'serial'
exit status 1

Compilation error: exit status 1

I knew that a friend of mine had already played with the ESP32-WROOM boards in combination with the Arduino IDE, and he told me that the boards library he had installed for the ESP devices was version 3.1.0-RC3. Unfortunately that was not in my list of versions.  :palm:

After a bit of looking through his setup it became clear that one has to add additional boards to the preferences.

2454055-0

He had the following two in his list:
Code: [Select]
https://dl.espressif.com/dl/package_esp32_index.json
https://raw.githubusercontent.com/espressif/arduino-esp32/gh-pages/package_esp32_dev_index.json

Not sure which one does the trick, but after adding them I got the new versions in my list and selected the latest version. After this action the sketch (Examples->WiFi->WiFiScan) compiled just fine, but uploading failed.

Code: [Select]
Sketch uses 913680 bytes (69%) of program storage space. Maximum is 1310720 bytes.
Global variables use 45476 bytes (13%) of dynamic memory, leaving 282204 bytes for local variables. Maximum is 327680 bytes.
esptool.py v4.8.1
Serial port /dev/ttyUSB0
Connecting...........
Chip is ESP32-D0WD-V3 (revision v3.1)
Features: WiFi, BT, Dual Core, 240MHz, VRef calibration in efuse, Coding Scheme None
Crystal is 40MHz
MAC: 8c:4f:00:36:95:90
Uploading stub...
Running stub...
Stub running...
Changing baud rate to 921600
Changed.

A fatal error occurred: Unable to verify flash chip connection (Invalid head of packet (0xE0): Possible serial noise or corruption.).
Failed uploading: uploading error: exit status 2

Tried it via another USB port on the computer, but still the same problem. I have some other older ESP32 boards (USB-micro) in my collection, that I never tried loading code into before, and these worked just fine. Code uploaded and started without problems.

My friend suggested to try different boards and when I selected "AI Thinker ESP32-CAM" it also worked without problems.

Clearly the ESP32 world on Arduino is a bit mysterious and with boards from unknown origin it can be a bit of a hassle to get things running.

Hope this post can help others when they run into ESP32 problems.
« Last Edit: Today at 03:07:54 pm by pcprogrammer »
 

Offline kripton2035

  • Super Contributor
  • ***
  • Posts: 2695
  • Country: fr
    • kripton2035 schematics repository
Re: ESP32-WROOM and Arduino IDE, my first encounter.
« Reply #1 on: Today at 04:28:39 pm »
I'm on macos, but with some esp32 boards, I have two usb serial ports... one named as chusbserial000 and the other as wchusbserial000
only the wchusbserial works to upload to the board.
 

Online pcprogrammerTopic starter

  • Super Contributor
  • ***
  • Posts: 4526
  • Country: nl
Re: ESP32-WROOM and Arduino IDE, my first encounter.
« Reply #2 on: Today at 05:53:56 pm »
I'm running under Linux Mint and there the naming of the serial port depends on the connected device. The CH340 shows up as /dev/ttyUSBx (x can be 0 - ... Depends on if there are more devices of the same kind connected).

In the Arduino IDE it shows /dev/ttyS0 as a default device and when connected to a board another one is shown, like /dev/ttyUSB0 for my ESP32 boards.

It might be that on macos it uses a similar setup, but with the names you mentioned.


Share me

Digg  Facebook  SlashDot  Delicious  Technorati  Twitter  Google  Yahoo
Smf