blinker 温度无法存储数据,附调试信息-Arduino中文社区 - Powered by Discuz! Archiver

lslcxlsl 发表于 2020-10-26 22:43

blinker 温度无法存储数据,附调试信息

本帖最后由 lslcxlsl 于 2020-10-26 22:43 编辑

600008] message: /heartbeat?deviceName=ACC2534CLMGA6R6OI7KJAC0U&key=a9135b780e41&heartbeat=600
blinker server begin
Freeheap: 29488
HTTPS begin: https://iot.diandeng.tech/api/v1/user/device/heartbeat?deviceName=ACC2534CLMGA6R6OI7KJAC0U&key=a9135b780e41&heartbeat=600
HTTPS payload: /heartbeat?deviceName=ACC2534CLMGA6R6OI7KJAC0U&key=a9135b780e41&heartbeat=600
status... code: 200
{"detail": "", "message": 1000}
payload: null
checkNum count: 2
time (millis() - ntpFreshTime): 120852
ntpGetTime: 1603720975
0
time: 1603721096,second: 56
now_time: 1603721040
dataStorage num: 0 ,1603721040
dataStorage count: 2
saveData: 21.00
saveData dataCount: 2
temp save: 21.00 time: 1603721040
data_dataCount: 2
checkNum count: 2
time: 1603721096,second: 56
now_time: 1603721040
dataStorage num: 1 ,1603721040
dataStorage count: 2
saveData: 42.00
saveData dataCount: 2
humi save: 42.00 time: 1603721040
data_dataCount: 2
Connecting to MQTT...
MQTT Connected!
Freeheap: 8864
Humidity: 42.00 %
Temperature: 21.00 *C
Humidity: 42.00 %
Temperature: 21.00 *C
Freeheap: 8776
getData _data_: [,]
num: 0 name: temp
Freeheap: 8728
getData _data_: [,]
num: 1 name: humi
Freeheap: 8680
dataUpdate: {"deviceName":"ACC2534CLMGA6R6OI7KJAC0U","key":"a9135b780e41","data":{"temp":[,],"humi":[,]}}
Freeheap: 8680
message: {"deviceName":"ACC2534CLMGA6R6OI7KJAC0U","key":"a9135b780e41","data":{"temp":[,],"humi":[,]}}
blinker server begin
Freeheap: 29008
HTTPS begin: https://iot.diandeng.tech/api/v1/user/device/cloudStorage/
HTTPS payload: {"deviceName":"ACC2534CLMGA6R6OI7KJAC0U","key":"a9135b780e41","data":{"temp":[,],"humi":[,]}}
status... code: 200
{"detail": "max device data key size limit", "message": 1513}
ERROR: max device data key size limit
payload: {"detail": "max device data key size limit", "message": 1513}
Humidity: 42.00 %

getData _data_: [,]
num: 0 name: temp
Freeheap: 8864
getData _data_: [,]
num: 1 name: humi
Freeheap: 8816
dataUpdate: {"deviceName":"ACC2534CLMGA6R6OI7KJAC0U","key":"a9135b780e41","data":{"temp":[,],"humi":[,]}}
Freeheap: 8816
message: {"deviceName":"ACC2534CLMGA6R6OI7KJAC0U","key":"a9135b780e41","data":{"temp":[,],"humi":[,]}}
blinker server begin
Freeheap: 29144
HTTPS begin: https://iot.diandeng.tech/api/v1/user/device/cloudStorage/
HTTPS payload: {"deviceName":"ACC2534CLMGA6R6OI7KJAC0U","key":"a9135b780e41","data":{"temp":[,],"humi":[,]}}
status... code: 200
{"detail": "max device data key size limit", "message": 1513}
ERROR: max device data key size limit
payload: {"detail": "max device data key size limit", "message": 1513}





我看调试信息,提示数据限制了,我应该怎么处理呢?
#define BLINKER_WIFI
#define BLINKER_MIOT_SENSOR

#include <Blinker.h>
#include <DHT.h>

char auth[] = "a9135b780e41";
char ssid[] = "abc";
char pswd[] = "chenxu123";

BlinkerNumber HUMI("humi");
BlinkerNumber TEMP("temp");

#define DHTPIN D7

#define DHTTYPE DHT11   // DHT 11
//#define DHTTYPE DHT22   // DHT 22(AM2302), AM2321
//#define DHTTYPE DHT21   // DHT 21 (AM2301)

DHT dht(DHTPIN, DHTTYPE);

int humi_read = 0, temp_read = 0;

void heartbeat()
{
    HUMI.print(humi_read);
    TEMP.print(temp_read);
}

void dataStorage()
{
    Blinker.dataStorage("temp", temp_read);
    Blinker.dataStorage("humi", humi_read);
}

void miotQuery(int32_t queryCode)
{
    BLINKER_LOG("MIOT Query codes: ", queryCode);

    switch (queryCode)
    {
      case BLINKER_CMD_QUERY_ALL_NUMBER :
            BLINKER_LOG("MIOT Query All");
            BlinkerMIOT.temp(temp_read);
            BlinkerMIOT.humi(humi_read);
            BlinkerMIOT.print();
            break;
      default :
            BlinkerMIOT.temp(20);
            BlinkerMIOT.humi(20);
            break;
    }
}

void setup()
{
    Serial.begin(115200);
    BLINKER_DEBUG.stream(Serial);
    BLINKER_DEBUG.debugAll();
    pinMode(LED_BUILTIN, OUTPUT);
    digitalWrite(LED_BUILTIN, LOW);

    Blinker.begin(auth, ssid, pswd);
    Blinker.attachHeartbeat(heartbeat);
    Blinker.attachDataStorage(dataStorage);
    BlinkerMIOT.attachQuery(miotQuery);
    dht.begin();
}

void loop()
{
    Blinker.run();

    int h = dht.readHumidity();
    int t = dht.readTemperature();

    if (isnan(h) || isnan(t))
    {
      BLINKER_LOG("Failed to read from DHT sensor!");
    }
    else
    {
      humi_read = h;
      temp_read = t;
    }

    Blinker.delay(2000);
}





奈何col 发表于 2020-10-26 22:48

免费版只有5个数据存储key,用完就不能存了。可以通过 菜单》开发者 删除之前的key

lslcxlsl 发表于 2020-10-27 21:05

奈何col 发表于 2020-10-26 22:48
免费版只有5个数据存储key,用完就不能存了。可以通过 菜单》开发者 删除之前的key ...
怎么删除呢,没有按钮操作呢。

奈何col 发表于 2020-10-27 21:16

可能是一个bug,等我们排查下

奈何col 发表于 2020-10-28 00:08

我们已经尝试修复了这个问题,您再试试呢

lslcxlsl 发表于 2020-10-28 21:27

本帖最后由 lslcxlsl 于 2020-10-28 21:29 编辑

奈何col 发表于 2020-10-28 00:08
我们已经尝试修复了这个问题,您再试试呢
已经正常了
页: [1]
查看完整版本: blinker 温度无法存储数据,附调试信息