Page 1 of 1
Forum

Welcome to the Tweaking4All community forums!
When participating, please keep the Forum Rules in mind!

Topics for particular software or systems: Start your topic link with the name of the application or system.
For example “MacOS X – Your question“, or “MS Word – Your Tip or Trick“.

Please note that switching to another language when reading a post will not bring you to the same post, in Dutch, as there is no translation for that post!




macOS - Aruino IDE ...
 
Share:
Notifications
Clear all

[Solved] macOS - Aruino IDE - How to fix "pyserial or esptool directories not found next to this upload.py tool" error (ESP8266)


 Hans
(@hans)
Noble Member Admin
Joined: 8 years ago
Posts: 2005
Topic starter  

When switching to Big Sur, somehow the ESP8266 tools for the Arduino IDE broke ... and one cannot upload compiled sketches any more.

An example of this error:

pyserial or esptool directories not found next to this upload.py tool.
An error occurred while uploading the sketch

 

This affects at least ESP8266 Core version 2.7.4 and 2.7.2 (I'm running Arduino IDE version: 1.8.13 right now).

The fix:

  1. Open the file
    ~/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 add these lines:
       iokit = ctypes.cdll.LoadLibrary('/System/Library/Frameworks/IOKit.framework/IOKit')
       cf = ctypes.cdll.LoadLibrary('/System/Library/Frameworks/CoreFoundation.framework/CoreFoundation')

The code should look something like this, save it and try again ... this fixed it on my Mac:

from serial.tools import list_ports_common

#iokit = ctypes.cdll.LoadLibrary(ctypes.util.find_library('IOKit'))
#cf = ctypes.cdll.LoadLibrary(ctypes.util.find_library('CoreFoundation'))
iokit = ctypes.cdll.LoadLibrary('/System/Library/Frameworks/IOKit.framework/IOKit')
cf = ctypes.cdll.LoadLibrary('/System/Library/Frameworks/CoreFoundation.framework/CoreFoundation')

kIOMasterPortDefault = ctypes.c_void_p.in_dll(iokit, "kIOMasterPortDefault")
kCFAllocatorDefault = ctypes.c_void_p.in_dll(cf, "kCFAllocatorDefault")

ReplyQuote
(@vinlas)
New Member
Joined: 4 months ago
Posts: 1
 

Very useful,

It worked for me (iMAC BIG SUR).

thanks for sharing


Hans liked
ReplyQuote

Like what you see and you'd like to help out? 

The best way to help is of course by assisting others with their questions here in the forum, but you can also help us out in other ways:

- Do your shopping at Amazon, it will not cost you anything extra but may generate a small commission for us,
- send a cup of coffee through PayPal ($5, $10, $20, or custom amount),
- become a Patreon,
- donate BitCoin (BTC), or BitCoinCash (BCH).

Share: