【Distributed temperature and humidity acquisition system】+temperature and humidity acquisition module
[Copy link]
This post was last edited by lansebuluo on 2022-9-22 09:12
After a period of getting familiar with the W800 chip configuration and demo code, I finally completed the programming and debugging of the temperature and humidity acquisition module. Now I list the functions and uses of the module below, organize the code, and then publish the source code.
The program control block diagram is as follows
Instructions
1> Click the BOOT button of the temperature and humidity collection circuit board W800WFI module to start the web configuration wifi connection network.
2> Connect the laptop to the network "softap_xxxx", enter the URL 192.168.1.1 in the web browser, open the web page, as shown below, select the network scanned by the temperature and humidity acquisition circuit board, then enter the corresponding password, and then save to complete the network configuration. The network configuration is saved in the circuit board. The next time you power on, you can directly connect to the network.
If the network configuration is successful, the following information will be displayed in the print panel:
after int io =1
AP Mode web server config mode
[WEB]SSID:xxxxxxxx
[WEB]PASSWORD:xxxxxxxx
NETIF_WIFI_JOIN_SUCCESS
sta ip: 192.168.11.221
ip: 192.168.11.221
oneshot net up, time:331170
step1: init mqtt lib.
step2: establishing TCP connection.
step3: establishing mqtt connection.
step4: subscribe mqtt
step5: start the Heart-beat preservation timer
3> After the network configuration is successful, the MQTT server will be connected and the topic to be received will be subscribed.
4> Start the data reading operation of the temperature and humidity sensor SHT20.
5> The xxxx/mqtt_rx_demo topic is published through the MQTT protocol at an interval of 1 second, and the following information is printed in the print window.
pushed: xxxx/mqtt_rx_demo <<< T=29.0,H=36.5
The data content sent by the module can be monitored through the MQTTBox software.
6> Set alarm, publish the topic "xxxx/mqtt_tx_demo", the information content is "mmmm-Tmax=xx.x,Tmin=xx.x,Hmax=xx.x,Hmin=xx.x,a,b,c,d", where mmmm is the module name (the last two digits of the WIFI MAC address), Tmax=xx.x is the set temperature upper limit, Tmin=xx.x is the set temperature lower limit, Hmax=xx.x is the set humidity upper limit, Hmin=xx.x is the set humidity lower limit, a is 1 for Tmax alarm enable, b is 1 for Tmin alarm enable, c is 1 for Hmax alarm enable, d is 1 for Hmin alarm enable. The set information is also saved in the circuit board.
Alarm settings can be sent through MQTTBox software.
|