关于 ESP32--蓝牙问题

2021-10-31 19:27:28 +08:00
 sonders

给 ESP32 通电,烧录程序后,按下 EN 键,串口调试中并没有正常打印文本,手机蓝牙扫描也扫描不出蓝牙,搜索不出问题答案,跑来 V2 试试。
不太懂这些,就是想玩一下。
代码部分:

#include <Arduino.h>
#include <BluetoothSerial.h>

BluetoothSerial SerialBT;
void setup() {
  Serial.begin(115200);
  SerialBT.begin("ESP32");
  Serial.printf("satrt 蓝牙 \r\n");

  // put your setup code here, to run once:
}

void loop() {
  if(Serial.available()) {
    SerialBT.write(Serial.read());
  }
  if(SerialBT.available()) {
    Serial.write(SerialBT.read());
  }
  delay(1);
  // put your main code here, to run repeatedly:
}
892 次点击
所在节点    问与答
15 条回复
weicoder
2021-10-31 19:35:06 +08:00
波特率设置对了吗
sonders
2021-10-31 19:39:22 +08:00
@weicoder 波特率是对的,串口调试助手也是 115200
amwyyyy
2021-11-01 09:37:44 +08:00
不至于串口都没打印,正常烧录了吗,跑个 helloworld 试试先。
sonders
2021-11-01 09:45:24 +08:00
@amwyyyy 我在做这个蓝牙之前写过一个 led 小灯,都是正常打印正常运行的。
sonders
2021-11-01 09:46:47 +08:00
@amwyyyy 烧录的话,我有看过一个文章,说是在出现 connect...___...的时候按下 en 键,但是我每次按烧录就直接停掉了
Rapisurazuri
2021-11-01 09:55:26 +08:00
@sonders 我记得如果 esp32 带 ch340g 的话,不需要手动 reset ,直接烧录就可以
amwyyyy
2021-11-01 09:56:43 +08:00
@sonders connect 之后会出现百分比进度条,不要按按键。
sonders
2021-11-01 10:06:28 +08:00
@Rapisurazuri 没有 reset ,都是直接烧录的,但是就是串口没打印,扫描也扫描不到
sonders
2021-11-01 10:07:20 +08:00
@amwyyyy 我都试了一遍,但是成功烧录之后也没效果
amwyyyy
2021-11-01 10:09:43 +08:00
@sonders 烧录之后,打开串口调试工具,再按一下 en
sonders
2021-11-01 10:33:52 +08:00
@amwyyyy 没用的,那个打印语句没有输出
theqiang
2021-11-01 15:16:39 +08:00
买的哪家的,我买的 tb 上某家的有个技术群,里面大佬挺多。你问问卖家有没有群
sonders
2021-11-01 17:20:01 +08:00
@theqiang 我也是在淘宝上买的,进了技术群,没人回答问题,我今天退群了
llkhsfy
2021-11-18 00:14:21 +08:00
确定正常烧录完毕吗
sonders
2021-11-18 12:10:05 +08:00
@llkhsfy 确认的

这是一个专为移动设备优化的页面(即为了让你能够在 Google 搜索结果里秒开这个页面),如果你希望参与 V2EX 社区的讨论,你可以继续到 V2EX 上打开本讨论主题的完整版本。

https://www.v2ex.com/t/811927

V2EX 是创意工作者们的社区,是一个分享自己正在做的有趣事物、交流想法,可以遇见新朋友甚至新机会的地方。

V2EX is a community of developers, designers and creative people.

© 2021 V2EX