[英]How to send json data to thingsboard via MQTT using Arduino
我無法將自定義 JSON 數據發送到 thingsboard 服務器(演示雲)。 我使用 ArduinoJson 庫創建了一個 JSON 文件,但無法成功發送。
以下是部分代碼:
#include <ArduinoJson.h> #include <ESP8266WiFi.h> #include <ThingsBoard.h> StaticJsonDocument<512> data; void setup(){ //some code here } void loop(){ //some code here data["humidity"] = humidity; tb.sendTelemetryJson(data); //some code here }
我無法將自定義 JSON 數據發送到 thingsboard 服務器(演示雲)。 我使用 ArduinoJson 庫創建了一個 JSON 文件,但無法成功發送。
以下是部分代碼:
#include <ArduinoJson.h> #include <ESP8266WiFi.h> #include <ThingsBoard.h> StaticJsonDocument<512> data; void setup(){ //some code here } void loop(){ //some code here data["humidity"] = humidity; tb.sendTelemetryJson(data); //some code here }
聲明:本站的技術帖子網頁,遵循CC BY-SA 4.0協議,如果您需要轉載,請注明本站網址或者原文地址。任何問題請咨詢:yoyou2525@163.com.