diff --git a/Tools/adb_upload_to_bebop.sh b/Tools/adb_upload_to_bebop.sh index ce0144ae69..99d2df5898 100755 --- a/Tools/adb_upload_to_bebop.sh +++ b/Tools/adb_upload_to_bebop.sh @@ -1,6 +1,9 @@ #!/bin/bash -if [ -z ${BEBOP_IP+x} ]; then +BASEDIR="$( cd "$( dirname "${BASH_SOURCE[0]}" )" && pwd )" +SRC_DIR="$BASEDIR/../" + +if [ -z ${BEBOP_IP+x} ]; then ip=192.168.42.1 echo "\$BEBOP_IP is not set (use default: $ip)" else @@ -42,7 +45,13 @@ if [[ $adb_return == "" ]]; then restart_px4=true fi -$(dirname "$0")/adb_upload.sh $@ +# upload PX4 +$BASEDIR/adb_upload.sh $@ + +# upload mixer and config files +echo "Uploading mixer and config files to /home/root" +adb push $SRC_DIR/ROMFS/px4fmu_common/mixers/bebop.main.mix /home/root +adb push $SRC_DIR/posix-configs/bebop/px4.config /home/root # restart the process after uploading if [ "$restart_px4" = true ]; then @@ -50,5 +59,9 @@ if [ "$restart_px4" = true ]; then adb shell /etc/init.d/rcS_mode_default 2>/dev/null 1>/dev/null & fi +# make sure all buffered blocks are written to disk +echo "Syncing FS..." +adb shell sync + echo "Disconnecting from Bebop" adb disconnect