How to build a LoRa gateway using Raspberry Pi (2024)

As its name suggests, long-range wide-area network or LoRaWAN technology is widely used for long-range, low-power communication in Internet-of-things (IoT) applications.

In this article, we’ll guide you through the process of connecting an SX130x 868M LoRaWAN Gateway Module to a Raspberry Pi 4 using hardware attached on top (HAT). This setup creates a LoRaWAN gateway, allowing Raspberry Pi (RPi) to communicate with LoRaWAN-enabled devices.

What’s required

  • Raspberry Pi 4 (Model B or higher is recommended) –link
  • The SX130x 868M LoRaWAN Gateway Module – link
  • A LoRa antenna that’s compatible with the module – and comes with SX1302
  • A MicroSD card with Raspbian OS installed (instructions below) – 32 GB
  • An SD card reader
  • Power supply for Raspberry Pi – Link
  • An Internet connection

Step 1. Gather the hardware
Before starting, You’ll need all required hardware components, including Raspberry Pi 4, the SX130x 868M LoRaWAN Gateway Module, a LoRa antenna, and a functional MicroSD card with Raspbian OS.

Step 2. Assemble the hardware
Insert the MicroSD card into Raspberry Pi (after RPi is installed — see Step 3 for instructions)

Attach the SX130x LoRaWAN Gateway Module to Raspberry Pi’s GPIO pins. Make sure the pins align correctly and the module is securely attached. It’s a HAT, so it should fit perfectly.

Figure 1. The assembled hardware between the SX130x LoRaWAN Gateway Module and the Raspberry Pi’s GPIO pins.

Step 3. Install Raspberry Pi with OS
Install Raspberry Pi Imager Software by usingthis linkto download the software for installation on Windows.

Figure 2. The Raspberry Pi Imager Software

Click on ‘CHOOSE OS.’

Figure 3. Select ‘OS’ from the Imager Software.

Choose the OS Lite version (32-bit), and then choose the Storage Device option in the next step.

Figure 4. Select the Storage Device option.

Next, insert the SD card into your computer using the SD card reader. Select the displayed SD card. Be sure to click on the gear icon before clicking on the ‘Write’ button.

Figure 5. Use the gear button to change the Wi-Fi setting and other options. Then, click on the ‘Write’ image.

Now, change the settings to Wi-Fi and other options. Then, click on ‘Enable SSH’ and set your username and password. Click on the ‘Configure wireless LAN,’ and enter your Wi-Fi’s SSID and password. This allows RPi to boot without connecting it to a desktop screen.

Figure 6. Add your Wi-Fi’s SSID and password.

Click on the ‘Save’ and then the ‘Write’ buttons. Wait for the process to complete, and once finished, remove the SD card from your current device and insert it into Raspberry Pi.

Step 4. Connect Raspberry Pi using SSH
After assembling and inserting the SD card, power on the Raspberry Pi. Follow the following instructions to establish an SSH connection.

Figure 7. The power is on after connecting RPi using SSH.

Determining the IP address of the RPi is necessary for establishing a connection. To do so, download the Angry IP Scanner: link

Figure 8. The Angry IP software.

After clicking on ‘Start,’ the below screen will appear. Once the process is complete, locate the IP address with the host name “Raspberry pi.” You can also find the proper information in the DHCP section of your router’s configuration page.

Figure 9. The IP scanning process.

In our case, the IP address is 192.168.1.4. However, in your case, it will be different. Next, download the software bitvise ssh: link

Launch the software and login to the IP address using the username and password set during the SD card flashing process.

Figure 10. The process of moving SSH into RPi.

Click on the ‘New Terminal Console.’

Figure 11. Click on the ‘New Terminal Console.’

Afterward, you’ll be presented with the follow screen.

Figure 12. The ‘Terminal’ screen after logging in.

We’ve successfully established an SSH connection with Raspberry Pi.

Step 5. Configure RPi
Enable the SPI, Serial, and I2C using this command: “Raspi-config”

Figure 13. The ‘System Options’ window for configuring RPi.

Go to the ‘System Options’ and enable the SPI, Serial, and I2C.

Figure 14. Configure RPi by enabling SPI, I2C, and Serial on the interface window.

Click ‘Yes.’

Figure 15. Click ‘Yes’ for all three options.

It will then ask to reboot.

Step 6. Connecting SX1302
Install the SX1302 binaries for the gateway by following these steps:

  • sudo apt update
  • sudo apt install git
  • cd
  • 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/

Next, it’s necessary to verify if the hardware is properly connected.

  • Cd sx1302_hal/util_chip_id/- ./chip_id

