-
Python 3.9.2 (tested), anything 3.10 and above will break!
If not installed, installation instructions using
pyenv
:sudo apt update sudo apt install -y build-essential zlib1g-dev libssl-dev sudo apt install -y libreadline-dev libsqlite3-dev \ libffi-dev libbz2-dev liblzma-dev curl -sS https://webi.sh/pyenv | sh source ~/.config/envman/PATH.env pyenv install 3.9.2 pyenv global 3.9.2 # VERIFY 3.9.2 python -V
-
GitHub login with access to this repository
If not set up, instructions:
# USING GITHUB CLI curl -sS https://webi.sh/gh | sh gh auth login # tested with github.com > https > yes > paste an authentication token
-
Install
venv
if not already installed withpyenv
:sudo apt-get install python3-venv
-
Clone repository:
git clone https://github.com/RedWvn/FlightMonitoringSystem.git fms cd fms
-
Create a
.env
file (see .env File) -
Complete setup process:
chmod u+x scripts/setup.sh scripts/restart.sh python -m venv . pip install -r requirements.txt sudo ./scripts/setup.sh --user pi # CHANGE TO YOUR USERNAME sudo systemctl start setup_service sudo systemctl start telemetry_service
-
Clone this repository:
# install telemetry branch git clone https://github.com/RedWvn/FlightMonitoringSystem.git cd telemetry
-
Allow scripts to execute:
chmod u+x scripts/setup.sh scripts/restart.sh
-
Create a python venv to prevent using system pacakges:
python -V # ensure that it's still 3.9.2 python -m venv .
-
Install packages:
pip install -r requirements.txt
-
Create a .env file in the project root. Use the .env File section at the bottom of this document to find examples.
-
Run the setup script:
sudo ./scripts/setup.sh --user <YOUR_USERNAME>
-
The setup and telemetry services should automatically start. If they don't, start them with:
sudo systemctl start setup_service sudo systemctl start telemetry_service
To check status:
sudo systemctl status <...>
To view logs:
sudo journalctl -fu <...>
-
(optional, but recommended) Test the setup process. If there is an error with sudo permissions in the final step (of restarting), try adding permissions to run
systemctl restart telemetry_service
to visudoJust below
root .....
, add this line to allow the refresh script to work.<YOUR_USERNAME> ALL=(ALL) NOPASSWD: /bin/systemctl restart telemetry_service ; for example: ubuntu ALL=NOPASSWD: /bin/systemctl restart telemetry_service
-
(optional) install cockpit to view processes and memory/CPU usage
. /etc/os-release sudo apt install -t ${VERSION_CODENAME}-backports cockpit
-
Follow steps 1 to 6 of Setup
-
To start the telemetry script, run
python telem_delay.py
(will work best only whensource ./bin/activate
is run) The script will connect to the specified drone and MQTT broker, then start publishing telemetry data. -
To test the setup script, run
python setup.py
Example .env
:
IP_ADDRESS=127.0.0.1:5760
AIRCRAFT_NAME=<CHANGE AIRCRAFT NAME>
MQTT_BROKER=hzn-01
MQTT_PORT=1883
MESSAGES_TO_LISTEN=HEARTBEAT,RANGEFINDER,VFR_HUD,BATTERY_STATUS,ATTITUDE,GLOBAL_POSITION_INT,GPS_RAW_INT,VIBRATION,EKF_STATUS_REPORT,SYS_STATUS,SERVO_OUTPUT_RAW
STATE_IN_MISSION = in_mission
STATE_LANDED = landed
STATE_ON_GROUND = on_ground
REPO_BRANCH=main
# Flight Launch Service Variables
SSID=22
GPS_2=true
BATTERY_CELLS=12
- IP_ADDRESS: TCP address to connect to the drone.
- AIRCRAFT_NAME: Aircraft name that shows up in the UI. Has to be unique
- MQTT_BROKER: Hostname of the MQTT broker server (hzn-01)
- MQTT_PORT: Port of MQTT broker. Usually 1883
- MESSAGES_TO_LISTEN: Keep this the same (
HEARTBEAT,RANGEFINDER,VFR_HUD,BATTERY_STATUS,ATTITUDE,GLOBAL_POSITION_INT,GPS_RAW_INT
) - STATE_IN_MISSION, STATE_LANDED, STATE_ON_GROUND: Keep this the same (
in_mission
,landed
,on_ground
) - REPO_BRANCH: The GitHub branch to track (here,
main
). Changing this will only cause bugs but will not change the branch being tracked. To change the branch, checkout to the other branch and then change this variable - Other
.env
variables are related to Flight Launch Service