Hi. So, apparently. I'm new to this Arduino community.
And there's an error while I'm trying to upload a sketch that I made.
By sketch, I mean any sketch. I can't seem to upload them into my
NodeMCU 1.0 ESP8266 Board for some reason. It gave me this error,
pyserial or esptool directories not found next to this upload.py tool.
An error occurred while uploading the sketch
Full error message :
Arduino: 1.8.13 (Mac OS X), Board: "NodeMCU 1.0 (ESP-12E Module), 80 MHz, Flash, Legacy (new can return nullptr), All SSL ciphers (most compatible), 4MB (FS:2MB OTA:~1019KB), 2, v2 Lower Memory, Disabled, None, Only Sketch, 115200"
Executable segment sizes:
IROM : 232856 - code in flash (default or ICACHE_FLASH_ATTR)
IRAM : 26888 / 32768 - code in IRAM (ICACHE_RAM_ATTR, ISRs...)
DATA : 1248 ) - initialized variables (global, static) in RAM/HEAP
RODATA : 728 ) / 81920 - constants (global, static) in RAM/HEAP
BSS : 24928 ) - zeroed variables (global, static) in RAM/HEAP
Sketch uses 261720 bytes (25%) of program storage space. Maximum is 1044464 bytes.
Global variables use 26904 bytes (32%) of dynamic memory, leaving 55016 bytes for local variables. Maximum is 81920 bytes.
pyserial or esptool directories not found next to this upload.py tool.
An error occurred while uploading the sketch
This report would have more information with
"Show verbose output during compilation"
option enabled in File -> Preferences.
and yes, I did use my MacBook using macOS cause that's the
only laptop that I have. Plus, I also tried the following :
Reinstall Arduino
Reinstalling Python
Installed Python 3
Installed module of pyserial and esptools using Command Line
And yet, for some reason it still won't work.
Is there anything that I could do?. My friend can't help
me that much.
OK, I don't remember how did I sort it out last time, but now I have ran into the same problem again when I made a fresh new install of Big Sur. I am still not able to send the compiled sketch into the ESP through the ArduinoIDE, however I have managed to get it work with the help of external tools completely independent of Arduino software. I did use makeEspArduino tool from Peter Lerup (plerup). At the beginning I was running into the same issue, however I have soon discovered it is very important how you install the Python libraries (if is it as a root user or a regular user). Basically it means, that the problem is in the rights. ArduinoIDE is running processes under the different user than it did install libraries. Till now I am still not able to get it work over ArduinoIDE, but fortunately solution from Peter works well. It is a few more steps to do before upload can be performed, it is not as streamlined as ArduinoIDE, but IT IS WORKING! I am now thinking about letting the ArduinoIDE be as it is, don't worrying about it, forget it and use different approaches where I have way more control over what and how is being done than rely solely on something what is doing it's stuff on the background and spits error after error on me. The worst thing is that no-one even replied on this issue for more than two months now. How are you supposed to work with that?
I ran into this issue on Big Sur as well. It looks like the upload tool doesn't currently work out-of-the-box. Specifically, upload.py uses esptool which uses pyserial which is not fully functional on Big Sur.
The workaround is to edit ~/Library/Arduino15/packages/esp8266/hardware/esp8266/2.7.4/tools/esptool/esptool.py and comment out a block of code by adding # to the start of each line:
#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
Anyway, hope this helps someone else who searches for this issue and arrives at this thread.
I updated my mac to macOS 11.0.1 Big Sur today and found the same problem.
Instead of commenting the lines that flszen mentioned I fixed the source of the problem.
Context
Arduino IDE version: 1.8.13
esp8266 Core version: 2.7.4
My workaround is as follows:
1.- Open ~/Library/Arduino15/packages/esp8266/hardware/esp8266/2.7.4/tools/pyserial/serial/tools/list_ports_osx.py
2.- Comment out lines 29 and 30 and append these lines: iokit = ctypes.cdll.LoadLibrary('/System/Library/Frameworks/IOKit.framework/IOKit') cf = ctypes.cdll.LoadLibrary('/System/Library/Frameworks/CoreFoundation.framework/CoreFoundation')
This is the same fix that the developers of pyserial made (Latest version of the file here) to fix this issue but the esp8266 core uses a 2 year old version of pyserial, so until they update the library this will still be an issue.
juanssl:
I updated my mac to macOS 11.0.1 Big Sur today and found the same problem.
Instead of commenting the lines that flszen mentioned I fixed the source of the problem.
Context
Arduino IDE version: 1.8.13
esp8266 Core version: 2.7.4
My workaround is as follows:
1.- Open ~/Library/Arduino15/packages/esp8266/hardware/esp8266/2.7.4/tools/pyserial/serial/tools/list_ports_osx.py
2.- Comment out lines 29 and 30 and append these lines: iokit = ctypes.cdll.LoadLibrary('/System/Library/Frameworks/IOKit.framework/IOKit') cf = ctypes.cdll.LoadLibrary('/System/Library/Frameworks/CoreFoundation.framework/CoreFoundation')
This is the same fix that the developers of pyserial made ([Latest version of the file here](https://github.com/pyserial/pyserial/blob/master/serial/tools/list_ports_osx.py)) to fix this issue but the esp8266 core uses a 2 year old version of pyserial, so until they update the library this will still be an issue.
juanssl:
I updated my mac to macOS 11.0.1 Big Sur today and found the same problem.
Instead of commenting the lines that flszen mentioned I fixed the source of the problem.
Context
Arduino IDE version: 1.8.13
esp8266 Core version: 2.7.4
My workaround is as follows:
1.- Open ~/Library/Arduino15/packages/esp8266/hardware/esp8266/2.7.4/tools/pyserial/serial/tools/list_ports_osx.py
2.- Comment out lines 29 and 30 and append these lines: iokit = ctypes.cdll.LoadLibrary('/System/Library/Frameworks/IOKit.framework/IOKit') cf = ctypes.cdll.LoadLibrary('/System/Library/Frameworks/CoreFoundation.framework/CoreFoundation')
This is the same fix that the developers of pyserial made ([Latest version of the file here](https://github.com/pyserial/pyserial/blob/master/serial/tools/list_ports_osx.py)) to fix this issue but the esp8266 core uses a 2 year old version of pyserial, so until they update the library this will still be an issue.
juanssl:
I updated my mac to macOS 11.0.1 Big Sur today and found the same problem.
Instead of commenting the lines that flszen mentioned I fixed the source of the problem.
Context
Arduino IDE version: 1.8.13
esp8266 Core version: 2.7.4
My workaround is as follows:
1.- Open ~/Library/Arduino15/packages/esp8266/hardware/esp8266/2.7.4/tools/pyserial/serial/tools/list_ports_osx.py
2.- Comment out lines 29 and 30 and append these lines: iokit = ctypes.cdll.LoadLibrary('/System/Library/Frameworks/IOKit.framework/IOKit') cf = ctypes.cdll.LoadLibrary('/System/Library/Frameworks/CoreFoundation.framework/CoreFoundation')
This is the same fix that the developers of pyserial made ([Latest version of the file here](https://github.com/pyserial/pyserial/blob/master/serial/tools/list_ports_osx.py)) to fix this issue but the esp8266 core uses a 2 year old version of pyserial, so until they update the library this will still be an issue.
Why does Apple keep doing this to us? I switched from windows 10 years ago and it was great up until that last few years when this untested stuff is constantly foisted on us, the trusting public. I think I will hold off on these "upgrades" until at least 6 months have gone by.
1.- Open ~/Library/Arduino15/packages/esp8266/hardware/esp8266/2.7.4/tools/pyserial/serial/tools/list_ports_osx.py
2.- Comment out lines 29 and 30 and append these lines: iokit = ctypes.cdll.LoadLibrary('/System/Library/Frameworks/IOKit.framework/IOKit') cf = ctypes.cdll.LoadLibrary('/System/Library/Frameworks/CoreFoundation.framework/CoreFoundation')
juanssl:
I updated my mac to macOS 11.0.1 Big Sur today and found the same problem.
Instead of commenting the lines that flszen mentioned I fixed the source of the problem.
Context
Arduino IDE version: 1.8.13
esp8266 Core version: 2.7.4
My workaround is as follows:
1.- Open ~/Library/Arduino15/packages/esp8266/hardware/esp8266/2.7.4/tools/pyserial/serial/tools/list_ports_osx.py
2.- Comment out lines 29 and 30 and append these lines: iokit = ctypes.cdll.LoadLibrary('/System/Library/Frameworks/IOKit.framework/IOKit') cf = ctypes.cdll.LoadLibrary('/System/Library/Frameworks/CoreFoundation.framework/CoreFoundation')
This is the same fix that the developers of pyserial made ([Latest version of the file here](https://github.com/pyserial/pyserial/blob/master/serial/tools/list_ports_osx.py)) to fix this issue but the esp8266 core uses a 2 year old version of pyserial, so until they update the library this will still be an issue.
juanssl:
I updated my mac to macOS 11.0.1 Big Sur today and found the same problem.
Instead of commenting the lines that flszen mentioned I fixed the source of the problem.
Context
Arduino IDE version: 1.8.13
esp8266 Core version: 2.7.4
My workaround is as follows:
1.- Open ~/Library/Arduino15/packages/esp8266/hardware/esp8266/2.7.4/tools/pyserial/serial/tools/list_ports_osx.py
2.- Comment out lines 29 and 30 and append these lines: iokit = ctypes.cdll.LoadLibrary('/System/Library/Frameworks/IOKit.framework/IOKit') cf = ctypes.cdll.LoadLibrary('/System/Library/Frameworks/CoreFoundation.framework/CoreFoundation')
This is the same fix that the developers of pyserial made ([Latest version of the file here](https://github.com/pyserial/pyserial/blob/master/serial/tools/list_ports_osx.py)) to fix this issue but the esp8266 core uses a 2 year old version of pyserial, so until they update the library this will still be an issue.
Good afternoon, I have this issue with pyserial and esptools and have tried the workarounds above both of which don't work for me. Has anything changed in the last 3 weeks or so that I can try. I'm getting very frustrated with the whole thing when not so long ago everything worked perfectly.