SX1302 LoRaWAN Gateway HAT
| ||
Introduction
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.
Features
- LoRaWAN Gateway Module features:
- Integrates Semtech SX1302/3 normal band and SX1250 radio RF frond-end chip.
- Onboard PA and LNA, features +26dBm emit power and -141dBm high sensitivity receiving gain.
- The SX1303 supports Fine Timestamp and network positioning based on the time difference of arrival (TDOA).
- 52-pin Mini-PCIe socket for easy integration into various embedded systems.
- Onboard 4 LED indicators for module operating status.
- Comes with development resources and manual (example in C).
- HAT features:
- Standard Raspberry Pi 40PIN GPIO extension header, supports Raspberry Pi series boards.
- Incorporate the L76K module with GPS/BD support, and provide accurate clock and location info for the gateway module.
- Comes with online development resources and manual (example in C).
Specification
LORA GATEWAY | GNSS MODULE | ||
---|---|---|---|
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 | > 26dBm@5V | - | |
Receiving sensitivity | -141dBm@125KHz/SF12 -121dBm@125KHz/SF5 |
acquisition: -148dBm tracking: -163dBm re-acquisition: -160dBm | |
Overall power consumption | emitting: 710mA@5V GPS on receiving: 99mA@5V GPS on sleep: 41mA@5V GPS off | ||
Communication bus | SPI, I2C | UART | |
External connector | Mini-PCIe | - | |
Operating temperature | -40~85℃ | ||
Dimensions | 50.95 x 30mm |
Pinout
LoRa & LoRaWAN
What is LoRa ?
[Semtech]'s LoRa is a long-distance, low-power wireless platform for the Internet of Things (IoT), which generally refers to radio frequency chips using LoRa technology. The main features are as follows:
- The spread spectrum modulation technology used by LoRa (abbreviation of long-range) is derived from chirp spread spectrum (CSS) technology, which is one of the long-distance wireless transmission technology and LPWAN communication technology. At present, LoRa mainly operates in the ISM frequency band, mainly including 433, 868, 915 MHz, etc.
- LoRa technology integrates technologies such as digital spread spectrum, digital signal processing, and forward error correction coding, which greatly improves the performance of long-distance communication. LoRa's link budget is better than any other standardized communication technology. The main factors that determine the distance in a given environment
- LoRa RF chips mainly include SX127X series, SX126X series, SX130X series, of which SX127X, SX126X series are used for LoRa nodes, and SX130X is used for LoRa gateways. For details, please refer to [Semtech]'s product list
What is LoRaWAN ?
- [LoRaWAN] is a low-power wide area network open protocol based on LoRa radio modulation technology. Aims to wirelessly connect battery-powered "things" to the Internet in a regional, national, or global network and targets key Internet of Things (IoT) requirements such as bi-directional communications, end-to-end security, mobility, and localized services. Node wireless connection to the Internet has access authentication, which is equivalent to the establishment of the encrypted communication channel between node and server. Access details refer to [document] and [source code]. LoRaWAN protocol level is shown in the figure below.
- The Class A/B/C node devices in the MAC layer basically cover all the application scenarios of the Internet of Things. The differences among the three nodes lie in the different time slots for receiving and receiving nodes.
- EU868 and AS430 in the Modulation layer show that frequency band parameters are different in different countries. Please click the reference [link] for regional parameters.
To achieve LoRaWAN network coverage in cities or other areas, it needs to be composed of four parts: node (LoRa node radio frequency chip), gateway (or base station, LoRa gateway radio frequency chip), server, and cloud, as shown in the following figure.
- The DEVICE (node device) needs to initiate a network access request packet to the GATEWAY (gateway) and then to the server. After the authentication is passed, it can send and receive application data with the server normally.
- GATEWAY (gateway) can communicate with the server through a wired network, 3/4/5G wireless network
- The main operators on the server side are [TTN], etc. For building cloud services by yourself, please refer to [lorawan-stack], [chirpstack]
Application
LoRa devices and networks such as LoRaWAN enable smart IoT applications to help solve the planet's formidable challenges in energy management, natural resource reduction, pollution control, infrastructure efficiency, disaster prevention, and more. Semtech's LoRa devices have achieved hundreds of successful use cases in smart cities, homes and buildings, communities, metrology, supply chain and logistics, agriculture, and more. LoRa networks have covered hundreds of millions of devices in more than 100 countries and are committed to a smarter planet.
The examples here are based on the TTS (https://eu1.cloud.thethings.network/oauth/login The THINGS STACK) and the [https://github.com/Lora-net/sx1302_hal 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.
Network Instructions
- MCU runs LoRaWAN protocol and connects to Pico-LoRa-SX1262-868M as a node device (End Node), and through SX1302 LoRa Gateway upload data to TTS server, or receive data from TTS server data, the specific network topology is as shown in the picture below:
- 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.
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 https://github.com/Lora-net/sx1302_hal.git cd sx1302_hal make clean all make all cp tools/reset_lgw.sh util_chip_id/ cp tools/reset_lgw.sh 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/ ./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
Node Access
- Please refer to Pico-LoRa-SX1262-868M.
Resource
Documents
- Schematic
- SX1302 Datasheet
- SX1303 Datasheet
- TTS document link
- LoRaWAN document link
- Quectel L76K GNSS Protocol Specification
- Quectel L76K Hardware Design
Demo codes
FAQ
{{{5}}}
Follow these steps to configure the UART: Open the /boot/config.txt file and find the following configuration statement to enable the serial port, if not, you can add it at the end of the file.
enable_uart=1
For Raspberry Pi 3B users, the serial port is used for Bluetooth and needs to be commented out:
#dtoverlay=pi3-miniuart-bt
Then reboot the Raspberry Pi:
sudo reboot
Make sure that both sides of the Raspberry Pi are handled in this way, the two modules of the A and B corresponding connection.
If you are using other 485 devices, make sure that the connection of A-A and B-B.
{{{5}}}
- Please enable the SPI of the Raspberry Pi.
- Considering the gold finger contact is poorly caused, please press down the tail and then access the test, so that the module and module good fit.
{{{5}}}
- SX1303 has lower power consumption than SX1202.
- SX1303 supports fine time stamps, which can be used for network positioning based on calculated time differences, while SX1302 does not support this function.
{{{5}}}
SX1303 supports 8-channel SF5~12 LoRa solution, SX1303 gateway supports 8-channel simultaneous reception of node data, and supports single-channel sending data to nodes.
{{{5}}}
The demo in this WIKI uses Raspberry Pi 4B and is not suitable for Raspberry Pi 5. If using Raspberry Pi 5, you need to modify the GPIO pins.
Support
Technical Support
If you need technical support or have any feedback/review, please click the Submit Now button to submit a ticket, Our support team will check and reply to you within 1 to 2 working days. Please be patient as we make every effort to help you to resolve the issue.
Working Time: 9 AM - 6 PM GMT+8 (Monday to Friday)