This source code provides a framework that sends control packets and collects RSSI measurements. It is designed to control Multitech`s mDot and xDot LoRa devices using the The Things Network infrastructure as back-end. LoRa RSSI Grabber is capable of creating datasets cotaining RSSI measurements, it helped creating this dataset and was used as a proof of concept of the first step of a key generation framework called RSSignal.
- send_position.py
: This is the legacy source code obtained from the original repo
- send_control_packets.py
: Python script that contains the project's main functionality (take a look at the section Project Description
above)
- pip-requirements.txt
: Python/pip modules required in order to run the python script (see the full instructions on the Creating a venv and installing the requirements
section)
- os-requirements.txt
: Operating system packets* required in order to run the python script
* It's recommended to obtain these packets from your distro's official repositories (which is usually done through a packet manager (e.g. APT, DNF, Pacman, etc) )
- Any GNU/Linux Operating System (e.g. Debian, Ubuntu, etc)
- A BASH shell
- The packets inside the files pip-requirements.txt & os-requirements.txt**
- An android GPS-enabled phone (see the section below)
- A LoRa End Device (e.g. Multitech mDot-915)
** Each file contains the name of the package and the version required in order to run correctly
Please refer to the file GPS-setup-android.md
NOTE: The steps of this subsection may be required to run only on the for the first time. Once done, it's possible to skip them.
Please refer to the file requirements-setup.md and then follow the steps below step 2 of the next subsection
The instructions are as follows:
The steps vary according to the place where the project was cloned
source pyvenv/bin/activate
NOTE: The BASH console should now display (pyvenv)
on the command line
TIP: To exit the env, just issue the command deactivate
If not already done, please connect the phone (or the GPS receiver) and the LoRa-enabled device
./get-mqtt-data.sh
python send_control_packets.py
NOTE: Please, be sure that requirements from the section Requirements
are met in order to correctly run the script
After running the survey, process the data obtained using the process_api_data.py
and join_GW_ED_data.py
scripts (see the workflow below).
The program works this way:
- Run
get-mqtt-data.sh
to subscribe to the TTN MQTT API (NOTE: must run before step 2) - Use
send_control_packets.py
to send the LoRa packets and take it's RSSI - After completing steps 1 & 2, use
process_api_data.py
to extract the packet's ID & RSSI - Execute
join_GW_ED_data.py
in order to get the RSSI measurements put together in one file
For a summarized reference, see the image below:
Please, refer to the previous section too.
A: It provides an easy and standardized way to obtain RSSI measurements on both sides (ED & GW) of a LoRa communication.
Q2: The gateway is reporting RSSI correctly but the device measurements are frozen/locked. What may be happening?
A: As you are getting measurements from both sides of the connection (ED & GW), you should send data (uplink) and receive something back on the device (downlink) in order to get signal emissions on both directions so to be able to get updated RSSI measurements on the device side too. It's possible to try to enable receiving ACKs if your LoRa device supports it.
A: Check that the GPS related steps were successfully followed. Check that the USB cable is fully operational and the phone allows the computer to read its data. Then check that the adb program is working and issue the adb forward
command.
A: This can be the result of a couple of things: Poor GPS signal reception (e.g. inside an indoor place); GPS margin of error (e.g. position estimated error); Some or one ShareGPS app permission not allowed; Android's battery optimization is messing with the ShareGPS app; Phone is in energy saving mode; Bluetooth and/or WiFi location services (i.e. Wi-Fi & Bluetooth scanning) are enabled; Google High Precision/Improved location option is disabled.
Q5: I'm sure everything is set up correctly but the GPS still reports incorrect data or it freezes after some time. What else can I do?
A: If your android device is running android 8+, there are some security implementations under the hood that limit the GPS functionality while in background. So please, install the app Wakey and don't let your screen go off during the survey. Keep the ShareGPS app onscreen all the time (i.e. don't minimize or close it). If you still face issues, try clicking "Start Track" before collecting GPS data (this will create a background service that will try to keep the GPS 'locked' (i.e. keeps requesting precise location every second)). The last attempt is to put the phone in airplane mode (disabling WiFi and Mobile Data), because this will prevent android from getting the approximate location from the carrier network or IP address (instead of the high precision one from GPS receiver) during the survey.
If you used our dataset or any part of the source code, please, use the citation:
L. Oliveira, L. Chaves, and E. Silva. "Explorando o RSSI na Geração de Chaves para LoRaWAN", in Anais do XXIII Simpósio Brasileiro de Segurança da Informação e de Sistemas Computacionais, Juiz de Fora/MG, 2023, pp. 1-14, doi: https://doi.org/10.5753/sbseg.2023.232890.
Or use the BibTex citation below:
@inproceedings{sbseg,
author = {Leonardo Oliveira and Luciano Chaves and Edelberto Silva},
title = {Explorando o RSSI na Geração de Chaves para LoRaWAN},
booktitle = {Anais do XXIII Simpósio Brasileiro de Segurança da Informação e de Sistemas Computacionais},
location = {Juiz de Fora/MG},
year = {2023},
pages = {1--14},
publisher = {SBC},
address = {Porto Alegre, RS, Brasil},
doi = {10.5753/sbseg.2023.232890},
url = {https://sol.sbc.org.br/index.php/sbseg/article/view/27193}
}
This source code was also used as part of my Computer Science monograph (which is available here):
De Oliveira, L. A. (2023). Arcabouços para Coleta de RSSI e Evolução de Técnicas de Acordo de Chaves em Redes LoRaWAN. Federal University of Juiz de Fora.
You may cite it using the BibTex code below:
@phdthesis{leonardo2023arcaboucos,
title = {Arcabouços para Coleta de RSSI e Evolução de Técnicas de Acordo de Chaves em Redes LoRaWAN},
author = {Leonardo Azalim de Oliveira},
month = {01},
year = {2023},
note = {Available at http://monografias.ice.ufjf.br/tcc-web/tcc?id=724},
school = {Federal University of Juiz de Fora},
key = {OLIVEIRA,2023}
}
The authors would like to thank Mr. Rogerio Casagrande and Mr. Thiago Scher, members of the LTA (Laboratorio de Telecomunicacoes Aplicadas) laboratory from the Engineering Faculty of the Federal University of Juiz de Fora, for assisting the configuration process and lending the LoRa equipment used during the deployment and test of the framework
This source code is licensed under the AGPL-3.0 license