Industrial manufacturing
Industrial Internet of Things | Industrial materials | Equipment Maintenance and Repair | Industrial programming |
home  MfgRobots >> Industrial manufacturing >  >> Manufacturing Technology >> Manufacturing process

Build a LoRa Gateway with the RAK831 Module on Raspberry Pi 3 – Step‑by‑Step Guide

This guide walks you through every step to power up a RAK831 LoRa Gateway module on a Raspberry Pi 3 using Wi‑Fi as the backhaul.

Introduction

Designed for developers who want to create a custom LoRa gateway, this tutorial assumes you have basic familiarity with the Raspberry Pi ecosystem, its GPIO pins, and the Debian‑based OS that ships with it. Let’s dive in.

What is LoRa?

LoRa Alliance™ technology powers LoRaWAN™—a Low‑Power Wide‑Area Network (LPWAN) specification that supports battery‑operated IoT devices across regional, national, or global scales. LoRaWAN delivers secure, bi‑directional communication, mobility, and location services that meet the core requirements of modern IoT deployments.

The diagram above illustrates the key components of a LoRa network. Below are the most important aspects:

Key Features of LoRa Technology and the LoRaWAN Protocol

The RAK 831 is a LoRa radio front‑end. It receives incoming LoRa packets and forwards them to a host system—such as a Raspberry Pi 3—which can also instruct the RAK 831 to transmit. In this tutorial the Pi is the host board that controls the RAK 831.

Choosing the Backhaul

Backhaul refers to the Internet connection that links your Raspberry Pi to the broader network. This guide focuses on Wi‑Fi, but Ethernet or 3G/4G are viable alternatives. If an Ethernet port is available, it is preferred because it eliminates the additional radio signal inside the enclosure that can introduce noise. In noisy environments, the software can compensate, but a cleaner link always improves reliability. For Wi‑Fi, use a dongle with an external antenna and place the antenna outside the enclosure.

Setup the Hardware

Before powering on any device, configure the Raspberry Pi and the RAK 831 as follows:

Raspberry Pi

  1. Acquire a Raspberry Pi 3 and flash an 8 GB microSD card with Raspberry Pi OS (formerly Raspbian). Pre‑loaded “Noobs” cards are available, or you can follow this guide to flash the OS.
  2. Connect a 5 V, 2 A power supply. The RAK 831 can draw up to 700 mA during peak transmission, so a robust supply is essential.

RAK 831

  1. Attach the antenna that came with the kit to the screw terminal—this step is mandatory.

Connection Details

The following table shows how to wire the RAK 831 to the Raspberry Pi 3. For the Pi’s pinout, see this documentation.

Notes

Enable SPI

The SPI interface is disabled by default. Enable it via:

  1. Run sudo raspi-config.
  2. Navigate to Advanced Options → SPI and select Yes when prompted to enable SPI and load the kernel module.
  3. Finish and reboot.

After reboot, verify the interface:

> ls /dev/*spi*
/dev/spidev0.0  /dev/spidev0.1

These are the SPI devices for chip enable pins 0 and 1.

Power Supply Options

Because wireless modules often draw more power than the Pi’s supply pins can provide, you have two options:

Software Installation

On the Raspberry Pi, perform the following steps:

If you opted for remote configuration, create a JSON file named after your gateway EUI (e.g., B827EBFFFE7B80CD.json) in the gateway‑remote‑config repository. Fork the repo, add your file, commit, and submit a pull request. A sample configuration is below:

{
  "gateway_conf": {
    "gateway_ID": "your_gateway_EUI_here",
    "servers": [
      {
        "server_address": "your_router_address_here",
        "serv_port_up": 1700,
        "serv_port_down": 1700,
        "serv_enabled": true
      }
    ],
    "ref_latitude": your_latitude,
    "ref_longitude": your_longitude,
    "ref_altitude": 40,
    "contact_email": "your_email@example.com",
    "description": "short description"
  }
}

For a list of valid server addresses, see The Things Network wiki.

By default, the installer changes the Pi’s hostname to ttn-gateway to avoid collisions. You can override this if you prefer a custom name. After installation, reboot the gateway the following day to ensure the JSON file is downloaded correctly.

Adjust global_config.json as needed. For US‑based deployments, edit the file located at US‑global_conf.json. If you prefer the mp_pkt_fwd forwarder, follow the instructions at this repository and copy the updated global_conf.json to the bin folder after compilation.

Configurable Entities in global_conf.json

After installation, the file ./bin/global_conf.json contains several sections you may need to tweak:

  1. Radio settings (radio_0 or radio_1) – adjust the Frequency and min/max sweep parameters.
  2. Gateway identity – update gateway_ID or the gateway EUI.
  3. Server ports – modify serv_port_up and serv_port_down alongside your server address.

With these steps complete, your RAK 831 LoRa Gateway should be fully operational, ready to transmit and receive data over your chosen backhaul.


Manufacturing process

  1. Build an Automated Aeroponics System with Raspberry Pi and Humidity Sensor
  2. Getting Started with TJBot: Build, Configure, and Voice‑Control Your Own AI Robot
  3. Build a Low‑Cost LoRa Single‑Channel Gateway with Raspberry Pi
  4. Step-by-Step Guide to Deploy a RAK 831 LoRa Gateway on Raspberry Pi 3
  5. Build a Robot with Raspberry Pi and Python: A Complete Guide
  6. Verilog 101: Building Your First Hardware Description Modules
  7. Build Stunning Web-Driven LED Animations with Raspberry Pi & Arduino
  8. Discover the Eagle Group: Your Partner for Quality Metal Fabrication
  9. Master Permanent Mold Casting: A Beginner's Guide to Durable, High-Volume Metal Parts
  10. Deploying Node-RED on PLCnext with Docker: A Step‑by‑Step Guide