2018-04-07 00:00:04 +00:00
|
|
|
#!/usr/bin/env python
|
2016-08-12 15:12:16 +00:00
|
|
|
import serial.tools.list_ports
|
|
|
|
done = False
|
|
|
|
|
|
|
|
for port in serial.tools.list_ports.comports():
|
2016-08-26 10:13:33 +00:00
|
|
|
if "483:5740" in port[2]:
|
2017-09-08 10:51:39 +00:00
|
|
|
print ("Reseting stmbl at " + port[2])
|
2017-12-06 17:33:16 +00:00
|
|
|
try:
|
|
|
|
stmbl = serial.Serial(port[0])
|
2018-04-07 00:00:04 +00:00
|
|
|
stmbl.write('bootloader\n'.encode())
|
2017-12-06 17:33:16 +00:00
|
|
|
stmbl.close()
|
|
|
|
done = True
|
|
|
|
except OSError:
|
|
|
|
print ("Cannot open port, check permissions, or disconnect Servoterm")
|
|
|
|
done = True
|
2016-08-12 15:12:16 +00:00
|
|
|
|
|
|
|
if not done:
|
2017-09-10 11:59:15 +00:00
|
|
|
print ("No boards found, or board is already in bootloader")
|