0

我正在使用 HM-10 复制 CC4A-1 模块。经过一番挣扎后,我将它与 Arduino Uno R3 连接起来。我使用 Arduino 串行监视器执行了一些 AT 命令,它在执行 AT+RENEW 命令后突然停止工作。我也尝试执行 AT+BAUD command but it returned error before executing AT+RENEW.

This is the output of Arduino Serial Monitor while sending data from HMBLE Terminal Android Application

#include <SoftwareSerial.h>

SoftwareSerial BTSerial(2, 3); //RX|TX


void setup(){
  Serial.begin(9600);
  BTSerial.begin(9600); // default baud rate
  while(!Serial); //if it is an Arduino Micro
  Serial.println("AT commands: ");
}

void loop(){
  //read from the HM-10 and print in the Serial
  if(BTSerial.available())
    Serial.write(BTSerial.read());

  //read from the Serial and print to the HM-10
  if(Serial.available())
    BTSerial.write(Serial.read());
}

这是从 Android 应用程序发送的内容

4

2 回答 2

1

看看串行输出,我猜你发送“AT+RENEW”命令时波特率并没有改变。我怀疑这是通过查看“€”的二进制等价物,即“10000000”。UART 数据发送低电平有效,因此它看起来正在检测一个字节的开头,但是,其余高低信号的时序是错误的。我会尝试以您在 AT+RENEW 命令之前设置的任何波特率连接模块。

HM-10 的官方行为是模块应该返回到 9600 的波特率。但是,我注意到偶尔需要通过关闭电源然后打开来重置它。或者,发送“AT+RESET”。

话虽如此,如果它是 HM-10 克隆,谁知道固件中到底发生了什么。

于 2016-07-15T17:06:55.377 回答
0

自从我终于找到解决方案以来,在谷歌上搜索了很多之后......我正在研究 ESP8266 模块,我也试图改变它的波特率,它停止工作我用谷歌搜索了我最后执行的命令,发现错误的命令损坏了我搜索的模块固件并通过在其中重新加载固件来恢复 ESP8266

以上作为对我的提示,我对我的 HM-10 模块做了同样的事情,并使用下面的链接上传了原始 HM-10 模块固件,最后它的工作就像一个魅力,真的很高兴再次继续我的项目任何面临同样问题的人给下面的链接试一试

https://forum.arduino.cc/index.php?topic=393655.0

于 2016-07-17T15:33:54.357 回答