SX1302 LoRaWAN Gateway HAT

From Waveshare Wiki
Revision as of 08:21, 8 September 2021 by Waveshare-eng11 (Talk | contribs)

(diff) ← Older revision | Latest revision (diff) | Newer revision → (diff)
Jump to: navigation, search
SX1302 LoRaWAN Gateway HAT
SX1302 LoRaWAN Gateway HAT




Primary Attribute
{{{userDefinedInfo}}}: {{{userdefinedvalue}}}
Brand: Waveshare
International: Website
Chinese: 官网
Onboard Interfaces
Related Products


This is a communication HAT for Raspberry Pi with LoRaWAN protocol support, which incorporates the core LoRa gateway module SX1302 868M LoRaWAN Gateway. It has lots of advantages including long-range transmission, concurrent communication, large capacity node, and high receiving sensitivity. There are L76B GNSS module and Mini-PCIe socket on the baseboard for easy integration, along with our rich development resources, you can attach it to Raspberry Pi and build the LoRa network fast.


  • Standard Raspberry Pi 40PIN GPIO extension header, supports Raspberry Pi series boards
  • Incorporate L76B module with GPS/BD support, Gateway module for providing accurate clock and location info
  • Comes with development resources and manual (example in C)
  • Integrates Semtech SX1302 normal band and SX1250 radio RF frond-end chip, EU868 band
  • Onboard PA and LNA, features 26dBm emit power and -141dBm high sensitivity receiving gain
  • 10x signal channel supports multiple nodes concurrent communication and FEC (Forward Error Correction) algorithm
  • Supports SF5~SF12 spreading factor, 19Kbps MAX (SF5/BW125KHz) data rate
  • Utilizing SPI communication protocol and standard Mini-PCIe socket, for easy integration into sorts of embedded systems


Power supply 5V
Fequency range EU868 (863-870MHz) GPS L1 (1575.42MHz)
BD2 B1 (1561.098MHz)
Positioning accuracy - < 2.5m CEP
Modulation LoRa/(G)FSK -
Emit power > [email protected] -
Receiving sensitivity [email protected]/SF12
[email protected]/SF5
acquisition: -148dBm
tracking: -163dBm
re-acquisition: -160dBm
Overall power consumption emitting: [email protected] GPS on
receiving: [email protected] GPS on
sleep: [email protected] GPS off
Communication bus SPI, I2C UART
External connector Mini-PCIe -
Operating temperature -40~85℃
Dimensions 50.95 x 30mm



The examples here are based on the TTS ( The THINGS STACK) and the [ Semtech SX1203 libraries).
If you want to create the cloud server yourself, please refer to LoRaWan-Stack and chirpstack.

Hardware connection

Attach the LoRA HAT on the Raspberry Pi and set the GPS antenna in an open area where the sky is visible.

SX1302 LoRaWAN Gateway HAT 001.jpg

Network instructions

  • MCU runs LoRaWAN protocol and connects to Pico-LoRa-SX1262-868M as a node device (End Node), and through [https:/ / SX1302 LoRa Gateway (Gateway)] upload data to TTS server, or receive data from TTS server data, the specific network topology is as shown in the picture below

Pico-LoRa-SX1262-868M 005.jpg

  • Please select the applicable frequency band according to the local radio management regulations. Pico-LoRa-SX1262-868M is suitable for use in EU868 regional countries. The frequency band distribution diagram is as follows. For the specific table, click link view or visit LoRa Alliance

Pico-LoRa-SX1262-868M 004.jpg

Install libraries

Open the terminal of the Raspberry Pi and install libraries with the following commands:

sudo apt update
sudo apt install git
cd ~/Documents/
git clone
cd sx1302_hal
make clean all
make all
cp tools/ util_chip_id/
cp tools/ packet_forwarder/

Connect TTS

  • Sign up for a TTS account and login
  • Get the gateway EUI and add the gateway device to TTS, please choose the correct frequency according to the local area.
# get sx1302 EUI
cd ~/Documents/sx1302_hal/util_chip_id/
  • Go to the device Overview page and download the configuration file, then modify the test_conf file of sx1302_hal libraries according to the configuration file as figures
cd ~/Documents/sx1302_hal/packet_forwarder/
cp global_conf.json.sx1250.EU868 test_conf
  • Run the packet_forwarder
after running the codes, the gateway will keep connecting to the TTS
cd ~/Documents/sx1302_hal/packet_forwarder/
./lora_pkt_fwd -c test_conf


If you require technical support, please go to the Support page and open a tickets.