Actively Collect Temperature and Humidity through LoRa Gateway USR-LG220 and LoRa Converter USR-LG206.
1. Set node
Take the LoRa converter USR-LG206-L-C as an example. Use the serial cable to connect the RS232 interface of the LoRa terminal to the computer, and open the USR_LoRa software.（https://www.usriot.com/support/downloads/USR_LoRa_SET-V108rar.html）, Choose the LoRa converter LG206-C。
Find the corresponding serial port number and open it. The default parameters are: Baud rate 115200, no parity, 8 data bits, 1 stop bit.
Click "Enter Configuration Status" and then click "Read Parameters".
Set the application ID, channel, and rate. In the area shown below, set the application ID to 000000C9, the rate level to 5, the channel to 72, and then click "One button to set all parameters". The application ID should be consistent with the application ID set by the concentrator. The channel should be consistent with the channel set by the concentrator channel 1. The rate should be the same as the rate set by the concentrator channel 1. The application ID of the node in the Lora network of the same concentrator should be Guaranteed only. The node ID is the ID represented on the 206 label.
2. Set concentrator
（1）Use the power adapter of the concentrator to supply power to the concentrator. After the concentrator is powered on, you can use the PC or mobile phone to search for the WIFI hotspot of the concentrator. The default SSID is USR-LG220-L-xxxx, where xxxx is the last four digits of the MAC address of the concentrator.
（2）Connect to WIFI, the initial password is www.usr.cn, the connection is successful, open the browser, enter 192.168.1.1 in the address bar, press Enter to enter the login interface. Enter the password (the initial password is root) to enter the concentrator configuration web page.
（3）Enter the LG220 concentrator management interface and configure the concentrator according to the following parameters:
Ø MQTT server IP address/domain name: IP address or domain name of the server to be connected， clouddata.usriot.com
Ø MQTT server port: MQTT server port to connect to，1883
Ø MQTT device ID: MAC address of LoRa converter LG220
Ø Pub subscription theme: Setting the theme of the MQTT subscription，$USR/LoRa/DevTx/ LG220's MAC address
Ø Sub subscription theme : Set the theme of MQTT push，$USR/LoRa/DevRx/ LG220's MAC address
Ø MQTT server account: If you use “usr cloud”, please fill in the usr cloud platform account.
Ø MQTT server password: If you use “usr cloud”, please fill in the usr cloud platform password.
（If you do not have an account password, you need to register on the usr cloud platform http://console.usriot.com/index.html, please fill in the information truthfully.）
（4）Set the application ID of the concentrator, click the concentrator, basic settings, application ID, and set the application ID and lora. Finally save the settings.
The application ID is the application ID to be set before the lora node 206.
It is recommended to select the "ModbusRTU option". After selecting this option, the Modbus acquisition command sent by the cloud will be buffered into the concentrator. Then the concentrator will issue the cached instructions one by one until the device returns. For the next instruction, the polling timeout period will be automatically adjusted according to the set rate. After receiving the timeout, it will be retransmitted twice at most, so as to ensure that the packet is not hit or not lost.
(5) Set the channel and rate of the concentrator, click the concentrator in turn, set the rate and channel of channel 1 to be the same as the lora, click Save Application, the rate set in channels 2, 3, and 4 is different from the channel, and these settings are all different from channel 1.
(6) Click on the system - restart, execute the restart. After restarting, the login concentrator is in the concentrator - information can be found in the node information added.
Add device and access, log in to Usr cloud with the account and password registered in the previous step, http://console.usriot.com/index.html, click Add in Usr cloud device management, fill in the device name, and select “lora concentrator” for device type. MAC and SN fill in the MAC and SN on the LG220 body label (if there is no SN, please contact someone for technical support), fill in and click to save, as shown below:
4. Add lora terminal equipment in Usr cloud
（1）In the device management, click Add, fill in the device name, select the "lora module" for the device type, ID and SN fill in the ID and SN on the LG206 body label, and the acquisition frequency is selected according to the requirements, as shown below:
（2）Usr cloud creates data templates and associates LoRa converter LG206 devices
Add data template: Refer to the modbus standard protocol and the Usr cloud data template for specific details.
Associate the data template on the LG206 terminal device added by Usr cloud, select the LoRa converter LG206 on the Usr cloud, click Add slave, customize the slave name, fill in the modbus protocol slave address (10-digit), and click after the association is completed. save.
Use the temperature and humidity acquisition module, 5V power supply, and connect TXD, RXD, GND of LG206 equipment (take someone USR-SENS-WSD-2 as an example) as shown below:
If the experimental environment has been set up correctly according to the above description, Usr cloud will periodically collect the temperature and humidity data according to the set acquisition frequency (regular collection).
On the Usr cloud monitoring page, select the list display, select more, click Active Acquisition, the cloud will send the data collection command to the sensor device according to the modbus protocol format, and the cloud will update the collected temperature and humidity data.
On the cloud page, click on Data Management, History, and view historical data. You can also select a time range, download and save, and view specific data records.
1. This document must use LG220 V1.1.20 or higher firmware.
2. This document uses a version of Cloud V2.3.3
3. If the LG220 device purchased has no SN code, please contact someone for technical support.
4. Carefully read the sensor manual during the environment construction process, especially pay attention to the modbus device number and modbus function code register address of the transparent sensor on the cloud, otherwise it may affect the communication.