23
8

Delete article

Deleted articles cannot be recovered.

Draft of this article would be also deleted.

Are you sure you want to delete this article?

More than 3 years have passed since last update.

岩手県立大学Advent Calendar 2020

Day 15

macOS Big SurでESP32のコンパイルが通らなかった件を解決したメモ #m5stack

Posted at

Atom Liteを触ろうとしてエラーが出たのでメモです。

環境

  • macOS v11.0.1 Big Sur
  • Arduino IDE 1.8.13

出たエラー

In file included from /Users/n0bisuke/Documents/ds/Arduino/libraries/M5Atom/src/M5Atom.h:52:0,
                 from /Users/n0bisuke/Documents/ds/Arduino/libraries/M5Atom/examples/Basics/LEDSet/LedSet.ino:1:
/Users/n0bisuke/Documents/ds/Arduino/libraries/FastLED/FastLED.h:14:21: note: #pragma message: FastLED version 3.003.003
 #    pragma message "FastLED version 3.003.003"
                     ^
In file included from /Users/n0bisuke/Documents/ds/Arduino/libraries/FastLED/FastLED.h:65:0,
                 from /Users/n0bisuke/Documents/ds/Arduino/libraries/M5Atom/src/M5Atom.h:52,
                 from /Users/n0bisuke/Documents/ds/Arduino/libraries/M5Atom/examples/Basics/LEDSet/LedSet.ino:1:
/Users/n0bisuke/Documents/ds/Arduino/libraries/FastLED/fastspi.h:130:23: note: #pragma message: No hardware SPI pins defined.  All SPI access will default to bitbanged output
 #      pragma message "No hardware SPI pins defined.  All SPI access will default to bitbanged output"
                       ^
In file included from /Users/n0bisuke/Documents/ds/Arduino/libraries/M5Atom/src/M5Atom.h:52:0,
                 from /Users/n0bisuke/Documents/ds/Arduino/libraries/M5Atom/src/M5Atom.cpp:4:
/Users/n0bisuke/Documents/ds/Arduino/libraries/FastLED/FastLED.h:14:21: note: #pragma message: FastLED version 3.003.003
 #    pragma message "FastLED version 3.003.003"
                     ^
In file included from /Users/n0bisuke/Documents/ds/Arduino/libraries/FastLED/FastLED.h:65:0,
                 from /Users/n0bisuke/Documents/ds/Arduino/libraries/M5Atom/src/M5Atom.h:52,
                 from /Users/n0bisuke/Documents/ds/Arduino/libraries/M5Atom/src/M5Atom.cpp:4:
/Users/n0bisuke/Documents/ds/Arduino/libraries/FastLED/fastspi.h:130:23: note: #pragma message: No hardware SPI pins defined.  All SPI access will default to bitbanged output
 #      pragma message "No hardware SPI pins defined.  All SPI access will default to bitbanged output"
                       ^
In file included from /Users/n0bisuke/Documents/ds/Arduino/libraries/M5Atom/src/utility/LED_Display.h:4:0,
                 from /Users/n0bisuke/Documents/ds/Arduino/libraries/M5Atom/src/utility/LED_DisPlay.cpp:1:
/Users/n0bisuke/Documents/ds/Arduino/libraries/FastLED/FastLED.h:14:21: note: #pragma message: FastLED version 3.003.003
 #    pragma message "FastLED version 3.003.003"
                     ^
In file included from /Users/n0bisuke/Documents/ds/Arduino/libraries/FastLED/FastLED.h:65:0,
                 from /Users/n0bisuke/Documents/ds/Arduino/libraries/M5Atom/src/utility/LED_Display.h:4,
                 from /Users/n0bisuke/Documents/ds/Arduino/libraries/M5Atom/src/utility/LED_DisPlay.cpp:1:
/Users/n0bisuke/Documents/ds/Arduino/libraries/FastLED/fastspi.h:130:23: note: #pragma message: No hardware SPI pins defined.  All SPI access will default to bitbanged output
 #      pragma message "No hardware SPI pins defined.  All SPI access will default to bitbanged output"
                       ^
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が255を返しました。
ボードESP32 Pico Kitに対するコンパイル時にエラーが発生しました。

最後のこの辺が怪しいですよね

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

先人がいた

調べたら既に解決している人がいて全く同じ形で解決できました。

手順

    1. plathome.txtの書き換え

packages/esp32/hardware/esp32/1.x.x フォルダの中にある plathome.txtを開き、 7行目にあるtools.esptool_py.cmd=esptoolとなっている部分を tools.esptool_py.cmd=esptool.pyと書き換えて保存する

スクリーンショット 2020-12-15 3.38.21.png

    1. esptool.pyのコピー

packages/esp32/hardware/esp32/1.x.x/tools フォルダにある esptool.py を packages/esp32/tools/esptool_py/2.x.x/ フォルダにコピーする。

    1. esptool.py に実行権限を付与

コピーした esptool.py に実行権限をつける。 chmod +x packages/esp32/tools/esptool_py/2.x.x/esptool.py

スクリーンショット 2020-12-15 3.38.46.png

ここまででできる人は出来るっぽいですが、僕はできなかったので次の手順です。

    1. serialとpyserialのインストール

pyserialだけでも良いのかもですが、ここまでで試した際にImportError: No module named serialとエラーが出たのでserialのインストールもしました。

pip3 install serial
pip3 install pyserial
    1. esptool.pyをenv変更

esptool.pyをpython3で実行するようにします。2.x.xフォルダにコピーした、2.x.x/esptool.pyの方です。

僕の環境の場合/usr/local/bin/python3にpython3がインストールされています。

$ which python3
/usr/local/bin/python3

1行目の#!/usr/bin/env python#!/usr/local/bin/python3に変更しました。

    1. Arduino IDEの再起動

最後に再起動したら無事コンパイルが通るようになりました。

参考

先人がいて助かりますね、ありがとうございました。

23
8
0

Register as a new user and use Qiita more conveniently

  1. You get articles that match your needs
  2. You can efficiently read back useful information
  3. You can use dark theme
What you can do with signing up
23
8

Delete article

Deleted articles cannot be recovered.

Draft of this article would be also deleted.

Are you sure you want to delete this article?