Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

Improve ping scripts #295

Merged
merged 3 commits into from
Jan 14, 2020
Merged
Show file tree
Hide file tree
Changes from all commits
Commits
File filter

Filter by extension

Filter by extension

Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
3 changes: 3 additions & 0 deletions scripts/post-update.sh
Original file line number Diff line number Diff line change
Expand Up @@ -296,6 +296,9 @@ PRE_0_0_19=$(( git rev-list --count --left-right 0.0.18...revert-point || echo 0

if (( $PRE_0_0_19 > 0 )); then
echo "config-server" > /home/pi/network.conf

# Use the last version of bluerobotics-ping
sudo pip install bluerobotics-ping==0.0.10 --upgrade --force-reinstall
fi

echo 'Update Complete, refresh your browser'
Expand Down
4 changes: 2 additions & 2 deletions tools/PingBootloader.py
Original file line number Diff line number Diff line change
Expand Up @@ -15,7 +15,7 @@
# we shut down the proxy before communicating with the device
# then restart the proxy when we are finished

from brping import Ping1D, PingMessage, pingmessage
from brping import Ping1D, PingMessage, definitions
import platform
import time
import os
Expand Down Expand Up @@ -48,7 +48,7 @@

# send ping device to bootloader
print("Sending device to bootloader...")
bootloader_msg = PingMessage(pingmessage.PING1D_GOTO_BOOTLOADER)
bootloader_msg = PingMessage(definitions.PING1D_GOTO_BOOTLOADER)
bootloader_msg.pack_msg_data()
myPing.iodev.write(bootloader_msg.msg_data)

Expand Down
7 changes: 6 additions & 1 deletion tools/ping_enumerator.py
Original file line number Diff line number Diff line change
Expand Up @@ -36,7 +36,12 @@ def detect_device(self, dev):
device was not detected
"""

ping = PingDevice("/dev/serial/by-id/" + dev, 115200)
try:
ping = PingDevice("/dev/serial/by-id/" + dev, 115200)
except Exception as exception:
print("An exception has occurred: ", exception)
return None

if not ping.initialize():
return None

Expand Down