Blinker读取DHT11温湿度,支持小爱同学查询-Arduino中文社区 - Powered by Discuz!

Arduino中文社区

 找回密码
 立即注册

QQ登录

只需一步,快速开始

12
返回列表 发新帖
楼主: Guofuqiang01

[分享] Blinker读取DHT11温湿度,支持小爱同学查询

[复制链接]
发表于 2021-5-18 17:43 | 显示全部楼层
本帖最后由 longjunling 于 2021-5-18 17:49 编辑
17353765654 发表于 2021-5-11 17:15
你好,请问这个传感器多久传一次数据到APP呢,感觉有点慢,在哪改能加快啊 ...

串口2秒就打印一次,服务器好像30秒上传一次
发表于 2021-5-18 17:47 | 显示全部楼层
怎么能支持小度查询?
发表于 2021-5-25 20:59 | 显示全部楼层
本帖最后由 星雾 于 2021-5-25 22:39 编辑
coloz 发表于 2021-5-2 12:37
确保你使用的lib为最新

您好,现在可以在窜口里面看到湿度和温度,密匙是阿里的(这个是对的,之前是用过的)但在点灯里面连接不上。Arduino:1.8.13 (Windows 7), 开发板:"WiFiduino, 80 MHz, Flash, Legacy (new can return nullptr), All SSL ciphers (most compatible), 4MB (FS:2MB OTA:~1019KB), v2 Lower Memory, Disabled, None, Only Sketch, 921600"




















In file included from C:\Users\Administrator\Documents\Arduino\libraries\Blinker\src/BlinkerESPMQTT.h:16:0,

                 from C:\Users\Administrator\Documents\Arduino\libraries\Blinker\src/Blinker.h:36,

                 from C:\Users\Administrator\Documents\Arduino\DHT11\DHT11.ino:8:

C:\Users\Administrator\Documents\Arduino\libraries\Blinker\src/Adapters/BlinkerMQTT.h: In member function 'virtual char* BlinkerMQTT::token()':

C:\Users\Administrator\Documents\Arduino\libraries\Blinker\src/Adapters/BlinkerMQTT.h:127:50: warning: deprecated conversion from string constant to 'char*' [-Wwrite-strings]

         char * token() { if (!isMQTTinit) return ""; else return MQTT_KEY_MQTT; }

                                                  ^

In file included from C:\Users\Administrator\Documents\Arduino\libraries\Blinker\src/BlinkerESPMQTT.h:16:0,

                 from C:\Users\Administrator\Documents\Arduino\libraries\Blinker\src/Blinker.h:36,

                 from C:\Users\Administrator\Documents\Arduino\DHT11\DHT11.ino:8:

C:\Users\Administrator\Documents\Arduino\libraries\Blinker\src/Adapters/BlinkerMQTT.h: In member function 'virtual char* BlinkerMQTT::lastRead()':

C:\Users\Administrator\Documents\Arduino\libraries\Blinker\src/Adapters/BlinkerMQTT.h:923:17: warning: deprecated conversion from string constant to 'char*' [-Wwrite-strings]

     else return "";

                 ^

In file included from C:\Users\Administrator\Documents\Arduino\libraries\Blinker\src/Blinker/BlinkerApi.h:95:0,

                 from C:\Users\Administrator\Documents\Arduino\libraries\Blinker\src/BlinkerESPMQTT.h:17,

                 from C:\Users\Administrator\Documents\Arduino\libraries\Blinker\src/Blinker.h:36,

                 from C:\Users\Administrator\Documents\Arduino\DHT11\DHT11.ino:8:

C:\Users\Administrator\Documents\Arduino\libraries\Blinker\src/Blinker/BlinkerApiBase.h: In member function 'char* BlinkerBridge_key::getName()':

C:\Users\Administrator\Documents\Arduino\libraries\Blinker\src/Blinker/BlinkerApiBase.h:196:29: warning: deprecated conversion from string constant to 'char*' [-Wwrite-strings]

                 else return "false";

                             ^

In file included from C:\Users\Administrator\Documents\Arduino\libraries\Blinker\src/Blinker/BlinkerApi.h:96:0,

                 from C:\Users\Administrator\Documents\Arduino\libraries\Blinker\src/BlinkerESPMQTT.h:17,

                 from C:\Users\Administrator\Documents\Arduino\libraries\Blinker\src/Blinker.h:36,

                 from C:\Users\Administrator\Documents\Arduino\DHT11\DHT11.ino:8:

C:\Users\Administrator\Documents\Arduino\libraries\Blinker\src/Blinker/BlinkerProtocol.h: In member function 'char* BlinkerProtocol::deviceName()':

C:\Users\Administrator\Documents\Arduino\libraries\Blinker\src/Blinker/BlinkerProtocol.h:104:86: warning: deprecated conversion from string constant to 'char*' [-Wwrite-strings]

             char * deviceName() { if (isInit) return conn->deviceName(); else return ""; }

                                                                                      ^

