求助!数据能够传输到app端但是数据组件不能显示实时数据-Arduino中文社区 - Powered by Discuz!

Arduino中文社区

 找回密码
 立即注册

QQ登录

只需一步,快速开始

查看: 1226|回复: 2

[已解答] 求助!数据能够传输到app端但是数据组件不能显示实时数据

[复制链接]
发表于 2020-5-29 14:27 | 显示全部楼层 |阅读模式
求助!数据能够传输到app端但是数据组件不能显示实时数据 Screenshot_2020-05-29-14-25-16-150_iot.clz.me.jpg
源代码

#define BLINKER_BLE
//#define humi "NUMKey"
//#define temp "NUMKey"
#include <Blinker.h>
#include <dht11.h>
BlinkerNumber HUMI("humi");
BlinkerNumber TEMP("temp");
#define DHTPIN A5
#define DHTTYPE dht11   // DHT 11
//dht11 dht(DHTPIN, DHTTYPE);
dht11 DHT11;
double humi_read = 25, temp_read = 70;
void heartbeat()
{
    HUMI.print(humi_read);
    TEMP.print(temp_read);
}
void setup()
{
    Serial.begin(9600);
    BLINKER_DEBUG.stream(Serial);
    BLINKER_DEBUG.debugAll();
   // Blinker.attachHeartbeat(heartbeat);
    Blinker.begin(2,3,9600);
}
void loop()
{
    Blinker.run();
    DHT11.read(DHTPIN);
    double h = DHT11.humidity;
    double t = DHT11.temperature;
    if (isnan(h) || isnan(t))
    {
        BLINKER_LOG("Failed to readfrom DHT sensor!");
    }
    else
    {
        BLINKER_LOG("Humidity: ", h, " %");
        BLINKER_LOG("Temperature: ", t, " ℃");
        humi_read = h;
        temp_read = t;
    }
    Blinker.delay(20000);

}




错误信息
In file included from D:\Arduino\libraries\blinker-library-master\src/BlinkerSerialBLE.h:25:0,

                 from D:\Arduino\libraries\blinker-library-master\src/Blinker.h:21,

                 from C:\Users\Administrator\Desktop\sketch_may29a\sketch_may29a.ino:4:

D:\Arduino\libraries\blinker-library-master\src/Adapters/BlinkerSerial.h: In member function 'virtual char* BlinkerSerial::lastRead()':

D:\Arduino\libraries\blinker-library-master\src/Adapters/BlinkerSerial.h:36:75: warning: ISO C++ forbids converting a string constant to 'char*' [-Wwrite-strings]

         char * lastRead()   { if (isFresh) return streamData; else return ""; }

                                                                           ^~

In file included from D:\Arduino\libraries\blinker-library-master\src/Blinker/BlinkerApi.h:83:0,

                 from D:\Arduino\libraries\blinker-library-master\src/BlinkerSerialBLE.h:26,

                 from D:\Arduino\libraries\blinker-library-master\src/Blinker.h:21,

                 from C:\Users\Administrator\Desktop\sketch_may29a\sketch_may29a.ino:4:

D:\Arduino\libraries\blinker-library-master\src/Blinker/BlinkerProtocol.h: In member function 'char* BlinkerProtocol::dataParse()':

D:\Arduino\libraries\blinker-library-master\src/Blinker/BlinkerProtocol.h:234:86: warning: ISO C++ forbids converting a string constant to 'char*' [-Wwrite-strings]

         char* dataParse()       { if (canParse) return conn->lastRead(); else return ""; }

                                                                                      ^~

In file included from D:\Arduino\libraries\blinker-library-master\src/BlinkerSerialBLE.h:26:0,

                 from D:\Arduino\libraries\blinker-library-master\src/Blinker.h:21,

                 from C:\Users\Administrator\Desktop\sketch_may29a\sketch_may29a.ino:4:

D:\Arduino\libraries\blinker-library-master\src/Blinker/BlinkerApi.h: At global scope:

D:\Arduino\libraries\blinker-library-master\src/Blinker/BlinkerApi.h:777:97: warning: ISO C++ forbids converting a string constant to 'char*' [-Wwrite-strings]

         BlinkerWidgets_string _BUILTIN_SWITCH = BlinkerWidgets_string(BLINKER_CMD_BUILTIN_SWITCH);

                                                                                                 ^

D:\Arduino\libraries\blinker-library-master\src/Blinker/BlinkerApi.h: In member function 'char* BlinkerApi::widgetName_str(uint8_t)':

D:\Arduino\libraries\blinker-library-master\src/Blinker/BlinkerApi.h:7012:17: warning: ISO C++ forbids converting a string constant to 'char*' [-Wwrite-strings]

     else return "";

                 ^~

D:\Arduino\libraries\blinker-library-master\src/Blinker/BlinkerApi.h: In member function 'char* BlinkerApi::widgetName_joy(uint8_t)':

D:\Arduino\libraries\blinker-library-master\src/Blinker/BlinkerApi.h:7019:21: warning: ISO C++ forbids converting a string constant to 'char*' [-Wwrite-strings]

         else return "";

                     ^~

D:\Arduino\libraries\blinker-library-master\src/Blinker/BlinkerApi.h: In member function 'char* BlinkerApi::widgetName_rgb(uint8_t)':

D:\Arduino\libraries\blinker-library-master\src/Blinker/BlinkerApi.h:7026:17: warning: ISO C++ forbids converting a string constant to 'char*' [-Wwrite-strings]

     else return "";

                 ^~

D:\Arduino\libraries\blinker-library-master\src/Blinker/BlinkerApi.h: In member function 'char* BlinkerApi::widgetName_int(uint8_t)':

D:\Arduino\libraries\blinker-library-master\src/Blinker/BlinkerApi.h:7032:17: warning: ISO C++ forbids converting a string constant to 'char*' [-Wwrite-strings]

     else return "";

                 ^~

D:\Arduino\libraries\blinker-library-master\src/Blinker/BlinkerApi.h: In member function 'char* BlinkerApi::widgetName_tab(uint8_t)':

D:\Arduino\libraries\blinker-library-master\src/Blinker/BlinkerApi.h:7038:17: warning: ISO C++ forbids converting a string constant to 'char*' [-Wwrite-strings]

     else return "";

                 ^~

C:\Users\Administrator\Desktop\sketch_may29a\sketch_may29a.ino: At global scope:

C:\Users\Administrator\Desktop\sketch_may29a\sketch_may29a.ino:6:26: warning: ISO C++ forbids converting a string constant to 'char*' [-Wwrite-strings]

BlinkerNumber HUMI("humi");

                          ^

C:\Users\Administrator\Desktop\sketch_may29a\sketch_may29a.ino:7:26: warning: ISO C++ forbids converting a string constant to 'char*' [-Wwrite-strings]

BlinkerNumber TEMP("temp");

                          ^


 楼主| 发表于 2020-5-29 14:30 | 显示全部楼层
Arduino版本: UNO版
蓝牙版本:HM-10
温湿度传感器HT11
发表于 2020-5-29 20:12 | 显示全部楼层
蓝牙设备,无法上传数据到服务器
您需要登录后才可以回帖 登录 | 立即注册

本版积分规则

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

GMT+8, 2024-11-28 09:44 , Processed in 0.077472 second(s), 19 queries .

Powered by Discuz! X3.4

Copyright © 2001-2021, Tencent Cloud.

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