Skip to content

Commit

Permalink
download_and_test: put the pluto into dfu mode, download & boot it.
Browse files Browse the repository at this point in the history
this reboots the pluto into dfu-mode, downloads the files, and then
boots the new image. Something when you are testing new images - you end
up doing alot. Enough times that I think I saved time by developing the
script.

Signed-off-by: Robin Getz <[email protected]>
  • Loading branch information
rgetz committed Dec 13, 2021
1 parent 4972bf5 commit c616ae6
Showing 1 changed file with 35 additions and 0 deletions.
35 changes: 35 additions & 0 deletions download_and_test.sh
Original file line number Diff line number Diff line change
@@ -0,0 +1,35 @@
#~/bin/sh
# This resets a connected pluto, loads firmware into ram, and boots it
#

#default IP address
ipaddr=192.168.2.1

if [ ! -f ./build/pluto.dfu ] ; then
echo no file to upload
exit
fi

ssh_cmd()
{
sshpass -v -panalog ssh -oStrictHostKeyChecking=no -oUserKnownHostsFile=/dev/null -oCheckHostIP=no root@${ipaddr} "$1" 2>/dev/null
if [ "$?" -ne "0" ] ; then
echo ssh command $1 failed
exit
fi
}
ssh_cmd "device_reboot ram"

lines=0
attempt=0
while [ "${lines}" -le "8" -a "${attempt}" -le "10" ]
do
lines=$(sudo dfu-util -l -d 0456:b673,0456:b674 | wc -l)
if [ "${lines}" -le "8" ] ; then
sleep 1
fi
((attempt++))
done

# -R resets/terminates the dfu after we are done
sudo dfu-util -R -d 0456:b673,0456:b674 -D ./build/pluto.dfu -a firmware.dfu

0 comments on commit c616ae6

Please sign in to comment.