I’ve been researching this bug, which apparently is an issue in Pyserial querying available ports. The errors seen when compiling for ESP32 is typically this:
Traceback (most recent call last): File "esptool.py", line 57, in <module> File "/Library/Python/2.7/site-packages/PyInstaller/loader/pyimod03_importers.py", line 389, in load_module File "serial/tools/list_ports.py", line 29, in <module> File "/Library/Python/2.7/site-packages/PyInstaller/loader/pyimod03_importers.py", line 389, in load_module File "serial/tools/list_ports_posix.py", line 31, in <module> File "/Library/Python/2.7/site-packages/PyInstaller/loader/pyimod03_importers.py", line 389, in load_module File "serial/tools/list_ports_osx.py", line 32, in <module> ValueError: dlsym(RTLD_DEFAULT, kIOMasterPortDefault): symbol not found Failed to execute script esptool exit status 255 Error compiling for board ESP32 Dev Module.
I’ve tried various fixes which include editing ESPTOOL.PY, but all to no avail, and to be honest can’t make much sense of the reports on GitHub which say that the issues with Pyserial are closed.
Does anyone have a step-by-step guide of the fix, please? I’ve seen this, but it doesn’t really appear to be very complete.
1. Comment below lines in the file "/Library/Frameworks/Python.framework/Versions/3.8/bin/esptool.py" #try: # import serial.tools.list_ports as list_ports #except ImportError: # print("The installed version (%s) of pyserial appears to be too old for esptool.py (Python interpreter %s). " # "Check the README for installation instructions." % (sys.VERSION, sys.executable)) # raise 2. List all available ports ls /dev/tty.* 3. Use esptool.py with --port command esptool.py --port /dev/tty.usbserial-01EED907 --baud 921600 erase_flash 4. Update esptool.py or env variable with a default port so esptool.py can be called without a parameter. TODO
I’m using a PC at the moment for my project, but it’s slower and clumsier… Obviously, this needs to be fixed in time.
I should point out that ATMega Arduino projects compile without issues, so it is a problem in the ESP32 tool chain.