Once there’s an established connection with the hardware, you’ll observe output similar to this…

Figure 16. The ‘Get Chip ID’ command.

Your EUI ID is the gateway’s MAC address, so be sure to make a note of it. Initiate the LoRa concentrator shield using this command, providing any configuration file from the folder.

  • cd sx1302_hal/packet_forwarder/-
  • ./lora_pkt_fwd -c global_conf.json.sx1250.EU868

A successful connection to the LoRa concentrator will look similar to this:

Figure 17. The gateway is UP and a connection is successfully established to the LoRa concentrator

At this point, any data sent over the EU868 profile will be received by this screen.

Conclusion
Sending data through this gateway will enable data reception. The next step involves connecting to, configuring, and managing the gateway using Chirpstack.

You may also like:

  • Understanding LoRa architecture: nodes, gateways, and servers
  • What is Chirpstack?
  • How communication works between two LoRa end-node devices
  • How to integrate modules and smart meters with LoRa node-to-gateway…
  • How LoRa enables long-range communication
  • What is LoRa and LoRaWAN?
  • What are LoRa gateways and what types are available?
  • How does LoRa modulation enable long-range communication?

Filed Under: Tutorials
Tagged With: antenna, chirpstack, concentrator, gateway, lora, lorawan, nodes, raspberrypi, raspberrypi4, rpi, sx130x

How to build a LoRa gateway using Raspberry Pi (2024)

References

Top Articles
27 Best Authentic Austria Food & Austrian Recipes In 2024
Rotkohl (German Red Cabbage Recipe with Bacon)
Chs.mywork
Woodward Avenue (M-1) - Automotive Heritage Trail - National Scenic Byway Foundation
Ets Lake Fork Fishing Report
San Diego Terminal 2 Parking Promo Code
Nesb Routing Number
Okatee River Farms
Steve Strange - From Punk To New Romantic
Bubbles Hair Salon Woodbridge Va
Natureza e Qualidade de Produtos - Gestão da Qualidade
Hope Swinimer Net Worth
Gfs Rivergate
California Department of Public Health
Mephisto Summoners War
Bad Moms 123Movies
Khiara Keating: Manchester City and England goalkeeper convinced WSL silverware is on the horizon
Is The Yankees Game Postponed Tonight
Team C Lakewood
Nz Herald Obituary Notices
Unionjobsclearinghouse
Masterkyngmash
Putin advierte que si se permite a Ucrania usar misiles de largo alcance, los países de la OTAN estarán en guerra con Rusia - BBC News Mundo
Craigslist Northfield Vt
THE FINALS Best Settings and Options Guide
Dhs Clio Rd Flint Mi Phone Number
Jackass Golf Cart Gif
Gt7 Roadster Shop Rampage Engine Swap
*!Good Night (2024) 𝙵ull𝙼ovie Downl𝚘ad Fr𝚎e 1080𝚙, 720𝚙, 480𝚙 H𝙳 HI𝙽DI Dub𝚋ed Fil𝙼yz𝚒lla Isaidub
The Latest: Trump addresses apparent assassination attempt on X
Boneyard Barbers
Rock Salt Font Free by Sideshow » Font Squirrel
Japanese Pokémon Cards vs English Pokémon Cards
Plato's Closet Mansfield Ohio
Tamilrockers Movies 2023 Download
How does paysafecard work? The only guide you need
Today's Final Jeopardy Clue
Die Filmstarts-Kritik zu The Boogeyman
Hell's Kitchen Valley Center Photos Menu
159R Bus Schedule Pdf
Noaa Marine Weather Forecast By Zone
Nail Salon Open On Monday Near Me
Noh Buddy
Sky Dental Cartersville
Minterns German Shepherds
Minute Clinic Mooresville Nc
Makemkv Key April 2023
Fredatmcd.read.inkling.com
Lake County Fl Trash Pickup Schedule
Gameplay Clarkston
32 Easy Recipes That Start with Frozen Berries
Latest Posts
Article information

Author: Msgr. Benton Quitzon

Last Updated:

Views: 5329

Rating: 4.2 / 5 (43 voted)

Reviews: 82% of readers found this page helpful

Author information

Name: Msgr. Benton Quitzon

Birthday: 2001-08-13

Address: 96487 Kris Cliff, Teresiafurt, WI 95201

Phone: +9418513585781

Job: Senior Designer

Hobby: Calligraphy, Rowing, Vacation, Geocaching, Web surfing, Electronics, Electronics

Introduction: My name is Msgr. Benton Quitzon, I am a comfortable, charming, thankful, happy, adventurous, handsome, precious person who loves writing and wants to share my knowledge and understanding with you.