Description
Milesight LoRaWAN gateways support sending data packets to a third-party MQTT/HTTP/HTTPS server. We can create a new application on the gateway, which can set the decoding method of the data sent from the LoRaWAN end device and choose the HTTP(S) data transport protocol to send the data to the HTTP(s) server.
Requirement
- Milesight LoRaWAN Gateway: UG6x, UG8x
- HTTP/HTTPS Server
Configuration
Step 1. Enable the gateway's built-in network server.
Go to Packet Forwarder > General to enable the localhost server address.
Enable the network server on the Network Server > General page .
Step 2. Add an app and profiles.
Go to Network Server > Applications to add a new application, then click Save.
Name: user defined, arbitrary value
Description: User defined, arbitrary value
Payload codec: none or customize your decoder
Go to Network Server > Profiles to add a new profile, then click Save .
Name: user defined, arbitrary value
Max TXPower: default value
Other settings can be checked in the LoRaWAN node user guides or you can keep all settings as default.
Step 3. Add LoRaWAN nodes to the gateway.
Go to Network Server > Device , add a new device, click Save and Apply .
Device name: arbitrary user-defined value
Description: User defined, arbitrary value
Device Profile: Choose one of the matching profiles added before.
Application: Choose one of the matching applications added previously.
Other values can be confirmed with LoRaWAN node manufacturers.
When its status is “enabled”, it means that the above steps are carried out correctly.
Step 4. Transfer data to HTTP(s) server.
Go to Network Server > Applications to add " data transmission " for the application.
Fill in the HTTP(s) URL information for each data type, click Save .
Uplink Data: The URL address to receive all uplink data.
Membership Notification: The URL address to receive the membership notification.
ACK Notification: The URL address to receive all ACK notifications.
Error Notification: The URL to receive all error notifications.
Note: If there are user credentials when we access the HTTP(s) server, please add the HTTP header and fill in the correct account and password.
If we receive a data packet on the corresponding URL from the HTTP server like below, it means we have successfully connected to the HTTP server.
Note: The difference between transmitting data to an HTTPS server and uploading an associated gateway certification to your HTTPS server (contact Milesight to obtain certification).
FAQs
T1. Why didn't the server receive the data sent by the gateway?
A1: Go to Maintenance > Tools > Ping , confirm that the gateway can ping the HTTP address you filled in successfully as below, and then verify that all the above-filled values are correct.
Q2. How to send a decoded data packet to the HTTP/HTTPS server?
A2: Refer to How to Use Payload Codec on Milesight Gateway .