ESP Easy 非常容易在 Windows 上进行烧录,使用项目代码库中包含的安装实用程序。如果您是 Linux 用户(PC、Raspberry Pi、Orange PI ...)或macOS,则需要使用本玩法中要介绍的 esptool.py
。 在本教程中,我们将在 Wemos D1 Mini 上安装固件,但这种方法也适用于所有的 ESP8266 NodeMCU(注意,在刷新固件之前,一些卡需要处于引导加载模式)。
在开始之前,请确认 python 2.7.x 版已正确安装。打开终端并运行 Python。如果安装了 Python,则必须启动 shell。输入 exit()
退出 shell。
Python 2.7.10 (default, Oct 23 2015, 19:19:21)
[GCC 4.2.1 Compatible Apple LLVM 7.0.0 (clang-700.0.59.5)] on darwin
Type "help", "copyright", "credits" or "license" for more information.
>>> exit()
如果您的机器上没有安装 Python,请安装。
为了安装 esptool.py,最好让 Python 加载它,以便同时安装所有依赖项。
pip install esptool
如果遇到困难,还可以运行 python -m pip install esptool
或 pip2 install esptool
。
启动PowerShell(它允许你运行 Unix 命令)。然后转到 esptool 安装目录,例如 Documents,然后像在 macOS 或 Linux 上一样启动 esptool(和依赖关系)的安装:
PS C:\Users\Christophe\Documents> pip install esptool
Collecting esptool
Downloading esptool-1.3.tar.gz
Collecting pyserial>=2.5 (from esptool)
Using cached pyserial-3.2.1-py2.py3-none-any.whl
Installing collected packages: pyserial, esptool
Running setup.py install for esptool ... done
Successfully installed esptool-1.3 pyserial-3.2.1
PS C:\Users\Christophe\Documents>
现在,您可以从任何地方调用 esptool.py
。 事实上,它被安装在 Python 的默认可执行文件目录(C:\Python27\Scripts \)中。
现在一切就绪,我们将能够启动安装。 在终端中,将自己置于 ESP Easy 目录中。你可以从这里直接从 GitHub 下载它,或者使用命令克隆它:
git https://github.com/espressif/esptool.git
使用 esptool.py 命令烧录固件到 ewp8266 可以使用以下的形式:
esptool.py --port [serial-port-of-ESP8266] write_flash -fm [mode] -fs [size] 0x00000 [nodemcu-firmware] .bin
因此,我们必须通过以下参数:
ls /dev/tty.*
命令。 在 Windows 上,在命令提示符下运行 mode
。例如 Wemos D1 Mini(4MB):
esptool.py --port COM3 --baud 115200 write_flash -fm dio -fs 32m 0x00000 ESPEasy_R120_4096.bin
还可以指定其他参数:
esptool.py
是市场上所有 ESP8266 开发板的实用程序。有必要通过传递与您的开发板相对应的参数来调整命令。 它也适用于新一代 ESP32。 要做到这一点,有必要去这里的 esptool.py 的文档。
esptool.py 发送另一个 NodeMCU、WeMOS、HUZZAH Feather,、Core Board、ESP32-WROVER-KIT 都可以切换到引导加载(bootload)模式,对于其他应用程序,则需要应用本教程中已经介绍的经典方法。
要接收开发板的特征,请运行命令 esptool.py --port COMx flash_id
C:\Users>esptool.py --port COM3 flash_id
esptool.py v1.3
Connecting....
Manufacturer: ef
Device: 4016
如果遇到安装问题,您可以尝试使用 erase_flash
命令擦除内存。
esptool.py --port COM3 erase_flash
观光\评论区