NB-IoT接入问题
各位大佬好,我这边使用arduino mega2560+SIM7020C,想接入点灯科技,这边使用了网站里的例程代码#define BLINKER_NBIOT_SIM7020#include <Blinker.h>
char auth[] = "007093b088f6";
// 新建组件对象
BlinkerButton Button1("btn-abc");
BlinkerNumber Number1("num-abc");
int counter = 0;
// 按下按键即会执行该函数
void button1_callback(const String & state) {
BLINKER_LOG("get button state: ", state);
digitalWrite(LED_BUILTIN, !digitalRead(LED_BUILTIN));
}
// 如果未绑定的组件被触发,则会执行其中内容
void dataRead(const String & data)
{
BLINKER_LOG("Blinker readString: ", data);
counter++;
Number1.print(counter);
}
void setup() {
// 初始化串口
Serial.begin(115200);
BLINKER_DEBUG.stream(Serial);
// 初始化有LED的IO
pinMode(LED_BUILTIN, OUTPUT);
digitalWrite(LED_BUILTIN, HIGH);
// 初始化blinker
Blinker.begin(auth, 50, 51, 9600);
Blinker.attachData(dataRead);
Button1.attach(button1_callback);
}
void loop() {
Blinker.run();
}
但是串口监视器中显示17:46:03.264 ->
17:46:03.264 -> blinker v0.3.6
17:46:03.264 -> To better use blinker with your IoT project!
17:46:03.264 -> Download latest blinker library here!
17:46:03.264 -> => https://github.com/blinker-iot/blinker-library
17:46:03.264 ->
17:46:03.367 -> Blinker NBIoT initialized...
17:46:26.150 -> GET... success
17:46:45.563 -> ... success
17:46:50.729 -> Connecting to MQTT...
17:46:56.975 -> Retrying MQTT connection in 5 seconds...
17:46:57.107 -> Connecting to MQTT...
17:47:03.868 -> Retrying MQTT connection in 5 seconds...
17:47:09.060 -> Connecting to MQTT...
17:47:15.263 -> Retrying MQTT connection in 5 seconds...
17:47:15.840 -> Connecting to MQTT...
17:47:21.756 -> Retrying MQTT connection in 5 seconds...
17:47:21.858 -> Connecting to MQTT...
17:47:27.623 -> Retrying MQTT connection in 5 seconds...
17:47:27.929 -> Connecting to MQTT...
17:47:33.900 -> Retrying MQTT connection in 5 seconds...
17:47:34.003 -> Connecting to MQTT...
17:47:39.778 -> Retrying MQTT connection in 5 seconds...
17:47:40.047 -> Connecting to MQTT...
17:47:46.065 -> Retrying MQTT connection in 5 seconds...
17:47:46.166 -> Connecting to MQTT...
17:47:51.959 -> Retrying MQTT connection in 5 seconds...
17:47:52.163 -> Connecting to MQTT...
17:47:58.305 -> Retrying MQTT connection in 5 seconds...
17:47:58.374 -> Connecting to MQTT...
17:48:04.111 -> Retrying MQTT connection in 5 seconds...
17:48:04.245 -> Connecting to MQTT...
17:48:10.383 -> Retrying MQTT connection in 5 seconds...
17:48:25.751 -> GET... success
17:48:26.558 -> Connecting to MQTT...
17:48:32.329 -> Retrying MQTT connection in 5 seconds...
17:48:32.603 -> Connecting to MQTT...
17:48:38.521 -> Retrying MQTT connection in 5 seconds...
17:48:38.654 -> Connecting to MQTT...
17:48:44.422 -> Retrying MQTT connection in 5 seconds...
17:48:44.689 -> Connecting to MQTT...
17:48:50.725 -> Retrying MQTT connection in 5 seconds...
17:48:50.826 -> Connecting to MQTT...
17:48:56.589 -> Retrying MQTT connection in 5 seconds...
17:49:01.612 -> Connecting to MQTT...
17:49:07.896 -> Retrying MQTT connection in 5 seconds...
17:49:07.996 -> Connecting to MQTT...
17:49:13.761 -> Retrying MQTT connection in 5 seconds...
17:49:13.862 -> Connecting to MQTT...
17:49:19.632 -> Retrying MQTT connection in 5 seconds...
17:49:19.902 -> Connecting to MQTT...
17:49:26.043 -> Retrying MQTT connection in 5 seconds...
17:49:26.112 -> Connecting to MQTT...
17:49:32.257 -> Retrying MQTT connection in 5 seconds...
17:49:33.005 -> Connecting to MQTT...
17:49:38.805 -> Retrying MQTT connection in 5 seconds...
17:49:39.042 -> Connecting to MQTT...
始终没法成功连接MQTT,请问我应该怎么解决这个问题啊,NB-IoT模块已经按照厂商给的文档测试过没啥问题啊:'( 不排除是SIM模块固件变更引起的,我们会在近期重新测试该模块可用性 奈何col 发表于 2021-3-3 19:33
不排除是SIM模块固件变更引起的,我们会在近期重新测试该模块可用性
SIM7020C C是国内版,这个版本淘宝的固件在MQTT方面就是个天坑,
首先是不支持用网址链接MQTT服务器,只支持IP链接(更新微雪提供的新固件可以解决),
其次就是MQTT clientid name pwd太长直接ERROR了,
再然后就是模块发送接收的数据都只能用16进制字符串(修改后压根不生效)
页:
[1]