首页 > 解决方案 > 无法将 Adafruit Metro ESP32-S2 连接到计算机

问题描述

我最近买了一个 Adafruit Metro ESP32-S2,这样我就可以将它连接到我的 LED 灯条 (WS2812B) 并通过我的手机控制它。我正在尝试连接它,但它不起作用。通过 Arduino IDE,我添加了这个

https://adafruit.github.io/arduino-board-index/package_adafruit_index.json

进入“Additional Boards Manager URLs”并选择 Adafruit Metro 选项。

我尝试切换到 USB 2.0 端口,但这并没有改变任何东西。

当按住 DFU 按钮时,按下重置按钮,然后松开 DFU 按钮会创建一个新端口 (COM5)。这里发生了什么事?

我可以通过这个新端口进行连接,但是每当我尝试上传时,它都会让我上传大约 30 秒,然后发送此错误

avrdude: stk500_getsync() attempt 1 of 10: not in sync: resp=0xcb
avrdude: stk500_recv(): programmer is not responding
avrdude: stk500_getsync() attempt 2 of 10: not in sync: resp=0xcb
avrdude: stk500_recv(): programmer is not responding
avrdude: stk500_getsync() attempt 3 of 10: not in sync: resp=0xcb
avrdude: stk500_recv(): programmer is not responding
avrdude: stk500_getsync() attempt 4 of 10: not in sync: resp=0xcb
avrdude: stk500_recv(): programmer is not responding
avrdude: stk500_getsync() attempt 5 of 10: not in sync: resp=0xcb
avrdude: stk500_recv(): programmer is not responding
avrdude: stk500_getsync() attempt 6 of 10: not in sync: resp=0xcb
avrdude: stk500_recv(): programmer is not responding
avrdude: stk500_getsync() attempt 7 of 10: not in sync: resp=0xcb
avrdude: stk500_recv(): programmer is not responding
avrdude: stk500_getsync() attempt 8 of 10: not in sync: resp=0xcb
avrdude: stk500_recv(): programmer is not responding
avrdude: stk500_getsync() attempt 9 of 10: not in sync: resp=0xcb
avrdude: stk500_recv(): programmer is not responding
avrdude: stk500_getsync() attempt 10 of 10: not in sync: resp=0xcb
Problem uploading to board.  See http://www.arduino.cc/en/Guide/Troubleshooting#upload for suggestions.

我正在运行的代码也可能有问题,我不确定。

#include "WiFi.h"

const char* ssid = "Network Name";
const char* password =  "Network Passwords";

void setup() {

  Serial.begin(115200);

  WiFi.begin(ssid, password);

  while (WiFi.status() != WL_CONNECTED) {
    delay(500);
    Serial.println("Connecting to WiFi..");
  }

  Serial.println("Connected to the WiFi network");

}

void loop() {}

如何将 Metro ESP32-S2 连接到我的电脑?如果我缺少任何需要的信息,请提醒我。

标签: c++arduino

解决方案


不知道更多,我只能建议这个。确保在 ide 中选择了合适的板卡和编程器,然后确保选择了正确的波特率。还要确保您不需要下载额外的驱动程序。由于出现了 com 端口,这可能不是驱动程序问题,但仔细检查并没有什么坏处。

自从我使用任何与 arduino 相关的东西以来已经有几年了,所以我很抱歉不能太具体。

据我记得,代码看起来很适合测试连接,我会更多地研究该板所需的编程设置,因为它似乎是板和程序员之间的通信错误。


推荐阅读