Skip to content

Commit

Permalink
Tools: add mavftp
Browse files Browse the repository at this point in the history
  • Loading branch information
Williangalvani committed Oct 4, 2024
1 parent fe7bec6 commit b04b92f
Show file tree
Hide file tree
Showing 4 changed files with 24 additions and 1 deletion.
9 changes: 9 additions & 0 deletions core/services/ardupilot_manager/ArduPilotManager.py
Original file line number Diff line number Diff line change
Expand Up @@ -392,6 +392,15 @@ async def start_mavlink_manager(self, device: Endpoint) -> None:
persistent=True,
protected=True,
),
Endpoint(
name="MavFTP",
owner=self.settings.app_name,
connection_type=EndpointType.UDPClient,
place="127.0.0.1",
argument=14555,
persistent=True,
protected=True,
),
]
for endpoint in default_endpoints:
try:
Expand Down
1 change: 1 addition & 0 deletions core/start-blueos-core
Original file line number Diff line number Diff line change
Expand Up @@ -126,6 +126,7 @@ SERVICES=(
'nginx',250,"nice -18 nginx -g \"daemon off;\" -c $TOOLS_PATH/nginx/nginx.conf"
'log_zipper',250,"nice -20 $SERVICES_PATH/log_zipper/main.py '/shortcuts/system_logs/\\\\*\\\\*/\\\\*.log' --max-age-minutes 60"
'bag_of_holding',250,"$SERVICES_PATH/bag_of_holding/main.py"
'mavftp',250,"nice -19 /home/pi/tools/mavftp/pymavlink/mavftpfs.py --mountpoint /root/.config/ardupilot-manager/logs/mavftp"
)

tmux -f /etc/tmux.conf start-server
Expand Down
3 changes: 2 additions & 1 deletion core/tools/install-system-tools.sh
Original file line number Diff line number Diff line change
Expand Up @@ -11,11 +11,12 @@ TOOLS=(
logviewer
mavlink_camera_manager
scripts
mavftp
)

parallel --halt now,fail=1 '/home/pi/tools/{}/bootstrap.sh' ::: "${TOOLS[@]}"

# Tools that uses apt to do the installation
# APT is terrible like pip and don't know how to handle parallel installation
# These should periodically be moved onto the base image
apt update && apt install -y --no-install-recommends dhcpcd5 fuse libfuse2
apt update && apt install -y --no-install-recommends dhcpcd5 fuse libfuse2 git
12 changes: 12 additions & 0 deletions core/tools/mavftp/bootstrap.sh
Original file line number Diff line number Diff line change
@@ -0,0 +1,12 @@
#!/usr/bin/env bash
set -e
# TODO: all of this should be replaced with a single pip install once the pr at pymavlink is merged and there's a new version tagged
mkdir -p /home/pi/tools/mavftp
cd /home/pi/tools/mavftp
apt update && apt install -y git libxml2-dev libxslt-dev build-essential gcc zlib1g-dev
git clone --depth 1 https://github.com/Ardupilot/pymavlink.git
git clone --depth 1 https://github.com/Ardupilot/mavlink.git
cd pymavlink
pip install fusepy==3.0.1 lxml
MDEF="../mavlink/message_definitions" python -m pip install . -v
apt remove -y git build-essential && apt autoremove -y && apt clean -y

0 comments on commit b04b92f

Please sign in to comment.