0
0

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.

ESP32がValueError: dlsymとNomodule named serialと出てコンパイルできない

Last updated at Posted at 2020-12-16

環境

  • Mac
    • macOS Big Sur 11.0.1
    • Macbook 2017 1.2 GHz デュアルコアIntel Core m3 8GBメモリ
    • Arduino 1.8.13
  • Ubuntu
    • Ubuntu 20.04
    • 16GBメモリ
    • Ryzen5 2600
    • Arduino 1.8.13

問題

esp_tool

ValueError: dlsym(RTLD_DEFAULT, kIOMasterPortDefault): symbol not found
Failed to execute script esptool
exit status 255
/Applications/Arduino.app/Contents/Java/arduino-builderが255を返しました。

というエラーがMacで出ました。Ubuntuでは出ませんでした。
この問題はこちらのサイトに書いてある通り、以下のように実行することで解決しました。(一部改変)

cp ~/Library/Arduino15/packages/esp32/hardware/esp32/1.0.4/tools/esptool.py ~/Library/Arduino15/packages/esp32/tools/esptool_py/2.6.1/esptool.py
chmod +x ~/Library/Arduino15/packages/esp32/hardware/esp32/1.0.4/tools/esptool.py ~/Library/Arduino15/packages/esp32/tools/esptool_py/2.6.1/esptool.py

次に~/Library/Arduino15/packages/esp32/hardware/esp32/1.0.4/platform.txtを次のように変更します。

- tools.esptool_py.cmd=esptool
+ tools.esptool_py.cmd=esptool.py

No module named serial

Arduino IDEで「検証」を押すと以下のようなエラーが出ました。

ImportError: No module named serial

これはこちらのサイトの通りにすることで解決しました。

sudo pip2 install pyserial

別のサイトでは、pip install pyserialを実行することが紹介されていましたが、sudo pip2でないと解決しませんでした。

Ubuntu 20.04の中にはpip2が入っていなかったので、以下のようにしてpip2をインストールしました。


curl https://bootstrap.pypa.io/get-pip.py --output get-pip.py
sudo python2 get-pip.py

参考にしたサイト

こちらの2つのサイトには本当に助けれました。この二つのサイトでどちらの問題も解決しました。
https://www.chihayafuru.jp/tech/index.php/archives/3820
https://appex.blog.fc2.com/blog-entry-83.html

0
0
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
0
0

Delete article

Deleted articles cannot be recovered.

Draft of this article would be also deleted.

Are you sure you want to delete this article?