0

我正在使用 MicroPython 扩展,并已通过串行 COM 端口使用 NodeMCU flasher 工具将 MicroPython 固件(操作系统)成功刷入到 ESP8266 目标设备。

通过选择项目文件夹创建新项目后,我被告知 COM 端口的自动检测不适用于 Windows 版本的 Visual Studio Code。系统提示我手动输入已将目标 MicroPython 设备连接到的 COM 端口,然后 VSC 会说:

Port not exist, please connect device and try again!

我尝试了所有 4 个 USB 端口,重新安装了驱动程序软件,重新启动计算机,重新启动目标设备并确保目标设备处于程序闪存模式(以允许将应用程序写入其中)每次我尝试连接VSC给它!

4

2 回答 2

0

我建议使用 pycom pymakr 扩展。如果您的主板/固件可以运行 telnet,pymakr 通过串行 USB 和 TCP 连接

于 2018-12-28T15:29:06.673 回答
0

在 Windows 上使用 Micropython IDE 扩展时,我遇到了与您无法指定端口相同的问题。

我找到了一种无需离开 Visual Studio 即可运行 micropython 脚本的简单方法。首先你需要安装 python,然后安装 ampy,使用pip install ampy.

然后添加这个task.json 构建任务。您需要根据需要调整波特率和端口。

{
    // See https://go.microsoft.com/fwlink/?LinkId=733558
    // for the documentation about the tasks.json format
    "version": "2.0.0",
    "tasks": [
        {
            "label": "ampy",
            "type": "shell",
            "command": "ampy -b 115200 -p COM5 -d 1 run ${file} --no-output",
            "group": {
                "kind": "build",
                "isDefault": true
            }
        }
    ]
}

只需键入 Ctrl+Shift+B 即可在您的设备上运行当前的 python 文件。

于 2018-06-28T09:23:55.223 回答