C:\Users\Administrator\Documents\Arduino\libraries\Blinker\src/Blinker/BlinkerProtocol.h: In member function 'char* BlinkerProtocol::authKey()':

C:\Users\Administrator\Documents\Arduino\libraries\Blinker\src/Blinker/BlinkerProtocol.h:105:83: warning: deprecated conversion from string constant to 'char*' [-Wwrite-strings]

             char * authKey()    { if (isInit) return conn->authKey(); else return "";  }

                                                                                   ^

C:\Users\Administrator\Documents\Arduino\libraries\Blinker\src/Blinker/BlinkerProtocol.h: In member function 'char* BlinkerProtocol::token()':

C:\Users\Administrator\Documents\Arduino\libraries\Blinker\src/Blinker/BlinkerProtocol.h:106:79: warning: deprecated conversion from string constant to 'char*' [-Wwrite-strings]

             char * token()    { if (isInit) return conn->token(); else return "";  }

                                                                               ^

C:\Users\Administrator\Documents\Arduino\libraries\Blinker\src/Blinker/BlinkerProtocol.h: In member function 'char* BlinkerProtocol::dataParse()':

C:\Users\Administrator\Documents\Arduino\libraries\Blinker\src/Blinker/BlinkerProtocol.h:257:86: warning: deprecated conversion from string constant to 'char*' [-Wwrite-strings]

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

                                                                                      ^

In file included from C:\Users\Administrator\Documents\Arduino\libraries\Blinker\src/BlinkerESPMQTT.h:17:0,

                 from C:\Users\Administrator\Documents\Arduino\libraries\Blinker\src/Blinker.h:36,

                 from C:\Users\Administrator\Documents\Arduino\DHT11\DHT11.ino:8:

C:\Users\Administrator\Documents\Arduino\libraries\Blinker\src/Blinker/BlinkerApi.h: At global scope:

C:\Users\Administrator\Documents\Arduino\libraries\Blinker\src/Blinker/BlinkerApi.h:850:97: warning: deprecated conversion from string constant to 'char*' [-Wwrite-strings]

         BlinkerWidgets_string _BUILTIN_SWITCH = BlinkerWidgets_string(BLINKER_CMD_BUILTIN_SWITCH);

                                                                                                 ^

C:\Users\Administrator\Documents\Arduino\libraries\Blinker\src/Blinker/BlinkerApi.h: In member function 'char* BlinkerApi::bridgeKey(uint8_t)':

C:\Users\Administrator\Documents\Arduino\libraries\Blinker\src/Blinker/BlinkerApi.h:7441:21: warning: deprecated conversion from string constant to 'char*' [-Wwrite-strings]

         else return "";

                     ^

C:\Users\Administrator\Documents\Arduino\libraries\Blinker\src/Blinker/BlinkerApi.h: In member function 'char* BlinkerApi::bridgeName(uint8_t)':

C:\Users\Administrator\Documents\Arduino\libraries\Blinker\src/Blinker/BlinkerApi.h:7448:21: warning: deprecated conversion from string constant to 'char*' [-Wwrite-strings]

         else return "false";

                     ^

C:\Users\Administrator\Documents\Arduino\libraries\Blinker\src/Blinker/BlinkerApi.h: In member function 'char* BlinkerApi::widgetName_str(uint8_t)':

C:\Users\Administrator\Documents\Arduino\libraries\Blinker\src/Blinker/BlinkerApi.h:8077:17: warning: deprecated conversion from string constant to 'char*' [-Wwrite-strings]

     else return "";

                 ^

C:\Users\Administrator\Documents\Arduino\libraries\Blinker\src/Blinker/BlinkerApi.h: In member function 'char* BlinkerApi::widgetName_joy(uint8_t)':

C:\Users\Administrator\Documents\Arduino\libraries\Blinker\src/Blinker/BlinkerApi.h:8084:21: warning: deprecated conversion from string constant to 'char*' [-Wwrite-strings]

         else return "";

                     ^

C:\Users\Administrator\Documents\Arduino\libraries\Blinker\src/Blinker/BlinkerApi.h: In member function 'char* BlinkerApi::widgetName_rgb(uint8_t)':

C:\Users\Administrator\Documents\Arduino\libraries\Blinker\src/Blinker/BlinkerApi.h:8091:17: warning: deprecated conversion from string constant to 'char*' [-Wwrite-strings]

     else return "";

                 ^

C:\Users\Administrator\Documents\Arduino\libraries\Blinker\src/Blinker/BlinkerApi.h: In member function 'char* BlinkerApi::widgetName_int(uint8_t)':

C:\Users\Administrator\Documents\Arduino\libraries\Blinker\src/Blinker/BlinkerApi.h:8097:17: warning: deprecated conversion from string constant to 'char*' [-Wwrite-strings]

     else return "";

                 ^

