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

4 Replies to “Heltec HT-M01 LoRa Gateway on the Things Network”

  1. Timo says:

    Hey,

    have you made any experiences with the maximum range of the cell?
    I want to use the TTN for my sensors, but so far there are no gateways in my region.
    So I would like to know if I could reach them with a gateway placed at home.
    As node I would use the Heltec Wifi LoRa ESP32 DevKit.

    Best regards, Timo.

    1. WordBot says:

      Hi, It’s on my list to do another project with the gateway and some nodes to test distances. What range do you need?

      1. Timo says:

        It’s about 5km. But there is a slag heap right in the crow.
        The information Heltec is giving are not really precise.
        Thought you may have geathered some information with field tests.
        They talk about 17km range, but who knows under wich conditions…

        Would you recommend the HT-M01 as GW for TTN so far?
        I think then I just would buy it to do some tests and geather experiences with LoRa.

        1. WordBot says:

          I guess as with all radio technology there are so many variables that can affect range and signal quality it’s not possible to give an accurate range. I’ve only briefly tested the HT-M01 but it seems to work well.

          Probably one of those things that you won’t know for sure until you try it.

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