banner
Home / Blog / Setting up a private LoRaWAN network with WisGate Connect gateway
Blog

Setting up a private LoRaWAN network with WisGate Connect gateway

Apr 28, 2024Apr 28, 2024

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.

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.

The kit also includes a power supply and various cables.

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.

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.

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:

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.

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

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

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.

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.

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.

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

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

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

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:

We now have 7 containers running on the gateway:

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

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.

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

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:

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.

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.

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.

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.

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.

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

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.

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

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 time-series database enables Node-RED to record data obtained from sensors. Again, only the time zone needs to be modified.

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

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:

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

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.

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.

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

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

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

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.

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.

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.

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.

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…

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.

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).

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 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.

Jean-Luc started CNX Software in 2010 as a part-time endeavor, before quitting his job as a software engineering manager, and starting to write daily news, and reviews full time later in 2011.

Support CNX Software! Donate via cryptocurrencies or become a Patron on Patreon

Related posts:

The WisGate Connect