|
本帖最后由 lslcxlsl 于 2020-10-26 22:43 编辑
600008] message: /heartbeat?deviceName=ACC2534CLMGA6R6OI7KJAC0U&key=a9135b780e41&heartbeat=600
[600009] blinker server begin
[600009] Freeheap: 29488
[601055] HTTPS begin: https://iot.diandeng.tech/api/v1/user/device/heartbeat?deviceName=ACC2534CLMGA6R6OI7KJAC0U&key=a9135b780e41&heartbeat=600
[601057] HTTPS payload: /heartbeat?deviceName=ACC2534CLMGA6R6OI7KJAC0U&key=a9135b780e41&heartbeat=600
[601066] [HTTP] status... code: 200
[601070] {"detail": "", "message": 1000}
[601073] payload: null
[601077] checkNum count: 2
[601077] time (millis() - ntpFreshTime): 120852
[601081] ntpGetTime: 1603720975
[601084] 0
[601085] time: 1603721096,second: 56
[601088] now_time: 1603721040
[601091] dataStorage num: 0 ,1603721040
[601095] dataStorage count: 2
[601097] saveData: 21.00
[601100] saveData dataCount: 2
[601102] temp save: 21.00 time: 1603721040
[601106] data_dataCount: 2
[601109] checkNum count: 2
[601111] time: 1603721096,second: 56
[601114] now_time: 1603721040
[601117] dataStorage num: 1 ,1603721040
[601121] dataStorage count: 2
[601123] saveData: 42.00
[601126] saveData dataCount: 2
[601128] humi save: 42.00 time: 1603721040
[601132] data_dataCount: 2
[601135] Connecting to MQTT...
[602253] MQTT Connected!
[602253] Freeheap: 8864
[602299] Humidity: 42.00 %
[602299] Temperature: 21.00 *C
[604350] Humidity: 42.00 %
[604350] Temperature: 21.00 *C
[604822] Freeheap: 8776
[604823] getData _data_: [[1603720980,21.00],[1603721040,21.00]]
[604823] num: 0 name: temp
[604823] Freeheap: 8728
[604824] getData _data_: [[1603720980,42.00],[1603721040,42.00]]
[604829] num: 1 name: humi
[604832] Freeheap: 8680
[604834] dataUpdate: {"deviceName":"ACC2534CLMGA6R6OI7KJAC0U","key":"a9135b780e41","data":{"temp":[[1603720980,21.00],[1603721040,21.00]],"humi":[[1603720980,42.00],[1603721040,42.00]]}}
[604850] Freeheap: 8680
[604852] message: {"deviceName":"ACC2534CLMGA6R6OI7KJAC0U","key":"a9135b780e41","data":{"temp":[[1603720980,21.00],[1603721040,21.00]],"humi":[[1603720980,42.00],[1603721040,42.00]]}}
[604871] blinker server begin
[604871] Freeheap: 29008
[605989] HTTPS begin: https://iot.diandeng.tech/api/v1/user/device/cloudStorage/
[605989] HTTPS payload: {"deviceName":"ACC2534CLMGA6R6OI7KJAC0U","key":"a9135b780e41","data":{"temp":[[1603720980,21.00],[1603721040,21.00]],"humi":[[1603720980,42.00],[1603721040,42.00]]}}
[606002] [HTTP] status... code: 200
[606007] {"detail": "max device data key size limit", "message": 1513}
[606011] ERROR: max device data key size limit
[606015] payload: {"detail": "max device data key size limit", "message": 1513}
[606375] Humidity: 42.00 %
[483754] getData _data_: [[1603723200,21],[1603723260,21]]
[483754] num: 0 name: temp
[483754] Freeheap: 8864
[483755] getData _data_: [[1603723200,41],[1603723260,41]]
[483759] num: 1 name: humi
[483762] Freeheap: 8816
[483764] dataUpdate: {"deviceName":"ACC2534CLMGA6R6OI7KJAC0U","key":"a9135b780e41","data":{"temp":[[1603723200,21],[1603723260,21]],"humi":[[1603723200,41],[1603723260,41]]}}
[483779] Freeheap: 8816
[483781] message: {"deviceName":"ACC2534CLMGA6R6OI7KJAC0U","key":"a9135b780e41","data":{"temp":[[1603723200,21],[1603723260,21]],"humi":[[1603723200,41],[1603723260,41]]}}
[483799] blinker server begin
[483799] Freeheap: 29144
[484918] HTTPS begin: https://iot.diandeng.tech/api/v1/user/device/cloudStorage/
[484918] HTTPS payload: {"deviceName":"ACC2534CLMGA6R6OI7KJAC0U","key":"a9135b780e41","data":{"temp":[[1603723200,21],[1603723260,21]],"humi":[[1603723200,41],[1603723260,41]]}}
[484929] [HTTP] status... code: 200
[484934] {"detail": "max device data key size limit", "message": 1513}
[484939] ERROR: max device data key size limit
[484943] 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);
- }
复制代码
|
|