MacOS上使用可视化界面给ESP8266烧录MicroPython教程

#智能家居 2022-12-24 15:01:28 | 全文 557 字,阅读约需 2 分钟 | 加载中... 次浏览

👋 相关阅读


下载 mac 烧录工具 esptool

我本机自带的 python 为 2.7.10:

➜   python
Python 2.7.10 (default, Aug 17 2018, 19:45:58) 
[GCC 4.2.1 Compatible Apple LLVM 10.0.0 (clang-1000.0.42)] on darwin
Type "help", "copyright", "credits" or "license" for more information.
>>>

此前,也已经安装了 python3.x:

➜   python3
Python 3.6.5 (v3.6.5:f59c0932b4, Mar 28 2018, 05:52:31) 
[GCC 4.2.1 Compatible Apple LLVM 6.0 (clang-600.0.57)] on darwin
Type "help", "copyright", "credits" or "license" for more information.
>>>

使用如下命令,下载烧录工具:

pip3 install esptool

下载 MicroPython 固件

下载地址:https://micropython.org/download/

页面下方根据自己的开发版选择合适的固件,我这里使用的是 esp8266,下载地址如下:https://micropython.org/download/esp8266-1m/

查询esp8266 tty串口信息

使用数据线将 esp8266 和电脑连接在一起

ls /dev/cu.*

wangtwothree@WangTwoThrees-Mac-mini ~ % ls /dev/cu.*
/dev/cu.BeatsSolo               /dev/cu.Bluetooth-Incoming-Port /dev/cu.MINIJAMBOXbyJawbone     /dev/cu.usbserial-143420        /dev/cu.wchusbserial143420

/dev/cu.wchusbserial143420 就是开发版的串口,插拔几次对比一下变化就可以知道哪个是你的串口信息了,找不到的尝试更换数据线

下载可视化烧录软件

NodeMCU-PyFlasher(下载地址:https://github.com/marcelstoer/nodemcu-pyflasher)

这个软件本质也是使用 esptool 去烧录,只不过多了一个可视化界面,不想安装软件,想直接使用 esptool 的话,可以看着一篇文章,里边有介绍烧录方法 –> 手把手智能家居 | 手把手教你自制原生 HomeKit 智能开关,成本仅 10 元! https://blog.wangtwothree.com/smart_home/117.html

图片alt

整个刷机时间大概持续1分钟

图片alt

实际后台执行的是这条命令:

esptool.py --port /dev/cu.wchusbserial1420 --baud 115200 --after no_reset write_flash --flash_mode dio 0x00000 /Users/david/Downloads/esp8266-1m-20200902-v1.13.bin --erase-all

至此,刷机流程结束。

Edit | Last updated on 2024-04-28 17:28:37




×