关于本次的树莓派的使用,想法为使用树莓派联网的方便性,将DHT11温湿度探测到的温湿度先
传到百度天工lot服务器上(MQTT服务器),然后我们可以在百度云端看到数据
Specific solutions are as follows:
First look at the use of MQTT agreement
MQTT(消息队列遥测传输)是ISO 标准(ISO/IEC PRF 20922)下基于发布/订阅范式的消息协议。
MQTT is based on a client - server message publish / subscribe transport protocol. MQTT agreement is lightweight, simple, open and easy to implement, these features make it suitable for a very wide range. In many cases, including constrained environments, such as: machine to machine (M2M) communication and Internet of Things (IoT). Communication by satellite link sensors, occasional dial-in medical,
equipment, intelligent home, and some of the smaller devices have been widely used.
So, how to achieve connection raspberry pie server and MQTT it?
Raspberry Pi to subscribe to a theme topic1, and then publish a topic2 theme
MQTT server topic2 subscribe to a theme, and then publish a topic1 theme
this time Raspberry Pi can check the information received MQTT server, but the server can MQTT Charles received information sent raspberry Pi
Thus, if the mobile terminal would like to receive information MQTT server, then the subject of mobile phone subscriptions topic1 end as long as you can check the server receives a message MQTT
Raspberry sent to the mobile phone side of the path for information:
Raspberry Pi release topic2 theme --MQTT server receives information topic2 theme of raspberry pie, and then publish topic1 theme - phone messages received topic1 theme
Raspberry Pi connected Baidu sky things work platform
1, enter the Baidu cloud website https: //cloud.baidu.com/campaign/Annualceremony-2020/index.html track = cp: nsem | pf:? Pc | pp: npinzhuan-biaoti | pu: wenzineirong | ci: 2020ndsd | kw: 2180026
click into the matter Hub access Lot
2, after establishing an account you can create a project (how to establish specific project Please inform yourself about)
the establishment of a policy (publish and subscribe using the theme) is LED_PUB, LED_SUB.
recommended the establishment of projects like I did a column in a table to record the data generated when the newly established projects, facilitate the testing and connection
3, test the connection
we use MQTT.fx client to connect Heavenly MQTT server
MQTT.fx client Download: HTTP: // mqttfx. bceapp.com/
after this time Broker Address establish good as Baidu cloud lot interface tcp: // URL back
to add a user name and password, and then fill in, is the setup is complete.
Test
the upper right corner for the green light, that is, the connection is successful
release LED_SUB, subscribe LED_SUB
received information
Past articles:
Use Raspberry Pi build a smart home of their own (a) use -DHT11 temperature and humidity sensors:
https://blog.csdn.net/qq_41744697/article/details/103907582