Connect HT-M02 to a LoRa Server

简体中文

Summary

This article aims to describe how to connect HT-M02 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(4G/LTE) Quick Start document.

 

Connect to TTN

Register a LoRa gateway in TTN

Create and active an account in TTN. Select Gateway in the console page.

../../_images/0328.png

Fill in the HT-M02 information as shown below and complete the addition.

../../_images/0422.png

  • Gateway EUI – The unique ID of HT-M02 gateway;

  • I’m using the legacy packet forwarder – Must select this;

  • Frequency Plan – Must matach the LoRa band configuration in HT-M02;

  • Router – Must use the default router allocated by TTN system.

Tip

That four points are the key to success connection with TTN.

Connect to TTN

In the HT-M02 gateway, only the server address and port need to be configured.

config the server address and port in global_conf.json:

sudo nano lora/packet_forwarder/lora_pkt_fwd/global_conf.json

At the end of this file, make suitable changes:

  “server_address”: “router.cn.thethings.network”, /*The server IP address or domain*/
  “serv_port_up”: 1700,
  “serv_port_down”: 1700,

../../_images/0145.png

ctrl + O to save and ctrl + X to exit, and restart the service:

sudo systemctl restart lrgateway

Check whether the system running normally:

sudo systemctl status lrgateway

../../_images/0235.png

The TTN’s router addresses for different region:

https://www.thethingsnetwork.org/docs/gateways/packet-forwarder/semtech-udp.html#router-addresses

../../_images/0518.png

View gateway status, it is runing::

../../_images/0614.png

 

Connect to ChirpStack server

ChirpStack is the most popular LoRa server open source project, widely used in many fields, and also the best choise for a private LoRa server.

ChirpStack Gateway Bridge

One thing need attention! the ChirpStack need a special service named Gateway Bridge, which converts LoRa® Packet Forwarder protocols into a ChirpStack Network Server common data-format(JSON and Protobuf).

the Gateway Bridge service can running on the Raspberry Pi or the ChirpStack server.

Install ChirpStack Gateway Bridge: https://www.chirpstack.io/gateway-bridge/install/debian/

Register LoRa Gateway in ChirpStack

Fill in the HT-M02 information as shown below and complete the addition.

../../_images/0714.png

  • Gateway ID – The unique ID of the HT-M02 gateway.

Connect to ChirpStack server

In the HT-M02 gateway, only the server address and port need to be configured.

config the server address and port in global_conf.json:

sudo nano lora/packet_forwarder/lora_pkt_fwd/global_conf.json

At the end of this file, make suitable changes:

  “server_address”: “router.eu.thethings.network”, /*The server IP address or domain*/
  “serv_port_up”: 1700,
  “serv_port_down”: 1700,

../../_images/0145.png

ctrl + O to save and ctrl + X to exit, and restart the service:

sudo systemctl restart lrgateway

Check whether the system running normally:

sudo systemctl status lrgateway

../../_images/0235.png

View gateway status, it is runing:

../../_images/0813.png

 

Connect to HelTec server

Register LoRa Gateway in HelTec Cloud Server

Fill in the HT-M02 information as shown below and complete the addition.

../../_images/0912.png

  • Gateway ID – The unique ID of the HT-M02 gateway.

Connect to HelTec server

In the HT-M02 gateway, only the server address and port need to be configured.

config the server address and port in global_conf.json:

sudo nano lora/packet_forwarder/lora_pkt_fwd/global_conf.json

At the end of this file, make suitable changes:

  “server_address”: “cn01.cloud.heltec.cn”, /*The server IP address or domain*/
  “serv_port_up”: 1700,
  “serv_port_down”: 1700,

../../_images/0145.png

ctrl + O to save and ctrl + X to exit, and restart the service:

sudo systemctl restart lrgateway

Check whether the system running normally:

sudo systemctl status lrgateway

../../_images/0235.png

The server addresses corresponding to different regions are as follows:

CN470cn01.cloud.heltec.cn

EU868eu01.cloud.heltec.org

US915us01.cloud.heltec.org

AU915au01.cloud.heltec.org

AS923as01.cloud.heltec.org

View gateway status, it is runing:

../../_images/106.png