Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

arduino-esp32 projects fail on macOS 11 "Big Sur" #4408

Closed
adamwilt opened this issue Oct 11, 2020 · 100 comments
Closed

arduino-esp32 projects fail on macOS 11 "Big Sur" #4408

adamwilt opened this issue Oct 11, 2020 · 100 comments

Comments

@adamwilt
Copy link

Hardware:

Board: DOIT ESP32 DEVKIT V1
Core Installation version: esp32 1.0.3
IDE name: Arduino 1.8.12, 1.8.13
Flash Frequency: N/A
PSRAM enabled: N/A
Upload Speed: N/A
Computer OS: macOS 11.0 Beta (20A5384c) (and earlier betas, too)

Description:

Any attempt to compile an ESP32 project, even an empty one as shown below, fails with:
ValueError: dlsym(RTLD_DEFAULT, kIOMasterPortDefault): symbol not found

The same projects compile and run without problems on macOS 10.5.X.

See also https://forum.arduino.cc/index.php?topic=699989.0 for another report of the same problem.

Sketch:

void setup() {
}

void loop() {
}

Debug Messages:

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
/Applications/Arduino.app/Contents/Java/arduino-builder returned 255
Error compiling for board DOIT ESP32 DEVKIT V1.
@lbernstone
Copy link
Contributor

lbernstone commented Oct 11, 2020

@huykaamaa
Copy link

me too :(

@aungthawdar
Copy link

When I compile and upload,
I got the same error on my BigSir Beta version and solved with the following ways.

-esptool is dependent on pyserial (you need to install pyserial latest version) and

-Arduino's default preferences for ESPTool is binary file , it does not use the (esptool.py) source file.
So need to replace default esptool binary file with esptool.py file in system.

How to replace?... :)

  1. Click Arduino Menu => Preferences
  2. Find [ArduinoLibraryPath]/preferences.txt at the bottom left of Preferences' Settings Tab, Click to Open
    ArduinoLibrary Folder.
  3. Find & Open packages/esp32/hardware/esp32/1.x.x Folder and open platform.txt
  4. At the line no 7. replace binary tools.esptool_py.cmd=esptool with tools.esptool_py.cmd=esptool.py and save.
  5. Open packages/esp32/hardware/esp32/1.x.x/tools folder.
  6. Copy esptool.py and paste to ArduinoLibraryFolder/packages/esp32/tools/esptool_py/2.x.x
  7. Quit Arduino IDE and open again. have a nice coding. 👍

Image 11-13-20 at 1 10 AM

@robsworld
Copy link

@aungthawdar 👍

Thank you for this solution. It works great.
The only think I have to add is you must change the permission of esptool.py with the terminal:

chmod +x /Users/XXXXX/Library/Arduino15/packages/esp32/tools/esptool_py/2.6.1/esptool.py

@lbernstone
Copy link
Contributor

Does the executable work? If you open a command line and run it, do you get an error (perhaps about python2 not being installed)? We need a solution that can work on osx and big sur.

@SpoonS2K
Copy link

SpoonS2K commented Nov 14, 2020

@aungthawdar tried your solution and got this error

Traceback (most recent call last): File "/Users/xxxxxxx/Library/Arduino15/packages/esp32/tools/esptool_py/2.6.1/esptool.py", line 37, in <module> import serial ImportError: No module named serial

@me-no-dev
Copy link
Member

can you guys try the idf-release/v4.2 branch? It has updated esptool that should contain a fix

@TimoWielink
Copy link
Contributor

@me-no-dev seems to be working with 4.2! Perfect Thnx!

@adamwilt
Copy link
Author

When I tried replacing esptool with esptool.py in the platform.txt file, I got the serial ImportError: No module named serial error. So I tried the 4.2 branch, but I'm clearly missing some steps. I used the "installation instructions for Mac OS" at https://github.com/espressif/arduino-esp32/blob/idf-release/v4.2/docs/arduino-ide/mac.md, adding the --branch option:
git clone --branch idf-release/v4.2 https://github.com/espressif/arduino-esp32.git esp32 --depth 1
Whether I do this on top of my existing installation, or as the initial ESP32 installation after wiping my existing library files, I still get ValueError: dlsym(RTLD_DEFAULT, kIOMasterPortDefault): symbol not found.

