NB-IoT接入问题-Arduino中文社区 - Powered by Discuz!

Arduino中文社区

 找回密码
 立即注册

QQ登录

只需一步,快速开始

查看: 1519|回复: 2

[已解答] NB-IoT接入问题

[复制链接]
发表于 2021-3-3 17:51 | 显示全部楼层 |阅读模式
各位大佬好,我这边使用arduino mega2560+SIM7020C,想接入点灯科技,这边使用了网站里的例程代码
  1. #define BLINKER_NBIOT_SIM7020

  2. #include <Blinker.h>

  3. char auth[] = "007093b088f6";

  4. // 新建组件对象
  5. BlinkerButton Button1("btn-abc");
  6. BlinkerNumber Number1("num-abc");

  7. int counter = 0;

  8. // 按下按键即会执行该函数
  9. void button1_callback(const String & state) {
  10.     BLINKER_LOG("get button state: ", state);
  11.     digitalWrite(LED_BUILTIN, !digitalRead(LED_BUILTIN));
  12. }

  13. // 如果未绑定的组件被触发,则会执行其中内容
  14. void dataRead(const String & data)
  15. {
  16.     BLINKER_LOG("Blinker readString: ", data);
  17.     counter++;
  18.     Number1.print(counter);
  19. }

  20. void setup() {
  21.     // 初始化串口
  22.     Serial.begin(115200);
  23.     BLINKER_DEBUG.stream(Serial);
  24.    
  25.     // 初始化有LED的IO
  26.     pinMode(LED_BUILTIN, OUTPUT);
  27.     digitalWrite(LED_BUILTIN, HIGH);
  28.     // 初始化blinker
  29.     Blinker.begin(auth, 50, 51, 9600);
  30.     Blinker.attachData(dataRead);
  31.     Button1.attach(button1_callback);
  32. }

  33. void loop() {
  34.     Blinker.run();
  35. }
复制代码

但是串口监视器中显示
  1. 17:46:03.264 -> [0]
  2. 17:46:03.264 -> [0] blinker v0.3.6
  3. 17:46:03.264 ->     To better use blinker with your IoT project!
  4. 17:46:03.264 ->     Download latest blinker library here!
  5. 17:46:03.264 ->     => https://github.com/blinker-iot/blinker-library
  6. 17:46:03.264 ->
  7. 17:46:03.367 -> [108] Blinker NBIoT initialized...
  8. 17:46:26.150 -> [22704] [HTTP] GET... success
  9. 17:46:45.563 -> [41974] [HTTP] ... success
  10. 17:46:50.729 -> [47094] Connecting to MQTT...
  11. 17:46:56.975 -> [53291] Retrying MQTT connection in 5 seconds...
  12. 17:46:57.107 -> [53428] Connecting to MQTT...
  13. 17:47:03.868 -> [60151] Retrying MQTT connection in 5 seconds...
  14. 17:47:09.060 -> [65306] Connecting to MQTT...
  15. 17:47:15.263 -> [71445] Retrying MQTT connection in 5 seconds...
  16. 17:47:15.840 -> [72003] Connecting to MQTT...
  17. 17:47:21.756 -> [77873] Retrying MQTT connection in 5 seconds...
  18. 17:47:21.858 -> [78010] Connecting to MQTT...
  19. 17:47:27.623 -> [83723] Retrying MQTT connection in 5 seconds...
  20. 17:47:27.929 -> [84017] Connecting to MQTT...
  21. 17:47:33.900 -> [89948] Retrying MQTT connection in 5 seconds...
  22. 17:47:34.003 -> [90047] Connecting to MQTT...
  23. 17:47:39.778 -> [95774] Retrying MQTT connection in 5 seconds...
  24. 17:47:40.047 -> [96050] Connecting to MQTT...
  25. 17:47:46.065 -> [102031] Retrying MQTT connection in 5 seconds...
  26. 17:47:46.166 -> [102132] Connecting to MQTT...
  27. 17:47:51.959 -> [107850] Retrying MQTT connection in 5 seconds...
  28. 17:47:52.163 -> [108075] Connecting to MQTT...
  29. 17:47:58.305 -> [114164] Retrying MQTT connection in 5 seconds...
  30. 17:47:58.374 -> [114246] Connecting to MQTT...
  31. 17:48:04.111 -> [119905] Retrying MQTT connection in 5 seconds...
  32. 17:48:04.245 -> [120069] Connecting to MQTT...
  33. 17:48:10.383 -> [126139] Retrying MQTT connection in 5 seconds...
  34. 17:48:25.751 -> [141381] [HTTP] GET... success
  35. 17:48:26.558 -> [142186] Connecting to MQTT...
  36. 17:48:32.329 -> [147919] Retrying MQTT connection in 5 seconds...
  37. 17:48:32.603 -> [148184] Connecting to MQTT...
  38. 17:48:38.521 -> [154081] Retrying MQTT connection in 5 seconds...
  39. 17:48:38.654 -> [154186] Connecting to MQTT...
  40. 17:48:44.422 -> [159928] Retrying MQTT connection in 5 seconds...
  41. 17:48:44.689 -> [160189] Connecting to MQTT...
  42. 17:48:50.725 -> [166156] Retrying MQTT connection in 5 seconds...
  43. 17:48:50.826 -> [166254] Connecting to MQTT...
  44. 17:48:56.589 -> [171974] Retrying MQTT connection in 5 seconds...
  45. 17:49:01.612 -> [176992] Connecting to MQTT...
  46. 17:49:07.896 -> [183213] Retrying MQTT connection in 5 seconds...
  47. 17:49:07.996 -> [183313] Connecting to MQTT...
  48. 17:49:13.761 -> [189022] Retrying MQTT connection in 5 seconds...
  49. 17:49:13.862 -> [189122] Connecting to MQTT...
  50. 17:49:19.632 -> [194859] Retrying MQTT connection in 5 seconds...
  51. 17:49:19.902 -> [195119] Connecting to MQTT...
  52. 17:49:26.043 -> [201209] Retrying MQTT connection in 5 seconds...
  53. 17:49:26.112 -> [201310] Connecting to MQTT...
  54. 17:49:32.257 -> [207394] Retrying MQTT connection in 5 seconds...
  55. 17:49:33.005 -> [208121] Connecting to MQTT...
  56. 17:49:38.805 -> [213892] Retrying MQTT connection in 5 seconds...
  57. 17:49:39.042 -> [214125] Connecting to MQTT...
复制代码
始终没法成功连接MQTT,请问我应该怎么解决这个问题啊,NB-IoT模块已经按照厂商给的文档测试过没啥问题啊
发表于 2021-3-3 19:33 | 显示全部楼层
不排除是SIM模块固件变更引起的,我们会在近期重新测试该模块可用性
发表于 2021-3-3 20:10 | 显示全部楼层
奈何col 发表于 2021-3-3 19:33
不排除是SIM模块固件变更引起的,我们会在近期重新测试该模块可用性

SIM7020C C是国内版,这个版本淘宝的固件在MQTT方面就是个天坑,
首先是不支持用网址链接MQTT服务器,只支持IP链接(更新微雪提供的新固件可以解决),
其次就是MQTT clientid name pwd太长直接ERROR了,
再然后就是模块发送接收的数据都只能用16进制字符串(修改后压根不生效)
您需要登录后才可以回帖 登录 | 立即注册

本版积分规则

小黑屋|Archiver|手机版|Arduino中文社区

GMT+8, 2024-12-1 07:55 , Processed in 0.072425 second(s), 16 queries .

Powered by Discuz! X3.4

Copyright © 2001-2021, Tencent Cloud.

快速回复 返回顶部 返回列表