fix bebop upload script

This commit is contained in:
Bart Slinger
2019-05-11 14:39:42 +01:00
committed by Lorenz Meier
parent e80d3940a6
commit ebf8bc898a
5 changed files with 43 additions and 7 deletions
+1 -1
View File
@@ -39,7 +39,7 @@ add_subdirectory(flow)
############################################################################
add_custom_target(upload
COMMAND ${CMAKE_CURRENT_SOURCE_DIR}/scripts/adb_upload_to_bebop.sh ${CMAKE_RUNTIME_OUTPUT_DIRECTORY}/. /data/ftp/internal_000
COMMAND ${CMAKE_CURRENT_SOURCE_DIR}/scripts/adb_upload_to_bebop.sh ${CMAKE_RUNTIME_OUTPUT_DIRECTORY}/bin/. /data/ftp/internal_000/px4
DEPENDS px4
COMMENT "uploading px4"
USES_TERMINAL
+32
View File
@@ -0,0 +1,32 @@
#!/bin/bash
if [[ "$#" < 2 ]]; then
echo "usage: adb_upload.sh SRC1 [SRC2 ...] DEST"
exit
fi
# Get last argument
for last; do true; done
echo "Wait for device..."
adb wait-for-device
echo "Creating folder structure..."
adb shell mkdir -p $last
echo "Uploading..."
# Go through source files and push them one by one.
i=0
for arg
do
if [[ $((i+1)) == "$#" ]]; then
break
fi
echo "Pushing $arg to $last"
adb push $arg $last
((i+=1))
done
# Make sure they are synced to the file system
echo "Syncing FS..."
adb shell sync
@@ -1,7 +1,7 @@
#!/bin/bash
BASEDIR="$( cd "$( dirname "${BASH_SOURCE[0]}" )" && pwd )"
SRC_DIR="$BASEDIR/../"
SRC_DIR="$BASEDIR/../../../../"
if [ -z ${BEBOP_IP+x} ]; then
ip=192.168.42.1
@@ -65,3 +65,7 @@ adb shell sync
echo "Disconnecting from Bebop"
adb disconnect
echo ""
echo "To start PX4, run the following command on the Bebop:"
echo "/data/ftp/internal_000/px4/px4 -s /home/root/px4.config /data/ftp/internal_000/px4/"