[esp8266]micropython相关资料和教学
在命令行安装esptool
esp8266 micropython固件官方下载页
- http://micropython.org/download/esp8266/
复制代码
命令行下查看usb ttl设备的
- crw-rw-rw- 1 root wheel 18, 4 Jul 20 22:24 /dev/tty.Bluetooth-Incoming-Port
- crw-rw-rw- 1 root wheel 18, 12 Jul 21 20:27 /dev/tty.usbserial-1420
- crw-rw-rw- 1 root wheel 18, 10 Jul 21 20:27 /dev/tty.wchusbserial1420
复制代码我这个是ch34xx,所以选 /dev/tty.wchusbserial1420
esptool在mac的路径如下,因为如果你安装完esptool后直接按网上的教程刷固件会提示没有esptool
- /Users/user/Library/Arduino15/packages/esp8266/hardware/esp8266/2.7.2/tools/esptool/esptool.py
- /Users/user/PycharmProjects/app/venv/bin/esptool.py
- /Users/user/PycharmProjects/app/venv/lib/python3.8/site-packages/esptool.py
复制代码
哪里你可以用
- /Users/user/PycharmProjects/app/venv/bin/esptool.py --port /dev/tty.wchusbserial1420 erase_flash
复制代码这样来对esp设备刷固件或者直接用这个命令解决找不到程序的问题.
- export PATH=$PATH:/Users/user/PycharmProjects/app/venv/bin/
复制代码这是mac的命令,按自己的情况修改自己的路径.
擦除ESP8266 flash的命令:
- esptool.py --port /dev/ttyUSB0 erase_flash
复制代码输出:
- esptool.py v2.8
- Serial port /dev/tty.wchusbserial1420
- Connecting....
- Detecting chip type... ESP8266
- Chip is ESP8266EX
- Features: WiFi
- Crystal is 26MHz
- MAC: e0:b5:d1:45:56:3e
- Uploading stub...
- Running stub...
- Stub running...
- Erasing flash (this may take a while)...
- Chip erase completed successfully in 13.6s
- Hard resetting via RTS pin...
复制代码
刷入固件命令:
- esptool.py --port /dev/ttyUSB0 --baud 460800 write_flash --flash_size=detect 0 esp8266-20170108-v1.8.7.bin
复制代码输出:
- esptool.py v2.8
- Serial port /dev/tty.wchusbserial1420
- Connecting....
- Detecting chip type... ESP8266
- Chip is ESP8266EX
- Features: WiFi
- Crystal is 26MHz
- MAC: e0:b5:d1:45:56:3e
- Uploading stub...
- Running stub...
- Stub running...
- Changing baud rate to 460800
- Changed.
- Configuring flash size...
- Auto-detected Flash size: 4MB
- Flash params set to 0x0040
- Compressed 619828 bytes to 404070...
- Wrote 619828 bytes (404070 compressed) at 0x00000000 in 9.7 seconds (effective 513.8 kbit/s)...
- Hash of data verified.
- Leaving...
- Hard resetting via RTS pin...
复制代码
|