Setting up the RAK 7243 LoRaWAN Gateway on TheThingsStack (TTN V3).

Leonard Mabele
5 min readSep 22, 2021

Overview

The RAK 7243C is a fully-fledged 8 channel LoRaWAN gateway that is class A and C compliant. It consists of the following components: RAK2245 and RAK2013 modules and the Raspberry Pi 3B+ System-on-chip (SoC) or Single Board Computer (SBC). At its core is the SBC which integrates all the other hardware components and runs the operating system (OS). The RAK2245 is the concentrator module, which is the LoRa transceiver that receives the LoRa packets from the devices (mostly referred to as IoT nodes) through the LoRa Radio Frequency (R.F.) interface and transmits the packets from the Internet back to the nodes. The RAK2013 is the cellular module that provides cellular IoT backhaul (in scenarios where Wi-Fi or Ethernet of the SBC is not being used). In other words, the RAK2013 provides LTE-capability of achieving the performance of the gateway transmitting data to the Internet when deployed in outdoor environments where Ethernet or Wi-Fi is not available. Just as shared in the earlier post of migrating from V2 to V3 on TheThingsNetwork where the iC880a gateway is the one used, in this post, I share how to set up the RAK 7243 LoRaWAN Gateway to the new V3 platform — TheThingsStack (TTS). Although it should still be noted that other LoRaWAN network servers, such as the LORIOT can also be used apart from the TTS.TTS is more suitable for public, cloud deployment. An image of the assembled RAK7243 Gateway is shown in figure 1.

Figure 1: An assembled RAK7243 Gateway

About the RAK7243 Gateway

The RAK7243C, apart from the modules mentioned above, also comes with a GPS module and a heat sink to increase its performance and thermal dissipation. If you are getting one off the shelf, it comes as a pre-assembled fully functioning gateway (of dimensions 150mm x 90mm x 90mm and a weight of 0.6kg) with the following features:

1. Full LoRaWAN stack support (version 1.0.2).

2. Support all 8 channels and spreading factors (SF7-SF12).

3. SX1301 baseband processor (just like the iC880a) that emulates 49x LoRa demodulators 10 programmable parallel demodulation paths, support 8 uplink channels and 1 downlink channel.

4. Supports optional cellular module (Quectel BG96 or EG95) for NB-IoT/LTE CAT-M1/LTE CAT1/ LTE CAT4).

5. Built-in ublox MAX-7Q GPS module.

6. TX power up to 27dBm, RX sensitivity down to -139dBm@SF12 and a bandwidth of 125KHz.

7. Frequency band support — EU433, CN470, RU864, IN865, EU868, US915, AU915, KR920, AS923 (if you are in the African continent, EU868 should work for you).

Configuring the Gateway on TTS

Setting up the Headless Network Access

Since the Gateway is made up of the Raspberry Pi SBC, you can configure it just as you would configure the Raspberry Pi’s SD card, only that you do not need to format the SD card (a post will be shared in future on how to go about this) if you have purchased the fully assembled gateway. The step-by-step approach provided below is for the headless access to the gateway. In the headless access, just remove the SD card from the SD card slot and insert it into the PC (use a micro SD card reader or flash SD card reader). In the additional USB drive that shows up on your PC, copy the following two files to the boot directory,

1. An ssh blank file — The instructions to do this are provided on this link.

2. The wpa_supplicant.conf file. I am copying the contents of mine in figure 2 but you should change the country code and your network configuration. This is the file that enables the SBC (or the entire gateway) to be accessible through the headless setup via ssh.

Figure 2: A snippet of the wpa_supplicant.conf with Network Configuration

NB: A number of people face challenges when setting up the headless access to the Pi especially when there is no screen to connect the Pi to or they are not able to access the network router. In that case, I recommend installing nmap (works on Windows, Linux and MAC) then run the following command to see the devices connected to the network (e.g. if your network is 172.xx.xx.xx), nmap -sn 172.16.40.0/24. This will bring up the number of devices connected to your network. If a Raspberry Pi is on the network, it would bring its MAC Address with the name Raspberry Pi Foundation in brackets and its IP address on the next line, as shown in figure 3. If this is too much work, just set up a hotspot from your Windows PC and enter the details of hotspot network in the wpa_supplicant.conf file. This will bring the Rasperry Pi IP on the connected devices to the hotspot network set on your PC and you should be able to continue.

Figure 3: Nmap output if a Raspberry Pi is on the network

Connecting the Gateway to TTS

Once you are able to access the Pi on your network, ssh into it with the credentials of the SD card. Use one of the software described in the ssh link above (mostly putty for windows or ssh on terminal for Linux) and follow the following steps.

1. Remove the global_conf folder in the /opt directory of the RAK7243 (Download to your PC as backup).

2. Register the Gateway on the TTN V3 server using the Gateway EUI in the local.conf script of the gateway (folder — /opt/ttn-gateway/packet_forwarder/lora_pkt_fwd).

3. Download the global_conf.json from the TTN V3 Network server

4. Upload the file global_conf.json to the folder — /opt/ttn-gateway of the RAK7243 Gateway.

5. Restart the Gateway by running the command “sudo gateway-config” and select option 2 (Setup RAK Gateway Channel Plan) then Select — Server is TTN.

6. The Gateway will reboot and connect to the TTN V3 Network Server.

The output of these steps should be a live gateway as shown in Figure 4. The setup Gateway is shown in figure 5 with the GPS, LoRa and the Cellular antennas connected (upper enclosure open).

Figure 4: A live RAK7423 Gateway on the TTS platform
Figure 5: Connected RAK7423 Gateway with the connected Antennas

--

--

Leonard Mabele

I am just a contributor of the innovation in telecommunications (Dynamic Spectrum Access, LPWANs), Programming and Engineering Design. IoT is also my coffee mug