Connect to ChirpStack
Summary
This article aims to describe how to connect HT-M02_V2 Gateway to a LoRa server, such as TTN, ChirpStack, which facilitates secondary development and rapid deployment of LoRa devices.
Before all operation, make sure the HT-M02 is runing well . If not, please refer to this HT-M02_V2 Quick Start document.
1.Deploy the ChirpStack Server
2.Register LoRa Gateway in ChirpStack
After logging into the ChirpStack console, follow the steps below to add a gateway.


- Name: Can be set arbitrarily
- Description: Optional
- Gateway ID: Enter the unique identifier of the gateway (must match the gateway configuration)
After completing the configuration, click Submit.
3.Configure the Gateway
Connect the gateway to the network. Please refer to this operation document for detailed steps. Once completed, configure the gateway in the “HT-M02 Config” interface according to the interface shown below.
- Mesh Mode
- UDP Packet Forwarder
- Basic Station
In the ChirpStack Mesh network architecture, gateways are no longer single-point receiving devices. Instead, at least two gateway roles are required and work together to enable longer-range and more flexible LoRa data forwarding capabilities.
The core concept of the system is: Mesh Gateway are responsible for extending network coverage through multi-hop LoRa forwarding between gateways, while Border Gateway are responsible for connecting to the server. Mesh Gateways do not communicate directly with the server; instead, all uplink data is ultimately aggregated by the Border Gateway and forwarded to the ChirpStack server via IP networks.

Mesh Gateway
Does not require an internet connection. It only forwards LoRa signals and does not connect directly to the server.

- Protocal: Chirpstack Mesh
- Mesh Mode: Mesh Gateway
- Region: Select the frequency plan that matches your device
- Max Hop: 2 (defines the maximum number of hops allowed; must match the Mesh Gateway configuration)
- Mesh SF: 7 (used for long-range communication scenarios; must match the Mesh Gateway configuration)
- Mesh Root Key: Enter a 32-character HEX value (network encryption key; must be identical to the Border Gateway)
After completing the configuration, click Apply.
Border Gateway
Requires an internet connection. It can directly receive data from end devices and forward it to the server, as well as receive data from Mesh gateways and relay it to the server.

- Protocal: Chirpstack Mesh
- Mesh Mode: Border Gateway
- MQTT Address:
tcp://xxx.xxx.x.xxx:1883
xxx.xxx.x.xxx is the ChirpStack server address.
For example, if the ChirpStack server address is 192.168.10.49, then the MQTT Address should be set to: tcp://192.168.10.48:1883.
- MQTT Username: Leave blank (or enter the username provided by the ChirpStack/MQTT server)
- MQTT Password: Leave blank (or enter the corresponding password)
- MQTT Password Repeat: Same as the MQTT password
- Region: Select the frequency plan that matches your device
- Max Hop: 2 (defines the maximum number of hops allowed; must match the Mesh Gateway configuration)
- Mesh SF: 7 (used for long-range communication scenarios; must match the Mesh Gateway configuration)
- Mesh Root Key: Enter a 32-character HEX value (network encryption key; must be identical to the Mesh Gateway)
After completing the configuration, click Apply.
Once all configurations are completed, the device will appear online on the server if configured correctly, indicating that the connection has been successfully established.

Mesh gateways typically allow direct viewing of connected device status within their individual Gateway pages. In contrast, Border gateways, acting as aggregation and uplink nodes, are usually managed through the Gateway Mesh unified view, where device status is monitored centrally.

- Protocal: UDP Packet Forwarder
- Region: Select the frequency plan that matches your device
- Server Address: ChirpStack server address
- Uplink Port: 1700
- Downlinklink Port: 1700
After completing the configuration, click Apply.
Once all configurations are completed, the device will appear online on the server if configured correctly, indicating that the connection has been successfully established.


- Protocal: Basic Station
- Server Type: LNS Server
- Server Url: ws://xxx.xxx.x.xxx
xxx.xxx.x.xxx is the ChirpStack server address. For example, if the ChirpStack server address is 192.168.10.49, then the Server Url should be set to: ws://192.168.10.48.
- Server Port: 3001
- Authentication Mode: None
After completing the configuration, click Apply.
Once all configurations are completed, the device will appear online on the server if configured correctly, indicating that the connection has been successfully established.
