Currently, this LoRa experiment operates in TESTBED mode and focuses on transmitting timestamped packets via the LoRaWAN network deployed at AERPAW's Centennial Campus and Lake Wheeler Field. The setup includes a single AERPAW SPN portable LoRa node equipped with a LoStik device.
The setup involves one AERPAW SPN LoRA portable node with a Lostik device connected.
Experiment Goals: Collect key metrics such as RSSI, SNR, drone location, DataRate, Frequency, Spreading Factor, RX_Channel, and Gateways location.
Output Result files: The experiment will generate vehicle and LoRaWAN transmission logs. For detailed TX-RX package parameters with location data, contact the AERPAW LoRaWAN operators after finalizing the experiment.
The image shows the LoStik device attached to the SPN on the drone, which will serve as a reference for future post-processing of data. The omnidirectional antenna is located at the bottom of the drone.
The network infrastructure consisted of five RAK7289 LoRaWAN gateways at Lake Wheeler Field. Among these, two gateways, CC2 and CC3, are located on NC State University's Centennial Campus.
The LoRaWAN parameters can be configured opening with your favorite text editor in the config.txt file located at:
/root/Profiles/ProfileScripts/Radio/Samples/LoRaWAN/SendPackageLostik/config.txt
The Configuration parameters allowed to change are the following:
JOIN_MODE (abp/otaa - Defines the network activation mode)
APPEUI (Application identifier for OTAA activation)
APPKEY (Application key for OTAA activation)
DEVEUI (Device identifier for OTAA activation)
RETRIES (Number of retry attempts for network joining or transmission)
LORA_PORT (Serial port used to communicate with the LoRa module, e.g., /dev/ttyUSB0)
# ABP Session Parameters
DEVICE_EUI (Unique identifier for the device, hexadecimal string)
APP_SESSION_KEY (Application session key for ABP activation, hexadecimal string)
NET_SESSION_KEY (Network session key for ABP activation, hexadecimal string)
DEVICE_ADDRESS (Device address for ABP activation, hexadecimal string)
LORA_BAUD (Baud rate for serial communication with the LoRa module, e.g., 57600)
ar (Enable/Disable Automatic Reply - on/off)
MIN_DR (Minimum data rate for transmissions, range: 0-4)
MAX_DR (Maximum data rate for transmissions, range: 0-4)
MIN_CH (Minimum channel number used for transmissions, range: 1-100)
MAX_CH (Maximum channel number used for transmissions, range: 1-100)
ch_drrange (<channelID> <minRange> <maxRange> - Defines data rate ranges for specific channels; e.g., 13 4 2 means channel ID 13, min DR=4, max DR=2)
pwridx (Output power index for transmissions on the US frequency band, range: 5-10)
class (LoRaWAN device class; a for Class A, c for Class C)
retx (Number of retransmissions for confirmed uplink packets, range: 0-255)
adr (ON/OFF - Enable/Disable Adaptive Data Rate mechanism)
portno (<portno>, range: 1-223 - Application port number used to distinguish payload types within LoRaWAN frames)
Reference on how to modify the parameters: Microchip Reference Guide RN2903
The relevant scripts for this experiment are located in the /root/Profiles/ProfileScripts/Radio/Samples/LoRaWAN/ directory, These include:
config.txt: Previously described, this file is used to configure LoRaWAN parameters.
sendVehiclePackage.py: A Python script that enables real-time monitoring and transmission of package data over LoRaWAN, configures the LoStik device, and dynamically adjusts transmission settings.
startSendVehiclePackage.sh: A shell script that automates the execution of the sendVehiclePackage.py Python script for LoRaWAN data transmission.
Login to the portable node E-VM and navigate to the folder containing all the radio scripts:
$ cd /root/Profiles/ProfileScripts/Radio/Samples/LoRaWAN/SendPackageLostik/
Edit the config.txt file parameters if needed:
$ nano config.txt
Copy the start experiment script from the current directory as startRadio.sh:
$ cd /root/Profiles/ProfileScripts/Radio
$ cp Samples/LoRaWAN/SendPackageLostik/startSendVehiclePackage.sh startRadio.sh
Use an editor to uncomment the line /Radio/startRadio.sh and /Vehicle/startVehicle.sh in /root/startexperiment.sh
Create a preplanned trajectory for the drone of your preference for the experiment, you can follow the instructions for creating a preplanned trajectory in the following link:
and then run:
$ sh /root/startexperiment.sh
For stoping the experiment you can run the following command:
$ sh /root/stopexperiment.sh
If you want to Reset the experiment:
$ sh /root/reset.sh
After running the startexperiment.sh script in the /root the experimenter can use the following command to open a screen and monitor the logs:
$ screen -r send_loRaWAN_vehicle_pkg
To exit the screen without stopping the process, press Ctrl+A followed by D.
If you need to check or modify the experiment, you can review the support files located at /root/Profiles/ProfileScripts/Radio/Helpers/LoRaWAN/. In this directory, you will find the following files:
config.py
logger.py
lora_connection.py
read_last_line_uav_results_folder.py
These files allow you to add or adjust setup parameters as explained in the Microchip Reference Guide RN2903. Additionally, you can modify the configuration for the OTAA (Over-The-Air Activation) connection as needed.
The terminal interface allows you to send commands directly to the LoStik device for testing and configuration, as shown in the shared image. You can input commands like mac get deveui or sys get ver to retrieve specific device information or settings. The terminal provides feedback in real-time, displaying the command status and the corresponding output.
cd /root/Profiles/ProfileScripts/Radio
cp Samples/LoRaWAN/TerminalTestLostik/startTerminalLostik.sh startRadio.sh
Uncomment the line in /root/startexperiment.sh --> # /Radio/startRadio.sh
sh /root/startexperiment.sh
After running the startexperiment.sh script in the /root the experimenter can use the following command to open a screen and send commands to Lostik:
$ screen -r send_loRaWAN_vehicle_pkg
To exit the screen without stopping the process, press Ctrl+A followed by D.
mac get adr: Checks whether Adaptive Data Rate (ADR) is enabled.
sys get ver: Retrieves the firmware version of the RN2903 module.
mac get deveui: Displays the Device EUI (unique identifier for the device).
mac get appeui: Retrieves the Application EUI.
mac get pwridx: Displays the power index setting.
radio get bitrate: Retrieves the current bitrate for radio communication.
radio get crc: Checks if CRC (Cyclic Redundancy Check) is enabled.
radio get pwr: Displays the current transmission power setting.
sys get hweui: Retrieves the hardware EUI.
To exit the screen without stopping the process, press Ctrl+A followed by D.
This interface is useful for testing, configuring parameters, and troubleshooting LoRaWAN communication with the LoStik device. For a full list of supported commands, refer to the Microchip RN2903 Command Reference.
sh /root/stopexperiment.sh # Terminate
sh /root/reset.sh # Reset configurations
Do not run the terminal experiment (terminal_lostik_loRaWAN) and the send package experiment (send_loRaWAN_vehicle_pkg) simultaneously.
Use screen -r [session_name] to monitor only one experiment at a time.