RAK5146 WisLink LPWAN Concentrator Quick Start Guide
Prerequisites
What Do You Need?
The following two sections provide a list of the components and tools you need to get started with the development board. Some of those are included in the package, others you need to provide yourself.
Hardware Tools
- RAK5146 WisLink LPWAN Concentrator
- Raspberry Pi 3/4 (RAK5146 bundle includes a Raspberry Pi 3 or 4)
- RAK5146 Pi HAT (RAK5146 bundle includes a RAK5146 Pi HAT)
- LoRa and GPS antennas
- A 16 GB SD card (included in the RAK5146 bundle only), a card reader, and a PC
Software Tools
- Balena Etcher: a tool for burning the firmware on the SD card
- PuTTY: a Windows tool for SSH, required to connect to the gateway
- Latest RAK5146 Firmware
Device Firmware Setup
For an easy and quick way of having a fully functional gateway, a Precompiled Firmware Image is provided. With that, this section gives you step-by-step instructions on how to install the Image into your SD Card used for the gateway.
Burn the Latest Firmware
- Download the latest firmware of RAK5146, which is based on the Raspbian OS.
- Use an image writing tool to install the firmware on the SD Card. For this tutorial, you will be using Etcher, an open-source utility used for burning image files.
- Insert your SD Card into the SD Card reader and plug it into your computer.
- Open the balenaEtcher Software, and select the downloaded image file in the first section of the balenaEtcher.
Your SD card should be automatically detected by the Etcher software. If not, secure a proper connection.
Click Flash and wait for a couple of minutes until it displays "Flash Complete."
Assembly Guide
To create a functioning RAK5146 WisLink LPWAN Concentrator, you need to put several components together.
Mount the Concentrator
Insert your RAK5146 mPCIe card into the mPCIe slot on the RAK2287/RAK5146 Pi HAT. Make sure the card fits snugly into the connector, it should end up sticking out at a 45-degree angle. Gently press it down and fasten it with 2 screws. If you have positioned the card right, the screw holes on the RAK5146 will match the ones on the RAK2287/RAK5146 Pi HAT. Use Figure 2 as a reference.
Antennas
The module comes with two antennas, GPS, and LoRa. Both have pigtail cables that have uFL connectors, which fit onto the corresponding ports on the RAK5146. The ports are labeled, match each antenna to its port and gently press it until the connectors fit one to the other.
It is not recommended to have the device powered with the antennas detached. This might damage the circuitry.
Mount the HAT
Take the RAK2287/RAK5146 Pi HAT, which now has the RAK5146 securely sitting on top, and insert it over the Raspberry Pi. Both the Pi and the HAT have a 40-pin connector that should fit together when pressed on top of each other.
SD Card
Insert the SD card with the Firmware you flashed in the previous step into the SD card slot on the bottom of the Raspberry Pi.
Boot
Power the Raspberry Pi via the Micro USB port (Pi3) / USB type-C port (Pi4). As this is going to be the first time to boot the OS it might take a couple of minutes before everything is set up, so be patient.
It is recommended to use at least a 2.5 A (for Raspberry Pi 3B+) or a 3 A (for Raspberry Pi 4) power supply.
Burn the Latest Firmware
Refer to the Raspberry Pi Setup guide, to check how to flash the latest Raspberry Pi OS and set it up to work with the RAK5146 LPWAN concentrator.
Access the Gateway
There are two ways to connect to your RAK5146 WisLink LPWAN Concentrator setup.
Before powering the Raspberry Pi 3B+ or 4, you should install the LoRa and GPS antennas. Not doing so might damage the boards.
1. Wi-Fi AP Mode
By default, the Gateway will work in Wi-Fi AP mode, which means that you should be able to find an SSID named “Rakwireless_XXXX” on the Wi-Fi network list, for example:
Connect to this Wi-Fi SSID by using "rakwireless" as the default password. The default IP address of the gateway's Wi-Fi is 192.168.230.1
. Take note of this IP address as this will be needed in connecting via SSH.
There is no need to configure the IP address of your PC as it will be assigned automatically via the DHCP server.
2. Via the Ethernet Port on the Raspberry Pi
You can also connect your PC to the gateway through an Ethernet cable. By default, the IP address of the gateway’s Ethernet interface is 192.168.10.10
, so you need to set the IP address of your PC’s Ethernet to the same network segment, for example, 192.168.10.20
.
- To do this in Windows, go to Control Panel > Network and Internet > Network and Sharing Center and click Ethernet
- Click Properties then Choose Internet Protocol Version 4 (TCP/IPv4).
- By default, the PC will obtain an IP address automatically. Click the option Use the following IP Address and enter the IP address:
192.168.10.20
and press OK.
Now, you should be able to access your gateway from your PC successfully using the IP address 192.168.10.10
through SSH.
Log into the Gateway
1. Windows OS
Secure Shell (SSH) is typically used to log in to a remote machine and execute commands. There are a lot of free and good SSH Clients out there namely Putty, BitVise SSH Client, MobaXterm and many more. Feel free to choose one that fits your needs, but in this guide, you will be using Putty.
- If you have connected to the gateway through Wi-Fi AP Mode, the IP address is
192.168.230.1
. - If you have connected to the gateway through Ethernet, the IP address is
192.168.10.10
. - It will then prompt you to enter the username and password. The default username and password are provided below:
- Username: pi
- Password: raspberry
2. Mac OS
Open the Terminal of Mac OS. Launch the Terminal application, which is found in the /Applications/Utilities/
directory. You can also launch it from Spotlight, press Command + Spacebar, type Terminal, and then return.
Open the terminal of Mac OS. Enter root mode by typing the following command: sudo -i
.
- If you are not in root mode, enter
ssh pi@192.168.230.1
in the terminal to log in to your gateway, the default password is "raspberry". - If you connect your PC with the gateway through Ethernet Cable, you should enter
ssh pi@192.168.10.10
, the default password is "raspberry".
Now, you have logged into the gateway through SSH successfully the same with Figure 11.
3. Linux OS
If the OS of your PC is Linux, you should do the same as the Mac OS, except for the root mode.
Product Configuration
Configuring the Gateway
Assuming you have successfully logged into your gateway using SSH. Enter the following command in the command line:
sudo gateway-config
Then, you will see a page the same as Figure 12.
- Set pi password - used to set/change the password of the gateway
- Set up RAK Gateway LoRa Concentrator - used to configure the frequency, which the gateway will operate on, and the LoRaWAN Server which the gateway will work with
- Restart packet -forwarder - used to restart the LoRa packet forwarded process
- Edit packet-forwarder config - used to open the global_conf.json file, to edit LoRaWAN parameters manually
- Configure Wifi - used to configure the Wi-Fi settings to connect to a network
- Configure LAN - used to configure the Ethernet adapter settings
A unique ID will be generated for the gateway. This is also called Gateway EUI squared in red in the figure above and is essential for registering the gateway with any LoRa Network Server (TTN, ChirpStack).
There is also another way to get your "Gateway ID", just enter the command below in the command line:
sudo gateway-version
Setting a new password for the Gateway
It is a good security practice to change the default password "raspberry" which is the same on all Raspberry Pi devices.
- First, choose the 1 Set pi password option referred on Figure 14.
- Next, press Yes and you will be asked to enter your new password twice then press Enter.
- A success message for changing the password will then pop up.
Set up RAK Gateway Channel Plan
This menu allows you to select your LoRa frequency band and one of the two available Networks Server options by choosing option 2 Setup RAK Gateway Channel Plan.
You can choose one of two supported LoRa Servers here: TTN or ChirpStack.
Server is TTN
- The Things Network (TTN): If you choose TTN as the LoRa Server, you will see the following page. Visit the LoRa Alliance Regional Parameters for more information on your local TTN frequency plan. This will allow you to choose the correct plan.
After choosing the correct frequency, the success message will appear as shown in Figure 20.
Server is Chirpstack
ChirpStack: If you choose Chirpstack as your LoRa Server, you will see the following page with two options available:
- ChirpStack Channel Plan Configuration - used to configure your Regional Frequency Band
- ChirpStack ADR Configure - used to enable/disable the Adaptive Data Rate (ADR) functionality.
First, select option 1 for configuring your Regional Frequency Band
Then, set the IP address of the ChirpStack which you want your gateway to work with:
The default IP address is 127.0.0.1
. If you want to use an independent LoRa Server running on another device or a cloud-based LoRa Server, you need to set it to the corresponding IP address.
Connecting to a Network
If you want to use TTN or an independent ChirpStack, which may be deployed in a local area network or a remote one, you need to connect your gateway to a networking device that will allow you connectivity to the internet (a router for example). There are two options offered for this purpose.
Connect through Wi-Fi
If you want to connect through Wi-Fi, it can easily be done with the wireless capabilities of the Raspberry Pi 3B+ or Raspberry Pi 4 by choosing "5 Configure WIFI". By default, the RAK5146 WisLink LPWAN Concentrator works in Wi-Fi AP Mode. For the gateway to connect to the router, it must work in Wi-Fi Client Mode.
There are 5 options to choose from in the Wi-Fi configuration menu:
- Enable AP Mode/Disable Client Mode - after rebooting, the gateway will work in Wi-Fi Access Point Mode while the Wi-Fi Client Mode will be disabled (this is the default mode).
- Enable Client Mode/Disable AP Mode - after rebooting, the gateway will work in Wi-Fi Client mode, while Wi-FI AP Mode will be disabled.
- Modify SSID and pwd for AP Mode - used to modify the SSID and password of the Wi-Fi AP. It only works if the Wi-Fi AP Mode is enabled.
- Add New SSID for Client - is used if you want to connect to a new Wi-Fi Network. Only works in Wi-Fi Client mode.
- Change Wi-Fi Country - is used to modify the Resident Country to match with Wi-Fi standards.
To enable Wi-Fi Client Mode, you have to disable first the AP Mode.
Once Wi-Fi AP Mode has been disabled by choosing "2 Enable Client Mode/Disable AP Mode", you can now then connect to a new Wi-Fi Network by choosing "4 Add New SSID for Client":
- Start by selecting your country of residence:
- Enter the SSID of the network you want to connect:
Make sure to input the correct Wi-Fi SSID and Password or you will not be able to connect to the RAK5146 WisLink LPWAN Concentrator again via SSH in Wi-Fi AP Mode. If stuck in this situation, follow the procedure listed in Connecting to a Network document which is applicable for all Raspberry Pi-based gateways to work again in Wi-Fi AP mode.
- Enter also the password. Just leave it empty if None.
Connect through Ethernet
If you want to connect to the router through Ethernet Cable, do the following steps:
- In the main configuration menu, choose “6 Configure LAN”. This will let you set up a static IP address for the Gateway’s Ethernet adapter.
- Just fill in a static IP address according to the IP address of the router you want to connect. Note that the LoRaWAN gateway and the router must be in the same network segment, otherwise the connection fails.
- By default, the IP address of the gateway's Ethernet is
192.168.10.10
.
- Then configure the IP address of the Router. This is the LAN Interface IP address of the router.
- Press OK and a success message appears.
- Lastly, reboot the gateway using the command
sudo reboot
in the command line and it will connect to the router successfully through Ethernet.
Optional Configurations
The configurations in this section are optional and situational.
Reverting to Wi-Fi AP Mode
If you have entered either or both incorrect Wi-Fi SSID and Password in the Wi-Fi Client Mode setup for the RAK5146 WisLink LPWAN Concentrator to connect to the router, follow these set of steps for you to work again in Wi-Fi AP Mode and redo the setup.
- Remove the SD Card from your RAK5146 WisLink LPWAN Concentrator and insert it into your PC. Your PC should be able to detect it the same as Figure 32.
- Using your "Command Prompt" or "Terminal", navigate to your SD Card and type this command to generate the "rak_ap" file.
cd > rak_ap
- Check if the rak_ap file is created successfully. If so, re-insert the SD Card into your RAK5146 WisLink LPWAN Concentrator and it should work again in Wi-Fi AP Mode.