MicroPythonをESP32にインストール

ESP32にPythonをインストールして、何かを創りあげたいと思いインストールに挑戦してみました。

今回使用しているのは、ESP32チップを載せたdevkitを使用してインストールを行いました。下記のような電子機器です。

インストールの流れとしては、下記の順です。
①インストールファイル binファイルをダウンロード
 ダウンロード元URL:http://micropython.org/download#esp32

②ESP32devlitボード内のデータクリアをする。

#esptool.py –chip esp32 –port /dev/ttyUSB0 erase_flash
esptool.py v2.7
Serial port /dev/ttyUSB0
Connecting….
Chip is ESP32D0WDQ6 (revision 1)
Features: WiFi, BT, Dual Core, 240MHz, VRef calibration in efuse, Coding Scheme None
WARNING: Detected crystal freq 41.01MHz is quite different to normalized freq 40MHz. Unsupported crystal in use?
Crystal is 40MHz
MAC: cc:50:e3:95:bb:a4
Uploading stub…
Running stub…
Stub running…
Erasing flash (this may take a while)…
Chip erase completed successfully in 4.1s
Hard resetting via RTS pin…

③スーパユーザ(root)でインストールを行う

#esptool.py –port /dev/ttyUSB0 –baud 115200 –after no_reset write_flash –flash_mode dio –flash_freq 80m –flash_size detect 0x1000 esp32-20190914-v1.11-312-g22099ab88.bin
esptool.py v2.7
Serial port /dev/ttyUSB0
Connecting…….._
Detecting chip type… ESP32
Chip is ESP32D0WDQ6 (revision 1)
Features: WiFi, BT, Dual Core, 240MHz, VRef calibration in efuse, Coding Scheme None
Crystal is 40MHz
MAC: cc:50:e3:95:bb:a4
Uploading stub…
Running stub…
Stub running…
Configuring flash size…
Auto-detected Flash size: 4MB
Flash params set to 0x022f
Compressed 1203040 bytes to 757729…
Wrote 1203040 bytes (757729 compressed) at 0x00001000 in 67.9 seconds (effective 141.7 kbit/s)…
Hash of data verified.

Leaving…
Staying in bootloader.

④ESP32へ接続をする。

#cu -s 115200 -l /dev/ttyUSB0
Connected.

>>>

ここまで順調に進められればESP32上でPythonを使用することが可能です。
ただ、順調に行かないこともあるので、私がハマったエラーの対象方法について、次の記事で紹介したいと思います。

コメント

タイトルとURLをコピーしました