C:\Users\Administrator\Documents\Arduino\libraries\Blinker\src/Blinker/BlinkerApi.h: In member function 'char* BlinkerApi::widgetName_tab(uint8_t)':

C:\Users\Administrator\Documents\Arduino\libraries\Blinker\src/Blinker/BlinkerApi.h:8103:17: warning: deprecated conversion from string constant to 'char*' [-Wwrite-strings]

     else return "";

                 ^

C:\Users\Administrator\Documents\Arduino\DHT11\DHT11.ino: At global scope:

C:\Users\Administrator\Documents\Arduino\DHT11\DHT11.ino:29:26: warning: deprecated conversion from string constant to 'char*' [-Wwrite-strings]

BlinkerNumber HUMI("humi");

                          ^

C:\Users\Administrator\Documents\Arduino\DHT11\DHT11.ino:30:26: warning: deprecated conversion from string constant to 'char*' [-Wwrite-strings]

BlinkerNumber TEMP("temp");

                          ^

C:\Users\Administrator\Documents\Arduino\DHT11\DHT11.ino:33:41: warning: deprecated conversion from string constant to 'char*' [-Wwrite-strings]

BlinkerButton Reset("恢复出厂设置");

                                         ^

C:\Users\Administrator\Documents\Arduino\DHT11\DHT11.ino: In function 'void dataStorage()':

C:\Users\Administrator\Documents\Arduino\DHT11\DHT11.ino:74:38: warning: deprecated conversion from string constant to 'char*' [-Wwrite-strings]

Blinker.dataStorage("temp", temp_read);

                                      ^

C:\Users\Administrator\Documents\Arduino\DHT11\DHT11.ino:75:38: warning: deprecated conversion from string constant to 'char*' [-Wwrite-strings]

Blinker.dataStorage("humi", humi_read);

                                      ^

C:\Users\Administrator\Documents\Arduino\DHT11\DHT11.ino: In function 'void setup()':

DHT11:86:33: error: no matching function for call to 'BlinkerESPMQTT::begin(char [12], char [14], char [10])'

     Blinker.begin(auth,ssid,pswd);   //代码配网用这段

                                 ^

C:\Users\Administrator\Documents\Arduino\DHT11\DHT11.ino:86:33: note: candidate is:

In file included from C:\Users\Administrator\Documents\Arduino\libraries\Blinker\src/Blinker.h:36:0,

                 from C:\Users\Administrator\Documents\Arduino\DHT11\DHT11.ino:8:

C:\Users\Administrator\Documents\Arduino\libraries\Blinker\src/BlinkerESPMQTT.h:38:14: note: void BlinkerESPMQTT::begin(const char*)

         void begin(const char* _auth)

              ^

C:\Users\Administrator\Documents\Arduino\libraries\Blinker\src/BlinkerESPMQTT.h:38:14: note:   candidate expects 1 argument, 3 provided

"Blinker.h" 对应多个库

已使用: C:\Users\Administrator\Documents\Arduino\libraries\Blinker

未使用:E:\Arduino\libraries\blinker-library-master

"DHT.h" 对应多个库

已使用: C:\Users\Administrator\Documents\Arduino\libraries\DHT_sensor_library

未使用:E:\Arduino\libraries\DHT-sensor-library-master

exit status 1

no matching function for call to 'BlinkerESPMQTT::begin(char [12], char [14], char [10])'



在文件 -> 首选项开启
“编译过程中显示详细输出”选项
这份报告会包含更多信息。

发表于 2021-5-29 20:56 | 显示全部楼层
星雾 发表于 2021-5-25 20:59
您好,现在可以在窜口里面看到湿度和温度,密匙是阿里的(这个是对的,之前是用过的)但在点灯里面连接不 ...

编译出错就是代码有问题,和你密钥无关,测试例程,并理解例程
发表于 2021-6-3 09:39 | 显示全部楼层
coloz 发表于 2021-5-29 20:56
编译出错就是代码有问题,和你密钥无关,测试例程,并理解例程

好的,我在找找问题点,谢谢大佬百忙之中帮忙解答!!!
发表于 2021-6-5 16:34 | 显示全部楼层
这里读取DHT11需要延迟 ,但是我把延迟加在loop循环里面会影响其他函数。单独写一个读取DHT11的函数也不行。就是这个延迟怎么才能不影响其他函数?
发表于 2021-7-7 08:28 | 显示全部楼层
小爱同学需要训练吗,如果不训练对小爱说什么才能查询
发表于 2021-8-11 18:17 | 显示全部楼层
BlinkerButton Reset("恢复出厂设置");这一段编译过不了
发表于 2022-1-2 14:21 | 显示全部楼层
小爱同学怎么才能播报呢
您需要登录后才可以回帖 登录 | 立即注册

本版积分规则

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

GMT+8, 2024-11-28 11:43 , Processed in 0.074429 second(s), 13 queries .

Powered by Discuz! X3.4

Copyright © 2001-2021, Tencent Cloud.

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