筆者の環境
OS: Ubuntu 22.04LTS
Terminal: zsh
Python: 3.10.6
ESP8266: B07V3PY2FH
今回ではMicroPython
をインストールします。
ファームウェアの削除
($とか%とか>とかコピーするときに邪魔ですよね。)
esptool.py --port /dev/ttyUSB0 erase_flash
(esptool.py
が見つからない場合はesptool
にしてください。(以降のコマンドも))
esptool.py v2.8
Found 1 serial ports
Serial port /dev/ttyUSB0
Connecting....
Detecting chip type... ESP8266
~~~~
Enabling default SPI flash mode...
Erasing flash (this may take a while)...
A fatal error occurred: ESP8266 ROM does not support function erase_flash.
とエラーが出た。
ファームウェアの再インストール
esptool.py -p /dev/ttyUSB0 --baud 115200 write_flash --flash_mode=dio --flash_size=4MB 0 esp8266-20180511-v1.9.4.bin
一番最後のesp8266-20180511-v1.9.4.bin
はファームウェアです。
MicroPython公式サイトからDLしてください。
そうすると
esptool.py v2.8
Serial port /dev/ttyUSB0
Connecting....
Detecting chip type... ESP8266
Chip is ESP8266EX
Features: WiFi
Crystal is 26MHz
MAC: c8:c9:a3:66:90:aa
Enabling default SPI flash mode...
Configuring flash size...
Erasing flash...
Flash params set to 0x0240
Took 2.73s to erase flash block
Wrote 591872 bytes at 0x00000000 in 58.0 seconds (81.7 kbit/s)...
Leaving...
Hard resetting via RTS pin...
もちろんpicocom
でも
picocom /dev/ttyUSB0 --b 115200
picocom v3.1
port is : /dev/ttyUSB0
flowcontrol : none
baudrate is : 115200
parity is : none
databits are : 8
stopbits are : 1
escape is : C-a
local echo is : no
noinit is : no
noreset is : no
hangup is : no
nolock is : no
send_cmd is : sz -vv
receive_cmd is : rz -vv -E
imap is :
omap is :
emap is : crcrlf,delbs,
logfile is : none
initstring : none
exit_after is : not set
exit is : no
Type [C-a] [C-h] to see available commands
Terminal ready
>>>
Thonyでも
MicroPython v1.19.1 on 2022-06-18; ESP module (1M) with ESP8266
Type "help()" for more information.
>>>
と、うまくファームウェアの更新に成功しました。
あと全然関係ないですが
Leaving...
Hard resetting via RTS pin...
ってめっちゃかっこよくないですか?