Line up for Linux: How to Install Your RAK2247 LPWAN Concentrator Module with a Linux Machine
If before, Linux was only commonly used for programming projects, Linux is now dominating the scene of the Internet of Things (IoT). In a 2018 survey sponsored by the Eclipse IoT Working Group, AGILE IoT, IEEE, and the Open Mobile Alliance, Linux was hailed as the top operating system (OS) for the IoT community. Among 502 respondents, 71.8% responded with “Linux” as the most-trusted OS for their IoT devices.
And the numbers do not lie. Linux and its components are being widely developed, used and regulated by developers and engineers worldwide because of its open source and low-cost features. Linux can also run on products as small as server chips and boards to PCs and even larger networking systems, while maintaining its robust support for easy customization.
As a result, numerous IoT devices, from LoRaWAN® gateways to LoRAWAN modules, are now capable of being configured with a Linux machine – an example of which is the RAK2247 LPWAN Gateway Concentrator Module from RAKwireless. This 8-channel LPWAN module supports the LoRaWAN 1.0.2 protocol and is equipped with a mini-PCIe form factor based on the SX1301 chip from Semtech. If you’re curious as to how you can unlock the Linux capability for your IoT device, then continue on reading our tutorial with the RAK2247 concentrator module.
RAK2247 LPWAN Gateway Concentrator Module
The RAK2247 is the evolution of RAK833. It retains the same small form factor (mPCIE) and is just as easy to integrate as the previous model.
Installing Ubuntu, a Linux distribution
Get the installation file
Download the ISO file from https://ubuntu.com/download/desktop. Please make sure you have the latest version of Ubuntu.
Create a bootable DVD/USB
When you have the version that best suits you, you can now burn the ISO image into USB/DVD to boot the computer from that drive. Please note that in performing this step, you will completely format the USB drive. All the data that is stored in it will be lost. Also, make sure you’ve changed the boot sequence so that your system boots using the CD/DVD or flash drive. You can do that from the BIOS setup.
Boot the system from the USB/DVD
Restart your machine and make it boot from the bootable device that we created before. You will see the following screen and then choose “Install Ubuntu” option:
Choose your keyboard layout
Choose the keyboard layout that best fits you. No worries, your choice can still be changed after the installation.
Choose the updates and the software
We recommend you choose the following option:
Choose the installation type
Please choose the first option:
Answer the next pop-up window that will ask you if you are sure of your choices. It will also show you the default partitions that will be formatted and the parts that will be affected at all.
Choose your regional setup
We recommend you choose your real location or the closest one to you.
Provide your information
Set up your name and some other details of your computer. Choose a password that you think you will remember best.
Run the installation
Wait until the installation is done. It may take some minutes.
Log in
Provide your account details and sign in.
Enabling LoRa Packet Forwarder on your RAK2247
Install git on your Ubuntu
Get your copy of git and clone the script:
sudo apt install git
sudo git clone https://github.com/RAKWireless/rak_common_for_gateway.git
Run command
Run the following command to get the name of the interface that you are using to connect to the network.
ifconfig
If correct, you will get this info:
Copy the interface’s name (“enp0s3” in this case), you will need it later. Go to RAK2247’s folder by typing:
cd rak_common_for_gateway/lora/rak2247
Read the install.sh file by nano:
sudo nano install.sh
Find “GATEWAY_EUI_NIC=”<something>”” and put your interface’s name “GATEWAY_EUI_NIC=”<here>””
Go to the end of the file and put these lines there:
cp ../set_eui.sh packet_forwarder/lora_pkt_fwd/
cp ../update_gwid.sh packet_forwarder/lora_pkt_fwd/
cp ../start.sh packet_forwarder/lora_pkt_fwd/
mkdir -p /opt/ttn-gateway
cp -rf packet_forwarder /opt/ttn-gateway/
If you want the packet forwarder to start on boot put these too:
cp ../ttn-gateway.service/lib/systemd/system/
systemctl enable ttn-gateway.service
)
Close and save the file by pressing (Ctrl+Z) then press (Y) and (Enter).
Now type:
cd ..
sudo nano set_eui.sh
Again, find “GATEWAY_EUI_NIC=””” and put your interface’s name “GATEWAY_EUI_NIC=”””
Close and save the file by pressing (Ctrl+Z) then press (Y) and (Enter).
And for last time, type:
sudo nano update_gwid.sh
Find “GATEWAY_EUI_NIC=”<something>”” and put your interface’s name “GATEWAY_EUI_NIC=”<here>””
Close and save the file by pressing (Ctrl+Z) then press (Y) and (Enter).
Run the installation script
Use this command:
sudo ./install.sh
Go in lora_pkt_fwd by typing:
cd ~
cd /opt/ttn_gateway/packet_forwarder/lora_pkt_fwd
sudo nano global_conf.json
Scroll down to the end of the file and change
"serv_port_up": 1680
to
"serv_port_up": 1700
and
"serv_port_down": 1680
to
"serv_port_down" : 1700"
Change
"server_address": "localhost"
to
"server_address": "router.eu.thethings.network"
Type
sudo ./lora_pkt_fwd
Should you add the additional lines in this step, it will execute every time on boot.
That completes our tutorial! You can now ride on the rising trend of global Linux use and awakened the potential of your RAK2247 LPWAN Gateway Concentrator Module. Start finding out why most IoT enthusiasts trust Linux. Along the way, do not be afraid to learn processes and start new projects that can lead to unthinkable breakthroughs. With developers and engineers improving this excellent operating system all around the world, you can be sure of the stability and security of your deployment. If you will need support, however, you can always find Linux experts in the IoT community. Like with RAK, you can always reach out in our forum: https://forum.rakwireless.com/