What am I doing wrong? What's the proper way to install the idf-release/v4.2 branch?

@Liferme
Copy link

Liferme commented Nov 15, 2020

When I compile and upload,
I got the same error on my BigSir Beta version and solved with the following ways.

-esptool is dependent on pyserial (you need to install pyserial latest version) and

-Arduino's default preferences for ESPTool is binary file , it does not use the (esptool.py) source file.
So need to replace default esptool binary file with esptool.py file in system.

How to replace?... :)

  1. Click Arduino Menu => Preferences
  2. Find [ArduinoLibraryPath]/preferences.txt at the bottom left of Preferences' Settings Tab, Click to Open
    ArduinoLibrary Folder.
  3. Find & Open packages/esp32/hardware/esp32/1.x.x Folder and open platform.txt
  4. At the line no 7. replace binary tools.esptool_py.cmd=esptool with tools.esptool_py.cmd=esptool.py and save.
  5. Open packages/esp32/hardware/esp32/1.x.x/tools folder.
  6. Copy esptool.py and paste to ArduinoLibraryFolder/packages/esp32/tools/esptool_py/2.x.x
  7. Quit Arduino IDE and open again. have a nice coding. 👍

Image 11-13-20 at 1 10 AM

It really works, and we have to combine the method with the command @robsworld provided. When compiling, remember to choose "ESP32 Arduino", NOT "ESP32 Arduino(in sketch book)", and have fun coding!

@me-no-dev
Copy link
Member

@TimoWielink thanks for the confirmation :) I have updated the version in Master, so it will go out in 1.0.5 in a few days.

@aungthawdar
Copy link

aungthawdar commented Nov 15, 2020

@aungthawdar tried your solution and got this error

Traceback (most recent call last): File "/Users/xxxxxxx/Library/Arduino15/packages/esp32/tools/esptool_py/2.6.1/esptool.py", line 37, in <module> import serial ImportError: No module named serial

@SpoonS2K
You need to install pyserial package and be sure to import first

https://pyserial.readthedocs.io/en/latest/pyserial.html
esptool.py used(import) serial library

Here is how to test, you've already installed serial or not.

  1. Open terminal
  2. type python in that terminal
  3. type import serial
  4. if no error, you've already installed serial,
    other wise you'll get
    "import serial ImportError: No module named serial

Screen Shot 2020-11-15 at 6 18 01 PM

Have a nice code. :P

@tomtomhoward
Copy link

Thanks guys, just did the above and got it working on Big Sur for ESP32 in Arduino.
I had to update to 4.2, install python serial, and modify the files.

There's also some playing about getting the CP210x driver working for Dev-Kit ESP32 variants, involving adding the Silicon Labs developed ID to kext in OSX.

@me-no-dev
Copy link
Member

@tomtomhoward if you have updated to 4.2, then you should not have needed to change esptool. It is already a patched one.

@tomtomhoward
Copy link

I wouldn't trust my take on it, I'm working at the limits of my knowledge here to be honest. I think I might have messed up the 4.2 install as my Documents folder is on iCloud Drive.

@wick3r
Copy link

wick3r commented Nov 16, 2020

@aungthawdar tried your solution and got this error
Traceback (most recent call last): File "/Users/xxxxxxx/Library/Arduino15/packages/esp32/tools/esptool_py/2.6.1/esptool.py", line 37, in <module> import serial ImportError: No module named serial

@SpoonS2K
You need to install pyserial package and be sure to import first

https://pyserial.readthedocs.io/en/latest/pyserial.html
esptool.py used(import) serial library

Here is how to test, you've already installed serial or not.

  1. Open terminal
  2. type python in that terminal
  3. type import serial
  4. if no error, you've already installed serial,
    other wise you'll get
    "import serial ImportError: No module named serial
Screen Shot 2020-11-15 at 6 18 01 PM

