Fail to compile/link/upload Arduino - list_ports_osx.py

Hi, Get an error when compiling in Arduino1.8.13 on the MAC.
Installed Libraries and Board as instructed.
Looks like a python error of some kind.
“ValueError: dlsym(RTLD_DEFAULT, kIOMasterPortDefault): symbol not found”

Thanks
Helge

Get the following error when compiling or rather linking:
Linking everything together…
python /Users/helge/Library/Arduino15/packages/Heltec-esp32/hardware/esp32/0.0.5/tools/gen_esp32part.py -q /Users/helge/Library/Arduino15/packages/Heltec-esp32/hardware/esp32/0.0.5/tools/partitions/default_8MB.csv /var/folders/dr/h4qlx9vd6fngtzbcy4g7rv8c0000gn/T/arduino_build_346663/Holtec_Test-1.ino.partitions.bin
/Users/helge/Library/Arduino15/packages/Heltec-esp32/tools/esptool_py/2.6.1/esptool --chip esp32 elf2image --flash_mode dio --flash_freq 80m --flash_size 8MB -o /var/folders/dr/h4qlx9vd6fngtzbcy4g7rv8c0000gn/T/arduino_build_346663/Holtec_Test-1.ino.bin /var/folders/dr/h4qlx9vd6fngtzbcy4g7rv8c0000gn/T/arduino_build_346663/Holtec_Test-1.ino.elf
Traceback (most recent call last):
File “esptool.py”, line 57, in
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
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
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
ValueError: dlsym(RTLD_DEFAULT, kIOMasterPortDefault): symbol not found
Failed to execute script esptool
Using library Heltec_ESP32_Dev-Boards at version 1.1.0 in folder: /Users/helge/Documents/Arduino/libraries/Heltec_ESP32_Dev-Boards
Using library Wire at version 1.0.1 in folder: /Users/helge/Library/Arduino15/packages/Heltec-esp32/hardware/esp32/0.0.5/libraries/Wire
Using library SPI at version 1.0 in folder: /Users/helge/Library/Arduino15/packages/Heltec-esp32/hardware/esp32/0.0.5/libraries/SPI
exit status 255
/Applications/Arduino.app/Contents/Java/arduino-builder returned 255
Error compiling for board Wireless Stick.

I’m also affected by this, have you managed to find a solution?

I managed to fix it, although it’s a workaround.

  1. Remove the existing Heltec libraries from your Arduino folder. I’m using MacOS, so I removed them in my ~/Documents/Arduino folder.

  2. Basically follow the instructions in https://github.com/Heltec-Aaron-Lee/WiFi_Kit_series/blob/master/InstallGuide/mac.md, but when cloning the repository, refer to this branch instead:

https://github.com/gskbyte/WiFi_Kit_series.git (this is needed to get the submodules fixed, I’ve created a pull request but it’s not yet merged)

Profit!

Link to the pull request here because I can only post two links per post: https://github.com/Heltec-Aaron-Lee/WiFi_Kit_series/pull/140

1 Like

I tried to make this fix. I have just purchased some ESP32 LoRa boards and I’m looking forward to working with them but I’m using a Mac running Big Sur so I can’t compile any programs for this board. I get the same failure as listed. I tried following the steps you suggest but I got to a point where the Arduino IDE would start to start up and then fail. I’ve fixed that but the problem still exists.

Can you give me somemore detailed version of the instructions that purge the instructions here: https://github.com/Heltec-Aaron-Lee/WiFi_Kit_series/blob/master/InstallGuide/mac.md with you suggested changes to those instructions for this particular board? When I run the “git submodules” line, I get fatal errors but I don’t know if this is causing the problem or not.

These instructions appear to install the board driver in the ~/Documents/Arduino/hardware folder but how does the IDE know to look there for boards. I’ve been using version 1.8.13 but just now uninstalled that and installed version 1.8.12 instead in hopes that might fix the issue. Should this fix work with either of those versions of the IDE.

Thank you.

Hi, I encounter this problem today and fix it without rebuilding the esp32 driver.

According to this issue: https://github.com/pyserial/pyserial/issues/509#issuecomment-726966076

Since Heltec using its own driver instead of official esp32 driver, there are few steps need to mention.

  1. Change the path from ~/Library/Arduino15/packages/esp32/tools/esptool_py/2.6.1/ to ~/Library/Arduino15/packages/Heltec-esp32/tools/esptool_py/2.6.1/

  2. The official driver use esptool.py file but if you open the path above there are esptool exec file, you need to convert the py file to exec file, for your reference: https://stackoverflow.com/a/41574646

  3. After converting the py file copy all the files from dist/esptool to ~/Library/Arduino15/packages/Heltec-esp32/tools/esptool_py/2.6.1/

After changing the esptool exec file you can upload your code to Heltec esp32 in macOS Big Sur!

I was able to get a successful build on BigSur by doing the following.

  1. Update pyserial

    pip3 install pyserial --pre --force

  2. Insure esptool is using python3

    cd ~/Library/Arduino15/packages/Heltec-esp32/tools/esptool_py/2.6.1
    mv esptool esptool.new
    cp …/…/…/hardware/esp32/0.0.5/tools/esptool.py .
    mv esptool esptool.old
    mv esptool.py esptool
    chmod +x esptool

  3. Edit esptool and change first line to be #!/usr/local/bin/python3