Setting up a private LoRaWAN network with WisGate Connect gateway

In this guide, we’ll explain how to set up a private LoRaWAN network using the Raspberry Pi CM4-based RAKwireless’ WisGate Connect gateway and Docker or Portainer to install NodeRED, InfluxDB, Grafana, and other packages required to configure our gateway.

The WisGate Connect is quite a versatile gateway with Gigabit and 2.5Gbps Ethernet plus several optional wireless connectivity options such as LoRaWAN, 4G LTE, 5G, WiFi 6, Zigbee, WiFi HaLoW, and more that can be added through Mini PCIe or M.2 sockets, expansion through WisBlock IO connectors and a 40-pin Raspberry Pi HAT connector. We’ll start by looking at the gateway features in detail, but if you already know all that, you can jump to the private LoRaWAN network configuration section.

WisGate Connect unboxing, specifications, and teardown

Wisgate Connect Gateway Private LoRaWAN network

RAKwireless sent us a model with a Raspberry Pi CM4 equipped with 4 GB of RAM and 32 GB of eMMC memory, GPS and LoRa antennas, as well as an indoor metal enclosure.

Wisgate Connect Gateway Unboxing

The kit also includes a power supply and various cables.

RAK Wisgate Connect ports SIM card slots

The front panel of the gateway comes with an OLED display. three SIM card slots, GPS and LoRa antenna connectors, and a microSD card slot.  They are also two more antenna holes that are not used in our model configuration.

RAK Wisgate Connect Ethernet USB Power

The rear panel features two power input ports (a 2-pin terminal block and DC jack), a UART header, some LEDs, HDMI video output, Gigabit Ethernet and 2.5GbE ports, a USB-C port for flashing the firmware to the Raspberry Pi CM4 module, and three USB 3.0 ports, plus two more antenna holes that are not used here.

RAK Wisgate Connect carrier board Raspberry Pi CM4

A teardown of the gateway shows the Raspberry Pi CM4 and LoRa module, plus all the expansion options with two extra mini PCIe sockets, two WisBlock slots, some space for an internal Raspberry Pi HAT, optional PoE HAT support, and more.

Here’s a reminder of WisGate Connect (RAK7391) main board specifications:

  • SoM – Raspberry Pi CM4 with Broadcom BCM2711 quad-core Cortex-A72 processor @ 1.5GHz, 1 to 8Gb DDR4, optional 8 to 32GB eMMC flash, optional WiFi 5 and Bluetooth 5.0 LE
  • Storage – MicroSD card socket for CM4 Lite modules only
  • Video Output – HDMI 2.0 up to 4Kp60, 22-pin MIPI DSI connector
  • Camera I/F – 2x 22-pin MIPI CSI connectors
  • Networking
    • Wired – Gigabit Ethernet RJ45 port with PoE support, 2.5GbE RJ45 port
    • Optional 802.11 b/g/n/ac/ax WiFi 6 and BLE 5.0 on RPi CM4 module
    • Optional LoRaWAN, 4G LTE, 5G, WiFi 6, Zigbee, WiFi HaLoW, etc… via mini PCIe sockets, M.2 socket, and/or Raspberry Pi header
  • USB – 2x USB 3.0 ports, 1x USB 2.0 port, 1x USB Type-C port for updating RPi CM4 firmware
  • Expansion
    • 40-pin Raspberry Pi-compatible header
    • 3x Mini PCIe sockets
    • 1x M.2 B-key sockets
    • 2x WisBlock IO connectors
  • Misc – Onboard RTC with battery socket, temperature monitor, buzzer, 12V/5V fan controller, voltage monitor, jumpers for configuration
  • Power Supply
    • Input
      • 10-28V DC via Phoenix connector)
      • IEEE 802.3at/bt active PoE
    • 5V/12V power out for peripherals
  • Dimensions – PCB: 170 x 170 mm (Mini-ITX standard form factor)
  • Weight – 212 grams
  • Temperature Range – -20ºC to 85ºC (except for USB 3.0 and buzzer which are rated 0ºC-70ºC)

 

