Good morning Max!
So, using the “verbose upload” of Platformio I saw that the command being executed is listed as follows:
"/Users/gabriele/.platformio/penv/bin/python" "/Users/gabriele/.platformio/packages/tool-esptoolpy/esptool.py" --chip esp32 --port "/dev/cu.usbserial-0001" --baud 460800 --before default_reset --after hard_reset write_flash -z --flash_mode dio --flash_freq 40m --flash_size 4MB 0x1000 /Users/gabriele/Dropbox/Documents/PlatformIO/Projects/audio_test/.pio/build/esp32dev/bootloader.bin 0x8000 /Users/gabriele/Dropbox/Documents/PlatformIO/Projects/audio_test/.pio/build/esp32dev/partitions.bin 0xe000 /Users/gabriele/.platformio/packages/framework-arduinoespressif32/tools/partitions/boot_app0.bin 0x10000 .pio/build/esp32dev/firmware.bin
I dont’ understand why I see two calls to python, but so be it.
If I try and run the first part manually in terminal
/Users/gabriele/.platformio/penv/bin/python
I get a normal activation of the python interpreter.
If I try and run the second part
/Users/gabriele/.platformio/packages/tool-esptoolpy/esptool.py"
I get this error:
MacBook-Pro-4:audio_test gabriele$ /Users/gabriele/.platformio/packages/tool-esptoolpy/esptool.py
Pyserial is not installed for /usr/local/opt/python@3.12/bin/python3.12. Check the README for installation instructions.
Traceback (most recent call last):
File "/Users/gabriele/.platformio/packages/tool-esptoolpy/esptool.py", line 31, in <module>
import esptool
File "/Users/gabriele/.platformio/packages/tool-esptoolpy/esptool/__init__.py", line 41, in <module>
from esptool.cmds import (
File "/Users/gabriele/.platformio/packages/tool-esptoolpy/esptool/cmds.py", line 14, in <module>
from .bin_image import ELFFile, ImageSegment, LoadFirmwareImage
File "/Users/gabriele/.platformio/packages/tool-esptoolpy/esptool/bin_image.py", line 14, in <module>
from .loader import ESPLoader
File "/Users/gabriele/.platformio/packages/tool-esptoolpy/esptool/loader.py", line 30, in <module>
import serial
ModuleNotFoundError: No module named 'serial'
Last byt not least, if I run esptool.py manually, as I would normally do, with the rest of the Platformio command string, the code uploads with no problems!
MacBook-Pro-4:audio_test gabriele$ esptool.py --chip esp32 --port "/dev/cu.usbserial-0001" --baud 460800 --before default_reset --after hard_reset write_flash -z --flash_mode dio --flash_freq 40m --flash_size 4MB 0x1000 /Users/gabriele/Dropbox/Documents/PlatformIO/Projects/audio_test/.pio/build/esp32dev/bootloader.bin 0x8000 /Users/gabriele/Dropbox/Documents/PlatformIO/Projects/audio_test/.pio/build/esp32dev/partitions.bin 0xe000 /Users/gabriele/.platformio/packages/framework-arduinoespressif32/tools/partitions/boot_app0.bin 0x10000 .pio/build/esp32dev/firmware.bin
esptool.py v4.8.1
Serial port /dev/cu.usbserial-0001
Connecting....
Chip is ESP32-D0WD-V3 (revision v3.0)
Features: WiFi, BT, Dual Core, 240MHz, VRef calibration in efuse, Coding Scheme None
Crystal is 40MHz
MAC: 08:b6:1f:29:db:cc
Uploading stub...
Running stub...
Stub running...
Changing baud rate to 460800
Changed.
Configuring flash size...
Flash will be erased from 0x00001000 to 0x00005fff...
Flash will be erased from 0x00008000 to 0x00008fff...
Flash will be erased from 0x0000e000 to 0x0000ffff...
Flash will be erased from 0x00010000 to 0x0013afff...
SHA digest in image updated
Compressed 17536 bytes to 12202...
Wrote 17536 bytes (12202 compressed) at 0x00001000 in 0.7 seconds (effective 206.7 kbit/s)...
Hash of data verified.
Compressed 3072 bytes to 175...
Wrote 3072 bytes (175 compressed) at 0x00008000 in 0.1 seconds (effective 241.9 kbit/s)...
Hash of data verified.
Compressed 8192 bytes to 47...
Wrote 8192 bytes (47 compressed) at 0x0000e000 in 0.2 seconds (effective 371.0 kbit/s)...
Hash of data verified.
Compressed 1222560 bytes to 732655...
Wrote 1222560 bytes (732655 compressed) at 0x00010000 in 19.1 seconds (effective 510.9 kbit/s)...
Hash of data verified.
Leaving...
Hard resetting via RTS pin...