me-no-dev / arduino-esp32fs-plugin

Arduino plugin for uploading files to ESP32 file system
GNU General Public License v2.0
561 stars 144 forks source link

pyserial error when trying to use tool on OSX Big Sur #29

Open mikevanis opened 3 years ago

mikevanis commented 3 years ago

When trying to use the tool on Mac OSX Big Sur, esptool fails to execute.

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
SPIFFS Upload failed!

I believe this is similar to the problem experienced with the arduino esp32 core (as mentioned here).

delcomp commented 3 years ago

Did you find a solution for this issue?

mikevanis commented 3 years ago

No actually, I've been getting by using mkspiffs and esptool directly and forego this tool for now until it's fixed :)

vindolin commented 3 years ago

Here's more info about it and a fix: https://github.com/pyserial/pyserial/issues/509#issuecomment-726966076

delcomp commented 3 years ago

Ok, found my own solution. I have a virtual machine running 10.14 (a Parallels setup). Quickly installed Arduino IDE, the ESP32 library, this tool and a driver for the serial port. Then made a shared folder between the virtual machine and my Big Sur os. Now I can use the 10.14 to write the SPIFFS of my ESP32.

Once setup it's fast to work with.

lorol commented 3 years ago

You can check the last PR at my clone of this repository. I may be helpful for you.

delcomp commented 3 years ago

Thanks @lorol, that did the trick. Mind you, the '!Erase Flash!' option still gives an error. All the other options do work now.

Erasing all Flash started... Port: /dev/cu.usbserial-1413420

>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 loadmodule > File "serial/tools/listports.py", line 29, in > File "/Library/Python/2.7/site-packages/PyInstaller/loader/pyimod03_importers.py", line 389, in loadmodule > File "serial/tools/list_portsposix.py", line 31, in > File "/Library/Python/2.7/site-packages/PyInstaller/loader/pyimod03_importers.py", line 389, in loadmodule > File "serial/tools/list_portsosx.py", line 32, in >ValueError: dlsym(RTLDDEFAULT, kIOMasterPortDefault): symbol not found >Failed to execute script esptool !Erase Flash! Upload failed!

lorol commented 3 years ago

@delcomp, thank you for the report. Probably @bergdahl would be able to help fixing it or give some hints.

bergdahl commented 3 years ago

Basically the fix I made was to remove the use of the old "esptool" binary file and make it use "esptool.py" instead. I also changed the call to "python3 esptool.py" as Python 2 is obsolete. The underlying problem is a change in Big Sur that forces and update to Pyserial.