RAK2247 Quick Start Guide
Prerequisites
What Do You Need?
Before going through each and every step in the installation and guide of the RAK2247 LPWAN Gateway, make sure to prepare the necessary items listed below:
-
A Windows/Mac OS/Linux Computer
What's Included in the Package?
Product Configuration
RAK2247 + x86 Linux PC
This section explains the basic steps on how to interface the RAK2247 WisLink LPWAN Concentrator with a Linux Operating System on a computer.
- Insert the RAK2247 mPCIe board into the USB carrier board and plugged into a free USB port of your PC. Your Linux PC should recognize it as a USB device.
If you want to connect the RAK2247 mPCIe board to the Linux PC directly, make sure to have the PERST# signal (Pin 22) pulled down.
- Open the command line then enter the command below in order to clone the Github repository that is required for the process to be completed:
git clone https://github.com/RAKWireless/rak_common_for_gateway.git
- Get the name of the interface you are using to connect to the internet by typing the command:
ifconfig
An example in Figure 2 shows the name of the wireless interface “wlx6045bdf0cf64”.
- Enter the RAK Folder through:
cd rak_common_for_gateway/lora/rak2247_usb
- Next, you need to insert the name you got in Step 3 for your interface in the following files:
- rak_common_for_gateway/lora/set_eui.sh
- rak_common_for_gateway/lora/update_gwid.sh
- Then, replace the following line:
GATEWAY_EUI_NIC=”eth0”
- With the line,
GATEWAY_EUI_NIC=”wlx6045bdf0cf64h0”
Again, the values are just an example. Remember to do this for all three (3) files in Step 4.
- Change the
global_conf.json
that will be copied during installation by replacing theglobal_conf.eu_863_870.json
in the end of the (install.sh file)[https://github.com/RAKWireless/rak_common_for_gateway/blob/master/lora/rak2247_usb/install.sh] to one of those inside/global_conf
or a custom one. (EU868 is the default)
cp global_conf/global_conf.eu_863_870.json $INSTALL_DIR/packet_forwarder/lora_pkt_fwd/global_conf.json
You may also comment on the line below so the TTN address doesn't get replaced by localhost.
# sed -i "s/^.*server_address.*$/\t\"server_address\": \"127.0.0.1\",/" $INSTALL_DIR/packet_forwarder/lora_pkt_fwd/global_conf.json
- If you are using the RAK2247 in a board that has a different pinout than the RAK2247 Pi Hat, replace the
SX1301_RESET_BCM_PIN
in therak_common_for_gateway/lora/start.sh
to the corresponding RESET pin.
# Reset iC880a PIN
SX1301_RESET_BCM_PIN=<YOUR_RESET_PIN_HERE>
If you want to have your Gateway_ID automatically update when running your package forwarder, uncomment and change the line #./update_gwid.sh ./local_conf.json
in the same file (start.sh) to ./update_gwid.sh ./global_conf.json
.
- Add the following lines of code at the end of “install.sh” file: ( In addition to inserting the name of the interface from the previous step)
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 packet forwarder to start on boot, you need to also add the lines below:
cp ../ttn-gateway.service /lib/systemd/system/
systemctl enable ttn-gateway.service
- Save “install.sh” file and execute it in order to install:
sudo ./install.sh
- Wait for the installation to complete. Using the commands below, go and run the newly created process (lora_pkt_fwd):
cd /opt/ttn-gateway/packet_forwarder/lora_pkt_fwd
sudo ./lora_pkt_fwd
If you added the additional lines in Step 5 it will execute every time on boot.
- To check if it is working, run
sudo systemctl start ttn-gateway.service
to start the service and check its statusservice ttn-gateway status
. You should see something like the box below. Be aware that it may take some minutes to see your gateway as connected in TTN's console.
pi@raspberrypi:~ $ service ttn-gateway status
● ttn-gateway.service - The Things Network Gateway
Loaded: loaded (/lib/systemd/system/ttn-gateway.service; disabled; vendor preset: enabled)
Active: active (running) since Fri 2020-10-09 17:50:55 BST; 1min 9s ago
Main PID: 721 (start.sh)
Tasks: 6 (limit: 2065)
CGroup: /system.slice/ttn-gateway.service
├─721 /bin/bash /opt/ttn-gateway/packet_forwarder/lora_pkt_fwd/start.sh
└─769 ./lora_pkt_fwd
Oct 09 17:52:00 raspberrypi ttn-gateway[721]: src/jitqueue.c:448:jit_print_queue(): INFO: [jit] queue is empty
Oct 09 17:52:00 raspberrypi ttn-gateway[721]: ### [GPS] ###
Oct 09 17:52:00 raspberrypi ttn-gateway[721]: # GPS sync is disabled
Oct 09 17:52:00 raspberrypi ttn-gateway[721]: ##### END #####
Oct 09 17:52:00 raspberrypi ttn-gateway[721]: JSON up: {"stat":{"time":"2020-10-09 16:51:30 GMT","rxnb":0,"rxok":0,"rxfw":0,"ackr":0.0,"dwnb":0,"t
Oct 09 17:52:00 raspberrypi ttn-gateway[721]: INFO: [down] PULL_ACK received in 368 ms
Oct 09 17:52:00 raspberrypi ttn-gateway[721]: ##### 2020-10-09 16:52:00 GMT #####
Oct 09 17:52:00 raspberrypi ttn-gateway[721]: ### [UPSTREAM] ###
Oct 09 17:52:00 raspberrypi ttn-gateway[721]: # RF packets received by concentrator: 0
Oct 09 17:52:00 raspberrypi ttn-gateway[721]: # CRC_OK: 0.00%, CRC_FAIL: 0.00%, NO_CRC: 0.00%