Wisgate Connect Block Diagram
Wisgate Connect Block Diagram

 

Hardware compatibility and software architecture

RAKwirelss installed a RAK5146 LoRaWAN module, an OLED display, and a Raspberry Pi Compute Module 4 in the model we received, but the gateway can be extended with any of the hardware modules and accessories shown in the table below.

Wisgate WisConnect hardware compatibility list

The software architecture of the gateway shows docker support, and that’s what we’ll use to set up a private LoRaWAN network.

WisGate software architecture

Connecting to WisGate Connect  RAKPiOS with Secure Shell (SSH)

There are two ways to connect to the WisGate Connect gateway:

  1. Via one of its RJ45 Ethernet port
  2. Via a WiFi access point

We’ll go with the second option. Connect to the “RAK_1D4F“ access point from your host with the password “rakwireless”. In Windows, you’ll have to click on “Connect using a security key instead” first before enting the password.

Windows 11 connect using a security key

The IP address for the vlan0 interface should now show on the gateway’s OLED screen. We can use this IP address to connect to the gateway via SSH using port 22. We ran Putty in Windows, but you can select other SSH-capable programs as well.

Wisgate Connect SSH

We can now access the shell from RAKPiOS using username “rak” and password “changeme”, which we will be asked to change the first time we connect.

RAKPiOS shell

We can find some more details about RAKPiOS with the command:


RAKPiOS Debian 11

If you want to have a close look at the code for the OS you can do so on GitHub.

Setting up a Private LoRaWAN network with Wisgate Connect

Method 1: Command line installation with Docker

RAKwireless provides six Docker compose examples for deployment on the WisGate Connect RAK7391 gateway.

  1. Dual_Band_LoRaWAN_Gateway – A fully standalone gateway with support for sub-GHz and 2.4 GHz LoRaWAN concentrators, TailScale for remote access, and The Things Stack LNS.
  2. MQTT_to_ModBUS_bridge – ModBUS to MQTT bridge using RAK8802 WisBlock RS485 module, and Node-RED.
  3. Node-RED – Custom Node-RED service with support for all WisBlock modules
  4. Standalone_LoRaWAN_Gateway – Standalone LoRaWAN gateway with UDP packet forwarder, The Things Stack LNS, Node-RED, InfluxDB, and Grafana.
  5. Standalone_LoRaWAN_Gateway_TagoCore – Standalone LoRaWAN gateway with UDP packet forwarder, The Things Stack LNS and TagoCore.
  6. WiFi-HaLow – Gateway with support for AHPI7292S Wi-Fi HaLow module.

We’ll use the Standalone_LoRaWAN_Gateway example in this example since it must closely matches our requirements.


We will need to modify “docker-compose.yml” and modify it to match our gateway settings (e.g. EUI) and options (e.g. RAK5146 module).


We can now deploy our containers with Docker:


Docker private LoRaWAN gateway deployment

We now have 7 containers running on the gateway:

  • dp-packet-forwarder – Interacts with the LoRa chip to receive and transfer LoRa packets.
  • Stack – A LoRaWAN Network Server provided by The Things Stack and used in conjunction with Redis and Postgres services in order to enable connectivity, management, and monitoring of end-user devices, gateways, and applications.
  • Redis – Primary storage for the Network Server, Application Server, and Join Server. It is also used by the Identity Server and event systems.
  • Postgres – Another database needed by The Things Stack.
  • Node-RED with an initial flow that subscribes to uplink data from The Things Stack with the MQTT protocol and stores data into an InfluxDB database called Sensors.
  • InfluxDB – Time-series database for Node-RED to record data obtained from sensors.
  • Grafana – Visualize data from the InfluxDB database in various formats such as graphs, gauges, and charts.

This method is mainly suitable for people familiar with Docker’s command line (docker compose) and YAML configuration.

Wisgate Connect docker command line