Have a nice code. :P

Thank you so much for taking the time to explain! I did all this and got it to work. :)

@olivierbrcknr
Copy link

Thank all of you! I tried out different variants but still was not able to get it to work.

I reinstalled the Arduino IDE and deleted all my library folders to start from a clean slate. As far as I have understood, the current main branch has already the Big Sur patch included, right? But I unfortunately still get the ValueError: dlsym(RTLD_DEFAULT, kIOMasterPortDefault): symbol not found error.

After doing the recommended fix by @aungthawdar I get also the ImportError: No module named serial error which I am not able to fix through installing pyserial and serial in both, python2.7 and python3.8.

Do you have any ideas or recommendations? Would be very much appreciated!

@me-no-dev
Copy link
Member

@olivierbrcknr did you install from git? to your [sketchbook]/hardware/espressif/esp32 folder?

@olivierbrcknr
Copy link

Yes, I followed the repo's instructions for macOS

@me-no-dev
Copy link
Member

could you check the esptool version?

@me-no-dev
Copy link
Member

You can now also try to install 1.0.5-rc2 through the board manager using https://raw.githubusercontent.com/espressif/arduino-esp32/gh-pages/package_esp32_dev_index.json

@olivierbrcknr
Copy link

So, I added the .json file you shared to reinstall it through the board manager. This didn't work, so I deleted and installed everything again to make sure I do not have any old file conflicting or accidentally being used, still the same error. I then figured out I had yet another python version, installed pyserial and serial there as well to test the esptool.py method again, but also no success.

I have the esp32 library version 1.0.5-rc2 installed and esptool version 3.0.0 if I see it correctly.

@me-no-dev
Copy link
Member

hmmm that is strange. that version of esptool I read should be patched... I guess I need to figure out BigSur VM, because I can not now upgrade to it and risk messing up my work env :)

@olivierbrcknr
Copy link

No worries, I should have done the same ;) I will experiment a little more and try to figure out the issue, probably it's related to my individual settings/mess-ups. I will let you know if I solve it!

@aungthawdar
Copy link

@olivierbrcknr ,

In my opinion, whether it's latest ArduinoIDE / latest Arduino-esp32 version or not , dependency is python & pyserial.
Your problem is that can't installed python serial(pyserial) package correctly for system default using python version.

I suggest to https://opensource.com/article/19/5/python-3-default-mac for right python and pip version.
After set up the right

  1. python ( recommended version is >3.7 , python 2.7 is already deprecated ) and
  2. pip ( recommended version is pip3 )

install python -m pip install pyserial
I think your ValueError:.... will be gone away soon.

Have a nice code. :P

@adamwilt
Copy link
Author

It would be preferable to have a version of the toolchain that just worked with the Python version installed as part of the OS. As it currently stands, installing esp32 library version 1.0.5-rc2 on OS 11 fails exactly the same way as version 1.0.4 does.

Yes, one can install Homebrew, then install Python 3.7.x, then install pip3, and finally make the dotfile changes to run pyenv, but that's hardly a turnkey solution, especially by Arduino standards. And you'd only know about it if you'd followed this issue. Expect a lot of support requests if this convoluted path isn't straightened out. :-)

For me, it's just a lot less bother to develop in a 10.15 VM atop OS 11, because I'd already gotten that working a couple of weeks ago on the first try, with no false steps and no weird error messages. But that's just me...

@me-no-dev
Copy link
Member

given that mac uses a prepackaged python into binary, it should not care for what is on your OS. I find it strange that it does. Whatever the fix is, it should not require the user to install anything else, just like it is on anything but BigSur. Arduino does not differentiate between the versions, so we can not provide two files for mac.

@rOOOObin
Copy link

rOOOObin commented Nov 17, 2020

@robsworld

@aungthawdar 👍

Thank you for this solution. It works great.
The only think I have to add is you must change the permission of esptool.py with the terminal:

chmod +x /Users/XXXXX/Library/Arduino15/packages/esp32/tools/esptool_py/2.6.1/esptool.py

