請問如何透過AT Commands上傳資料至IDEAS Chain新平台?

Star發佈於2020-04-08 14:01:24

瀏覽30474

回覆2

最後編輯於2024-11-13 10:30:08

IDEAS Chain新平台上傳資料測試中,若直接透過DSI2598(BC26 AT Commands),始終無法上傳成功,

請問有客戶遇到類似的問題嗎?

 

附上Arduino IDE,個人執行AT Commands畫面如下連結。

https://tinyurl.com/szglp3f

執行後,IDEAS Chain新後台,無法看到資料(Latest Telemetry)...

 

但經由Linux端的mosquitto MQTT Client,IDEAS Chain新後台可看到上傳的資料。

$ ./mosquitto-telemetry.sh

Client mosq-CiwrowHAgC1QOqM0PA sending CONNECT

Client mosq-CiwrowHAgC1QOqM0PA received CONNACK (0)

Client mosq-CiwrowHAgC1QOqM0PA sending PUBLISH (d0, q0, r0, m1, 'v1/devices/me/telemetry', ... (51 bytes))

Client mosq-CiwrowHAgC1QOqM0PA sending DISCONNECT

 

 

Thanks,

Star

共2條回覆 最後由Star回覆於2020-04-08 14:58:53
#1
EricYang 回覆於 2020-06-02 23:49:09

我有試著用 Node-RED 丟一個名為 : MaxTemp 的值給你,應該也是成功的,只是覺得奇怪 您用DSI2598 的 AT command 卻無法成功.

我在 DSI2598 下的命令 也是與你的相同 ,蠻奇怪的 . 

  data_tempt = "AT+QMTPUB=0,0,0,0,";
  data_tempt.concat(topic);
  data_tempt.concat(",");
  data_tempt.concat(message);
  Serial.println(data_tempt);
  //  "AT+QMTPUB=0,0,0,0,\"v1/devices/me/telemetry\",\"{\"key1\":data, \"key2\":data}\""
  mySerial.println(data_tempt);
  //Serial.println(data_tempt);
  //Serial.println("data_tempt 上傳完成,delay 3*1000 ");
  //delay(3 * 1000);

  mySerial.println("AT+QMTCLOSE=0");      //3.2.3.  AT+QMTCLOSE    Close a Network for MQTT Client  page:12
  Serial.println("關閉 MQTT 連線");

#2
Star 回覆於 2020-04-08 14:58:53

目前只能先將telemetry感測資料改為單一欄位,是可行的,但資料太長就卡住了...

AT+QMTOPEN=0,"iiot.ideaschain.com.tw",1883 AT+QMTCONN=0,"iiot.ideaschain.com.tw","yldUM6DqxEukSR5D5Hx2","" AT+QMTPUB=0,0,0,0,"v1/devices/me/telemetry","{"level":"86%"}"