Heltec HT-M01 LoRa Gateway on the Things Network

gateway-outside.jpg

Setting up the Heltec HT-M01 and using it as a gateway for The Things Network (TTN)

The HT-M01 concentrator board is based on the  SX1301 baseband chip  and is available in 433MHz, 470~510MHz, 868MHz and 915MHz versions. Combined with a Raspberry Pi Zero it makes a very cost effective Lora Gateway. These are available from the Heltec store on AliExpress here . I would recommend buying one of the packages if you want to make things as easy as possible. These come with a board that connects the Pi Zero and the gateway together so you don’t need to wire them together.

Before you start it is very important to connect an antenna. If you wait until later in the tutorial and forget you could damage the gateway.

There are two parts to this guide. Connecting and setting up with the Raspberry Pi Zero and setting up a gateway account at The Things Network.

Wiring

If you don’t have the connection board, wire the Pi and HT-M01 as below:

Heltec Gateway Pi Zero Wiring

 

Pi Zero Software Installation

I prefer to access the Pi Zero via SSH. Follow the guide here:  https://robotzero.one/headless-install-raspbian-stretch-lite/ If the gateway is later installed somewhere away from a computer this will make it much easier to view the console.
Once you are logged into the Pi, type:

sudo raspi-config

Activate SPI by navigating Interfacing Options > SPI > Yes
You should probably change the password at this point as well. Reboot the Pi with

sudo reboot

Now enter the following commands one at a time:

sudo apt-get update
sudo apt-get upgrade
sudo apt-get install git
mkdir lora
cd lora
git clone https://github.com/Lora-net/lora_gateway.git
git clone https://github.com/Lora-net/packet_forwarder.git
git clone https://github.com/HelTecAutomation/lorasdk.git
cd /home/pi/lora/lora_gateway
make clean all
cd /home/pi/lora/packet_forwarder
make clean all
cd /home/pi/lora/lorasdk
chmod +x install.sh
./install.sh

Copy the Gateway ID (In Putty left mouse drag over the ID to copy to the clipboard and paste it into Notepad)

Refer to this webpage https://github.com/HelTecAutomation/lorasdk to see the global_config filenames. Use the correct one below (replace global_conf_EU868)

sudo cp -f /home/pi/lora/lorasdk/global_conf_EU868.json /home/pi/lora/packet_forwarder/lora_pkt_fwd/global_conf.json

The new global_conf file needs a few changes. To edit it type:

nano global_conf.json

At the end of the file make these changes:

“gateway_ID”: “YOUR_GATEWAY_ID”, 
“server_address”: “router.eu.thethings.network”,
“serv_port_up”: 1700,
“serv_port_down”: 1700,

The server address may vary depending on your location

To start the gateway:

cd ~/lora/packet_forwarder/lora_pkt_fwd
./lora_pkt_fwd start global_conf.json

Registering the Gateway at The Things Network

Sign up for an account here: https://account.thethingsnetwork.org/register
When you have completed account registration, go here: https://console.thethingsnetwork.org/

Follow these steps:
Click ‘Gateways’
Click ‘Register Gateway’
Tick the checkbox I’m using the legacy packet forwarder
Paste your Gateway ID (that you were given during the Raspberry Pi install above)

Register Gateway

Complete the rest of the details in the form.

Your gateway is now registered on The Things Network! If you are have nodes in range or you set up your own, you should see something like this in the Gateway Traffic section.

Gateway Traffic

References

The following pages helped me with setting up this device:
Raspberry Pi Pin Diagram – https://pinout.xyz/
Things Network forum post about the HT-M01 – https://www.thethingsnetwork.org/forum/t/heltec-ht-m01-lora-concentrator-board-for-100/13478
Manufacturer’s documents: http://www.heltec.cn/download/HT-M01%20documents%20package.zip
Manufacturer’s product page – http://www.heltec.cn/project/ht-m01-lora-gateway/
Gateway SDK on Github – https://github.com/HelTecAutomation/lorasdk

Leave a Reply

Your email address will not be published. Required fields are marked *

This site uses Akismet to reduce spam. Learn how your comment data is processed.

scroll to top