This tutorial takes you step by step to get your RAK831 or other sx1301AP2 based gateways on Ubuntu. The steps have been tested with 16.04 LTS and should work seamlessly on any future version as well.
- RAK831 LoRa Gateway board x1
- FT2232HL Module x1
- Mini USB Data lines x1
Connect your FTDI and RAK831:
As the RAK831 uses SPI interface communication, so the computer to communicate with it must use USB to SPI interface to achieve, so the use of FT2232HL module to achieve conversion.
RAK831 and FT2232HL wiring as follows:
Note: While powering on the rak831, please make sure the antennae is securely in place and screwed properly. Powering on without the antennae may result in irreversible damage to the board.
Downloading the driver:
If you have already installed the github environment on Linux system, then you can get it directly using the git clone.
This library is required for enabling the ftdi drivers to talk to the SPI component in the . The installation process is simple and can be done according to the following steps：
sudo apt-get install libftdi-dev
Go to download folder of your RAK831 gateway repor under the ../libmpsse/src directory.Execute the following command.
sudo ./configure --disable-python
And then compile
Static and dynamic libraries compiled code is put into /usr/local/lib
Header file is put into /usr/local/include
sudo make install
Build the library
Unpack the RAK831 LoRa Gateway project and go to lora_gateway directory. then build the library and examples.
After completing the above work, you can start the Lora Gateway tests. It is necessary to confirm whether the Liunx system recognizes the FT2232HL module and whether the wiring is connected. So first we need to test the SPI communication.
Go to the ../lora_gateway/libloragw directory. Execute the following command.
The output should show that the register get a non zero value which matches the values that is in the (should be ***) section in each line.
In the ../lora_gateway/libloragw directory, execute the following command to test the module receive
sudo ./test_loragw_rx 868.1 868.5
Note: here change the radio0 and radio1 frequency to the frequency of your rak831 device. This should show a steady stream f bytes being sent out from the concentrator.
To get the additional lora_pkt_fwd functionality add the following files in your RAK831 repository root and build as usual:
Once installed just run make from the folder root and the packet forwarder should be available in the / lora_pkt_fwd directory.