Skip to content

Commit

Permalink
Keep container running for px4 update in Jamal-pro
Browse files Browse the repository at this point in the history
Removed old shell commands which were for the update with old
bootloader and didn't work anymore.

Added "tail -f /dev/null" to keep the container running in drone
so the px4 binaries are available when the update happens.
  • Loading branch information
TimoSairiala committed Apr 30, 2024
1 parent 053f925 commit f80b100
Show file tree
Hide file tree
Showing 2 changed files with 14 additions and 27 deletions.
20 changes: 2 additions & 18 deletions Tools/px_uploader.Dockerfile
Original file line number Diff line number Diff line change
Expand Up @@ -2,24 +2,8 @@ FROM python:alpine3.14

ARG saluki_fpga_directory
ARG SALUKI_FILE_INFO_JSON=saluki_file_info.json

# run this with something like:
#
# $ docker run --rm -it --network=host --device=/dev/ttyS7:/dev/px4serial px4-fw-updater \
# --udp-addr=192.168.200.101 \
# --udp-port=14541 \
# --port=/dev/px4serial \
# --baud-bootloader=2000000 \
# px4_fmu-v5_ssrc.px4

# This gets built in environment with somewhat unorthodox paths:
# - The build context is at /
# - The repository itself is mounted in /px4-firmware/
# - Built firmware files are in /bin/
#
# ("/" above is relative to GH action runner home dir)
# (see .github/workflows/tiiuae-pixhawk.yaml)

ARG PX4_EXPORT_DIR
ENV PX4_EXPORT_DIR=$PX4_EXPORT_DIR

COPY $saluki_fpga_directory /firmware/fpga
COPY $SALUKI_FILE_INFO_JSON /$SALUKI_FILE_INFO_JSON
Expand Down
21 changes: 12 additions & 9 deletions Tools/px_uploader.entrypoint
Original file line number Diff line number Diff line change
@@ -1,13 +1,16 @@
#!/bin/sh -e

aframe=""
if [ ! -z "$AIRFRAME" ]; then
aframe="--airframe ${AIRFRAME}"
# export px4 files if the container is started with the PX4_EXPORT_DIR
if [ -n "$PX4_EXPORT_DIR" ]; then
echo "Exporting PX4 files to $PX4_EXPORT_DIR"
echo "/firmware:"
ls -al /firmware/
echo "$PX4_EXPORT_DIR:"
ls -al $PX4_EXPORT_DIR
cp -r /firmware/* $PX4_EXPORT_DIR
echo "done"
fi

mode=""
if [ ! -z "$FLIGHT_MODE" ]; then
mode="--flightmode ${FLIGHT_MODE}"
fi

/bin/px_uploader.py --port=/dev/px4serial --udp-addr=192.168.200.101 --baud-flightstack=57600,115200,1000000,2000000 --baud-bootloader=2000000 px4_fmu-v5x_ssrc-*.px4 ssrc_saluki-v1_default-*.px4 ssrc_saluki-v2_default-*.px4
# keep the container running so px4 update can get the
# px4 firmware files from the container
tail -f /dev/null

0 comments on commit f80b100

Please sign in to comment.