Here’s an example of using our private LoRaWAN Network Server with The Things Stack which we can access with the IP address of the gateway.

Private LoRaWAN Gateway The Things Stack

After logging to the interface, we can register the gateway with The Things Network and share it with others if we wish to.

Wisgate Connect Gateway Add to The Things Network

 

Method 2 – Installation via Portainer Local

If using the command line is not your cup of tea, RAKwirless provides a web page interface to enable containers through the Portainer template for RAK7391. You’ll still need to access the gateway through SSH, but only one command is needed:


Wisgate Connect portainer

From there, we can copy the URL provided in the shell (e.g. https://10.249.198.174:9443) and paste it into our favorite browser. Our testing was done in Chrome on Windows.

portainer login prompt

We can log in with the “admin” username and “changeme” password which we’ll be asked to change to one with at least 12 characters.

portainer user settings

Now we can go to the Settings page to add the URL “https://raw.githubusercontent.com/RAKWireless/portainer-templates/master/portainer_app_template.json” to the “App Template” field.

Portainer app template

A new App Template menu will appear and show a list of Docker Containers with 35 Application Templates such as LoRaWAN Network Server, Scada, OPC-UA Server, PLC, Home Assistant, Zigbee, Database, Dashboards, and more, as shown in the picture below.

Wisgate Connect Portainer App Templates

Portainer Tailscale

Portainer Home Assistant

Portainer OPC UA server

Portainer RabbitMQ

In the following steps, we use Portainer to build a Private LoRaWAN platform running on the WisGate Connect gateway with UDP Packet Forwarder, ChirpStack, Node-RED, InfluxDB, and Grafana.

Installation and configuration of the UDP Packet Forwarder container

The udp-packet-forwarder interacts with the LoRa chip to receive and transfer LoRa packets. You can find more details on GitHub.


 

Portainer UDP Packet Forwarder configuration

Portainer UDP Packet Forwarder AS923 Thailand

ChirpStack Network Server deployment

ChirpStack LoRaWAN Network Server will be used in conjunction with MQTT Mosquitto, Redis, and Postgres services to enable connectivity, management, and monitoring of end-user devices, gateways, and applications.


ChipStark configuration

ChirpStack’s default username and password are both “admin”. A total of 6 Docker container stacks will be installed in the following order:

  1. chirpstack-gateway-bridge-1
  2. chirpstack-network-server-1
  3. chirpstack-application-server-1
  4. chirpstack-mosquitto-1
  5. chirpstack-redis-1
  6. chirpstack-postgresql-1

Node-Red installation and deployment

Node-RED will be configured to subscribe to the uplink data from ChirpStack using the MQTT protocol and decrypt the data in the payload (Base64 algorithm), and store it into the InfluxDB database or validate the data to alert via LINE Notify.

InfluxDB configuration

InfluxDB time-series database enables Node-RED to record data obtained from sensors. Again, only the time zone needs to be modified.


Portainer InfluxDB

Before using InfluxDB, you’ll need to open the container console to create a database as follows:

Grafana installation

Grafana will visualize the data from the InfluxDB in various formats such as graphs, gauges, charts, etc. There’s only one parameter to change in Portainer before deploying the container:


Grafana Portainer

We now have the following Docker Containers and Stacks installed and up and running at all times.

Portainer private LoRaWAN gateway container list

Private LoRaWAN network IoT platform test

We now have the same private LoRaWAN IoT platform that Ninephon used in previous reviews, except the gateway is a more powerful Wisgate Connect from RAKWireless that replaces a Dragino LG308 with a 400 MHz MIPS processor. The Link.ONE development kit will be used as a LoRa node for testing our private LoRaWAN network.

Private LoRaWAN IoT Platform Wisgate Connect Gateway

ChirkStack configuration

We’ll now need to access the ChirpStack Network Server by going to http://<IP.address>:8080 and log in with admin/admin default username and password, and change the password after the first login.

ChirpStack gateway configuration

We can now go to the Gateways section and add RAKwireless RAK7391 WisGate Connect to ChirpStack.

chirpstack add gateway

We can see the list of received packets within the radius of the gateway in the “LIVE LORAWAN FRAMES” tab.

chirpstack live lorawan frames

Let’s now create an application called “RAKWireless” in the Applications menu.

chirpstack applications

We will now create a new device named LinkONE within the “RAKwireless” application using the Device EUI 88 88 88 88 88 88 33 33.

chirpstack add device Link.ONE

We’ll use an OTAA (Over The Air Activation) key entering 88 88 88 88 88 88 88 88 88 88 88 88 88 88 88 88 in the Application key field before clicking on the SET DEVICE-KEYS button.

ChirpStack LoRaWAN application key

The Link.ONE LoRaWAN Sensor Node Device was programmed in the Arduino IDE to read battery status every minute and encode the data with Base64 before sending a packet to the LoRaWAN gateway.

ChirpStack Link.ONE devkit battery status

If you are interested in finding out more about the Link.ONE devkit, you can read our review “Using Link.ONE all-in-one LPWAN development kit with ChipStark, Node-Red, InfluxDB, and Grafana” for details.

Node-RED configuration

The Node-RED web interface can be accessed by going to http://<IP.address>:1880 and we’ll use Flow Nodes such as MQTT in, Function, InfluxDB out, HTTP Request and others that RAKwireless has installed to support devices such as WisBlock Module, ModBus, etc…

Link.ONE Node-RED

Node-RED will automatically store sensor and LoRaWAN system data into the InfluxDB time-series database, and if the battery level is low (< 3.3V) send a notification to our smartphone through the LINE Notify API.

InfluxDB battery level LoRaWAN data
InfluxDB data visualized with DBeaver Ultimate 22.2.0

Setting up Grafana for visualization of the data

You can access the Grafana dashboard by opening the web page at http://<IP.address>:3000 using admin/admin to log in the first time. We’ll be asked to change to a better password, but you can skip it if you don’t need to change the password just yet The Grafana Dashboard reads the data from the InfluxDB time series database to display Battery voltage (V), battery percentage (%), and power consumption while transmitting data (mW).

Grafana Link.ONE battery monitoring

The WisGate Connect gateway was turned off 24/7 and functioned normally at all times during the review. The enclosure feels warm to the touch because it acts as a heatsink to cool the Raspberry Pi CM4 module and this makes sure the gateway can operate without a cooling fan.

RAKWireless Wisgate Connect Review Link.ONE devit

Conclusion

RAKwireless WisGate Connect gateway is suitable for developers wanting to implement various wireless communication networks such as LoRaWAN, 4G LTE, 5G, WiFi 6, Zigbee, WiFi HaLoW, and more. It can save on costs with a single machine acting as a gateway, network server, and application server, and you don’t need a separate server. You just need to configure it yourself which should be relatively easy by following the steps described above. However, if all you need is a LoRaWAN gateway, we would recommend one or the cheaper RAKwireless Wisgate Edge since it is also easier to use, or another similar model from the market.

We would like to thank RAKwireless for sending us the WisGate Connect kit for review. Pricing starts at $149 for the RAK7391 Compute Module 4 (CM4) Carrier Board only, and up to $531 for a complete system with Raspberry Pi CM4 (4GB, 32GB, WiFi), a 16-channel LoRaWAN concentrator module, and an outdoor enclosure. The model reviewed in this tutorial sells for $381. You can also add various WisBlock modules if you require extra sensors or wireless options for the gateway.

CNXSoft: This tutorial is a translation of the original review on CNX Software Thailand by Ninephon Kongangkab.

Share this:

Support CNX Software! Donate via cryptocurrencies, become a Patron on Patreon, or purchase goods on Amazon or Aliexpress

ROCK Pi 4C Plus
Subscribe
Notify of
guest
The comment form collects your name, email and content to allow us keep track of the comments placed on the website. Please read and accept our website Terms and Privacy Policy to post a comment.
0 Comments
Khadas VIM4 SBC