I´m not really good in using the terminal on mac.
Can you tell me what to type in at XXXXX ?

Thank you!

@aungthawdar
Copy link

@rOOOObin , XXXXX means XXX^2 => porn square (Just kidding).
XXXXX means current user's home directory(username) in unix system.

In your mac terminal,
type chmod +x /Users/ then type the tab key.
You will see the user home directory name.

Cheers

@Boyeen
Copy link

Boyeen commented Feb 4, 2021

It didn't solved my problem. Doesn't seem related to esptool or pyserial

Me too. I was working until today when a botched library install (Blynk). I uninstalled Arduino (yeah, I know)
and reinstalled.... now this problem:

bash: line 0: [: /Users/tim/xxx: binary operator expected
usage: cp [-R [-H | -L | -P]] [-fi | -n] [-apvXc] source_file target_file
cp [-R [-H | -L | -P]] [-fi | -n] [-apvXc] source_file ... target_directory
exit status 64
/Applications/Arduino.app/Contents/Java/arduino-builder returned 64
Error compiling for board ESP32 Dev Module.

Any suggestions?

@luxnaut
Copy link

luxnaut commented Feb 5, 2021

Yep, still having major issues after doing everything in here....

@Boyeen
Copy link

Boyeen commented Feb 8, 2021

Some sketches fail with a bash error as I showed above and others with a "cp"

FWIW On some scripts the problems go away if there are no comments at the top of the file... weird right?
Put in a comment and they fail to compile, remove it and they compile/run

@csteamengine
Copy link

csteamengine commented Feb 8, 2021

For a Mac Big Sur user on a 2015 Macbook Pro, the only solution that worked was to revert my OS to Catalina. Like I mentioned above, none of the suggested solutions worked for me, and I had confirmed PySerial was installed correctly, but not being utilized by Arduino's IDE.

I had been having many many issues with Big Sur, so I'm actually happy to be back on Catalina. Hope this helps some poor Big Sur Soul fix their issues.

@luxnaut
Copy link

luxnaut commented Feb 8, 2021

So, I was able to get it working (apologies if you've already tried this or if I just overlooked it being posted on here). What I found is that Arduino natively uses Python 2.7 instead of the now-standard 3+ that most would have. So what was happening in my case was it was searching for pyserial FOR 2.7 instead. What I had to do was download pyserial, direct terminal to that folder, and then do a manual install for "python2" and now everything works. Note, I was on Big Sur 11.2 and now am on Big Sur 11.3 Beta so this should work for the most recent macOS.

@ardu1
Copy link

ardu1 commented Feb 8, 2021

So would it not be much easier to change in the IDE to Phyton 3+, than nobody has to make a workaround?

@luxnaut
Copy link

luxnaut commented Feb 8, 2021

So would it not be much easier to change in the IDE to Phyton 3+, than nobody has to make a workaround?

You would think, but I've not seen this possible anywhere. I believe Arduino themselves has control over this, but I could be wrong.

@jdgarcia99
Copy link

So, I was able to get it working (apologies if you've already tried this or if I just overlooked it being posted on here). What I found is that Arduino natively uses Python 2.7 instead of the now-standard 3+ that most would have. So what was happening in my case was it was searching for pyserial FOR 2.7 instead. What I had to do was download pyserial, direct terminal to that folder, and then do a manual install for "python2" and now everything works. Note, I was on Big Sur 11.2 and now am on Big Sur 11.3 Beta so this should work for the most recent macOS.

Could you please detail a little bit how did you do this?
Sorry but I'm still locked into this problem. I'm also in Big Sur 11.2
THX!!!!

@luxnaut
Copy link

luxnaut commented Feb 8, 2021

So, I was able to get it working (apologies if you've already tried this or if I just overlooked it being posted on here). What I found is that Arduino natively uses Python 2.7 instead of the now-standard 3+ that most would have. So what was happening in my case was it was searching for pyserial FOR 2.7 instead. What I had to do was download pyserial, direct terminal to that folder, and then do a manual install for "python2" and now everything works. Note, I was on Big Sur 11.2 and now am on Big Sur 11.3 Beta so this should work for the most recent macOS.

Could you please detail a little bit how did you do this?
Sorry but I'm still locked into this problem. I'm also in Big Sur 11.2
THX!!!!

Yeah! So you need to download pyserial (https://pypi.org/project/pyserial/) and unzip it. Put it on your desktop, or somewhere easy to navigate to in terminal. Open terminal and direct it to be inside the folder, and then type "sudo python2 setup.py install". This should initiate the download and then all you have to do it go back into Arduino and it should work.

@jdgarcia99
Copy link

So, I was able to get it working (apologies if you've already tried this or if I just overlooked it being posted on here). What I found is that Arduino natively uses Python 2.7 instead of the now-standard 3+ that most would have. So what was happening in my case was it was searching for pyserial FOR 2.7 instead. What I had to do was download pyserial, direct terminal to that folder, and then do a manual install for "python2" and now everything works. Note, I was on Big Sur 11.2 and now am on Big Sur 11.3 Beta so this should work for the most recent macOS.

Could you please detail a little bit how did you do this?
Sorry but I'm still locked into this problem. I'm also in Big Sur 11.2
THX!!!!

Yeah! So you need to download pyserial (https://pypi.org/project/pyserial/) and unzip it. Put it on your desktop, or somewhere easy to navigate to in terminal. Open terminal and direct it to be inside the folder, and then type "sudo python2 setup.py install". This should initiate the download and then all you have to do it go back into Arduino and it should work.

Thx luxnaut for this

The library installed well. and I restarted the Arduino IDE

Unfortunately, same error saying:

Traceback (most recent call last):
File "/Users/juande/Library/Arduino15/packages/esp32/tools/esptool_py/2.6.1/esptool.py", line 38, in
import serial
ModuleNotFoundError: No module named 'serial'
Found many libraries for "WiFi.h"
Used: /Users/juande/Library/Arduino15/packages/esp32/hardware/esp32/1.0.4/libraries/WiFi
Not used: /Applications/Arduino.app/Contents/Java/libraries/WiFi
exit status 1

@luxnaut
Copy link

luxnaut commented Feb 8, 2021 via email

@joesoh
Copy link

joesoh commented Feb 12, 2021

It works! Following the instruction and modified file permission. Library/Arduino15/packages/esp32/tools/esptool_py/2.6.1/esptool.py to be executable

@sorriso93
Copy link

It didn't solved my problem. Doesn't seem related to esptool or pyserial

Me too. I was working until today when a botched library install (Blynk). I uninstalled Arduino (yeah, I know)
and reinstalled.... now this problem:

bash: line 0: [: /Users/tim/xxx: binary operator expected usage: cp [-R [-H | -L | -P]] [-fi | -n] [-apvXc] source_file target_file cp [-R [-H | -L | -P]] [-fi | -n] [-apvXc] source_file ... target_directory exit status 64 /Applications/Arduino.app/Contents/Java/arduino-builder returned 64 Error compiling for board ESP32 Dev Module.

Any suggestions?

Just for all big sur users as a future reference.
I discovered the problem cause for the errore above (bash line 0 ....). The same error appears on Catalina, so it's not a problem only related to Big Sur.
It is "simply" becouse we have the sketch folder in a iCloud folder, move it locally and magically the error will disappear. This is due probably to something changed in the compiler or esptool that tries to copy using cp and doesn't accept the path for icloud folders.

@valepe
Copy link

valepe commented Feb 25, 2021

Me too. I was working until today when a botched library install (Blynk). I uninstalled Arduino (yeah, I know)
and reinstalled.... now this problem:
bash: line 0: [: /Users/tim/xxx: binary operator expected usage: cp [-R [-H | -L | -P]] [-fi | -n] [-apvXc] source_file target_file cp [-R [-H | -L | -P]] [-fi | -n] [-apvXc] source_file ... target_directory exit status 64 /Applications/Arduino.app/Contents/Java/arduino-builder returned 64 Error compiling for board ESP32 Dev Module.
Any suggestions?

Just for all big sur users as a future reference.
I discovered the problem cause for the errore above (bash line 0 ....). The same error appears on Catalina, so it's not a problem only related to Big Sur.
It is "simply" becouse we have the sketch folder in a iCloud folder, move it locally and magically the error will disappear. This is due probably to something changed in the compiler or esptool that tries to copy using cp and doesn't accept the path for icloud folders.

Same error but my cloud folder is locally synced so it should see a local path. But this path has a space in the middle and the bash error reports only the path until the space. Maybe the error is here?

@guslindi
Copy link

Me too. I was working until today when a botched library install (Blynk). I uninstalled Arduino (yeah, I know)
and reinstalled.... now this problem:
bash: line 0: [: /Users/tim/xxx: binary operator expected usage: cp [-R [-H | -L | -P]] [-fi | -n] [-apvXc] source_file target_file cp [-R [-H | -L | -P]] [-fi | -n] [-apvXc] source_file ... target_directory exit status 64 /Applications/Arduino.app/Contents/Java/arduino-builder returned 64 Error compiling for board ESP32 Dev Module.
Any suggestions?

Just for all big sur users as a future reference.
I discovered the problem cause for the errore above (bash line 0 ....). The same error appears on Catalina, so it's not a problem only related to Big Sur.
It is "simply" becouse we have the sketch folder in a iCloud folder, move it locally and magically the error will disappear. This is due probably to something changed in the compiler or esptool that tries to copy using cp and doesn't accept the path for icloud folders.

Same error but my cloud folder is locally synced so it should see a local path. But this path has a space in the middle and the bash error reports only the path until the space. Maybe the error is here?

Thanks valepe for the suggestion, you are right! Just remove any spaces of the folder/sub folders of the sketch's path and it works fine. No further actions needed.

@valepe
Copy link

valepe commented Mar 6, 2021

No further actions needed.

My hope is that they fix it anyway. Indeed it's an error.

@johnty
Copy link

johnty commented Mar 20, 2021

I just ran into this space in the path issue as well (OSX 10.14), leading to the somewhat cryptic "binary operator expected usage". thanks for the notes here! If I recall this didn't happen before but its been a few OSX versions... I just tried to compile the same code from a while back that was stored in a different folder, while the same code checked out to another path (with no spaces) was working fine.

@jhoughjr
Copy link

several months into this issue and SiLabs are still ignoring it and pretending the driver they released in September of last year works. It does not. 7 months now with horrible support shows me I will never integrate any Silabs products in any design.

@ace18zz
Copy link

ace18zz commented Apr 8, 2021

When I compile and upload,
I got the same error on my BigSir Beta version and solved with the following ways.

-esptool is dependent on pyserial (you need to install pyserial latest version) and

-Arduino's default preferences for ESPTool is binary file , it does not use the (esptool.py) source file.
So need to replace default esptool binary file with esptool.py file in system.

How to replace?... :)

  1. Click Arduino Menu => Preferences
  2. Find [ArduinoLibraryPath]/preferences.txt at the bottom left of Preferences' Settings Tab, Click to Open
    ArduinoLibrary Folder.
  3. Find & Open packages/esp32/hardware/esp32/1.x.x Folder and open platform.txt
  4. At the line no 7. replace binary tools.esptool_py.cmd=esptool with tools.esptool_py.cmd=esptool.py and save.
  5. Open packages/esp32/hardware/esp32/1.x.x/tools folder.
  6. Copy esptool.py and paste to ArduinoLibraryFolder/packages/esp32/tools/esptool_py/2.x.x
  7. Quit Arduino IDE and open again. have a nice coding. 👍

Image 11-13-20 at 1 10 AM

I followed this step to change my documentation, but I got a new error:.

fork/exec /Users/Lerry/Library/Arduino15/packages/esp32/tools/esptool_py/3.0.0/esptool.py: permission denied
Error compiling for board Adafruit ESP32 Feather.

Does anyone know how to solve this one plz?

@me-no-dev
Copy link
Member

please stop "hacking" :) Latest 1.0.6 release and current master branch both support BigSur. I develop on M1 mac here :)

@hey-om7
Copy link

hey-om7 commented May 1, 2021

me too :(

same here :(

@rhl-
Copy link

rhl- commented Jul 17, 2021

Hi, I am on Big Sur 11.4 I have a board with a DOIT ESP32 DEVKIT V1 chip.

I've install esp32 module v 1.0.6 via this location: https://dl.espressif.com/dl/package_esp32_index.json,http://arduino.esp8266.com/stable/package_esp8266com_index.json

I've installed the latest Silab 2102x driver from here: https://www.silabs.com/documents/public/software/Mac_OSX_VCP_Driver.zip

This is my upload experience (while holding the button down on my device):

/Users/rhl/Library/Arduino15/packages/esp32/tools/esptool_py/3.0.0/esptool --chip esp32 --port /dev/cu.SLAB_USBtoUART --baud 115200 --before default_reset --after hard_reset write_flash -z --flash_mode dio --flash_freq 80m --flash_size detect 0xe000 /Users/rhl/Library/Arduino15/packages/esp32/hardware/esp32/1.0.6/tools/partitions/boot_app0.bin 0x1000 /Users/rhl/Library/Arduino15/packages/esp32/hardware/esp32/1.0.6/tools/sdk/bin/bootloader_dio_80m.bin 0x10000 /var/folders/_f/ysbftd0x5nzgm5sxpf6kz4xw0000gn/T/arduino_build_515485/WiFiScan.ino.bin 0x8000 /var/folders/_f/ysbftd0x5nzgm5sxpf6kz4xw0000gn/T/arduino_build_515485/WiFiScan.ino.partitions.bin 
Serial port /dev/cu.SLAB_USBtoUART

Connecting........_____....._____....._____....._____....._____....._____.....____An error occurred while uploading the sketch
_

A fatal error occurred: Failed to connect to ESP32: Timed out waiting for packet header

Aside from reinstalling all of this software for the 1000x time, or bashing head against the wall, is there anything I can do to debug this further?

Also odd, the device presents two USB devices on osx, the one above and:

/dev/cu.usbserial-0202C751

@igor17400
Copy link

I have decided to write a summary for all those reading the post at a later time.

  1. Open your arduino IDE and press command + , to open preferences window.

  2. Click the preferences path at the bottom. This should open finder with the path being used by arduino IDE. If for some reason this doesn't work, make use of a manual step. Open the terminal and run open /Users/<user>/Library/Arduino15/

  3. Dive into /Users/<user>/Library/Arduino15/packages/Heltec-esp32/hardware/esp32/0.0.5/tools/esptool.py and copy esptool.py file.

4.1) Paste the copied file into /Users/<user>/Library/Arduino15/packages/Heltec-esp32/tools/esptool_py/2.6.1/

4.2) Open /Users/<user>/Library/Arduino15/platform.txt file and change tools.esptool_py.cmd=esptool to tools.esptool_py.cmd=esptool.py

  1. Run ls /Users/<user>/Library/Arduino15/packages/Heltec-esp32/tools/esptool_py/2.6.1/ to check if the file was indeed copied. You should see two files, esptool and esptool.py. However, esptool - without py extension - isn't nedded.

  2. Quit and reopen arduino IDE. Try to run the script on the IDE.

  3. If the script does not work, after all those steps, due to the following error ImportError: No module named serial read the next steps.

  4. Open your terminal and make sure you aren't in any virtual environment, unless you're running your arduino IDE in some virtual environment. If you aren't, which was my case, I tried several times to run python -m pip install pyserial, however I kept receiving the same error ImportError: No module named serial. The problem was that pyserial library was being installed on python3 environment and my Arduino IDE was running at python2.

  5. Install pip for python2 via curl https://bootstrap.pypa.io/pip/2.7/get-pip.py -o get-pip.py afterwards run python2 get-pip.py

  6. Run python2 -m pip install pyserial and try to run the script again in arduino IDE.

Those steps worked for me, I hope it helps

:)

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
None yet
Projects
None yet
Development

No branches or pull requests