2021-11-22 12:17:48 -04:00
|
|
|
#! /bin/bash
|
|
|
|
|
|
|
|
# exit when any command fails
|
|
|
|
set -e
|
|
|
|
|
|
|
|
DIR=$( cd "$( dirname "${BASH_SOURCE[0]}" )" && pwd )
|
|
|
|
|
|
|
|
SERIAL_DEVICE=$1
|
|
|
|
|
|
|
|
if [ ! -e "${SERIAL_DEVICE}" ]
|
|
|
|
then
|
|
|
|
echo "Invalid serial device ${SERIAL_DEVICE}"
|
|
|
|
exit -1
|
|
|
|
fi
|
|
|
|
|
|
|
|
# all airframes (from ROMFS/px4fmu_common/init.d/airframes/)
|
|
|
|
# $(find . -regex '.*/[0-9].*' -exec basename {} \; | cut -d "_" -f 1)
|
|
|
|
ALL_AIRFRAMES=${@:2}
|
|
|
|
echo "airframes: ${ALL_AIRFRAMES}"
|
|
|
|
|
|
|
|
for airframe in $ALL_AIRFRAMES
|
|
|
|
do
|
|
|
|
echo
|
2022-01-08 15:54:55 -04:00
|
|
|
echo
|
|
|
|
echo
|
|
|
|
echo "########################################################################################################################"
|
2021-11-22 12:17:48 -04:00
|
|
|
echo " Airframe: $airframe"
|
2022-01-08 15:54:55 -04:00
|
|
|
echo "########################################################################################################################"
|
2021-11-22 12:17:48 -04:00
|
|
|
echo
|
|
|
|
|
|
|
|
${DIR}/nsh_param_set.py --device ${SERIAL_DEVICE} --name SYS_AUTOSTART --value $airframe
|
|
|
|
${DIR}/nsh_param_set.py --device ${SERIAL_DEVICE} --name CBRK_BUZZER --value 782097
|
2022-01-08 15:54:55 -04:00
|
|
|
|
|
|
|
# enable all mavlink instances
|
|
|
|
${DIR}/run_nsh_cmd.py --device ${SERIAL_DEVICE} --cmd 'param set MAV_0_CONFIG 101' || true
|
|
|
|
${DIR}/run_nsh_cmd.py --device ${SERIAL_DEVICE} --cmd 'param set MAV_1_CONFIG 102' || true
|
|
|
|
${DIR}/run_nsh_cmd.py --device ${SERIAL_DEVICE} --cmd 'param set MAV_2_CONFIG 103' || true
|
|
|
|
|
|
|
|
# enable all GPS
|
|
|
|
${DIR}/run_nsh_cmd.py --device ${SERIAL_DEVICE} --cmd 'param set GPS_1_CONFIG 201' || true
|
|
|
|
${DIR}/run_nsh_cmd.py --device ${SERIAL_DEVICE} --cmd 'param set GPS_1_CONFIG 202' || true
|
|
|
|
|
2021-11-22 12:17:48 -04:00
|
|
|
${DIR}/run_nsh_cmd.py --device ${SERIAL_DEVICE} --cmd 'param reset SYS_HITL'
|
2021-12-23 15:30:55 -04:00
|
|
|
${DIR}/run_nsh_cmd.py --device ${SERIAL_DEVICE} --cmd 'param status'
|
2021-11-22 12:17:48 -04:00
|
|
|
${DIR}/run_nsh_cmd.py --device ${SERIAL_DEVICE} --cmd 'param save'
|
2022-12-19 18:09:23 -04:00
|
|
|
${DIR}/run_nsh_cmd.py --device ${SERIAL_DEVICE} --cmd 'bsondump /fs/mtd_params'
|
2021-11-22 12:17:48 -04:00
|
|
|
|
|
|
|
${DIR}/reboot.py --device ${SERIAL_DEVICE}
|
|
|
|
|
2022-01-17 11:49:38 -04:00
|
|
|
${DIR}/run_nsh_cmd.py --device ${SERIAL_DEVICE} --cmd 'param status'
|
2022-12-19 18:09:23 -04:00
|
|
|
${DIR}/run_nsh_cmd.py --device ${SERIAL_DEVICE} --cmd 'bsondump /fs/mtd_params' || true
|
|
|
|
${DIR}/run_nsh_cmd.py --device ${SERIAL_DEVICE} --cmd 'bsondump /fs/microsd/parameters_backup.bson' || true
|
2021-12-30 12:31:44 -04:00
|
|
|
|
2021-11-22 12:17:48 -04:00
|
|
|
${DIR}/run_nsh_cmd.py --device ${SERIAL_DEVICE} --cmd 'ps'
|
|
|
|
${DIR}/run_nsh_cmd.py --device ${SERIAL_DEVICE} --cmd 'work_queue status'
|
|
|
|
|
2023-01-21 12:38:39 -04:00
|
|
|
${DIR}/run_nsh_cmd.py --device ${SERIAL_DEVICE} --cmd 'mavlink status' || true
|
2022-01-08 15:54:55 -04:00
|
|
|
${DIR}/run_nsh_cmd.py --device ${SERIAL_DEVICE} --cmd 'mavlink stop-all'
|
2023-01-21 12:06:21 -04:00
|
|
|
|
2021-11-22 12:17:48 -04:00
|
|
|
done
|