Hi,
thank you for this great lib. It works great, but if you leave the myo alone, it will automatically disconnect and never will come back again.
Myo Firmware Version: 1.1.755.2
Therefore I decided to modify your lib.
In the myo_raw.py I've replaced in function Main (line 463):
if m.run(1) is None:
print("Connection lost, try to reconnect")
m.connect()
else:
In the classify_myo.py I've replaced in function Main (line 48):
ltime = time.time() #Set initial lasttime for further timeout
timeout = 1 #Timeout in seconds
try:
while True:
if time.time() > (ltime + timeout):
print("Connection lost, try to reconnect")
m.connect()
ltime = time.time() #Set lasttime for further timeout
else:
ltime = time.time() #Set lasttime for further timeout
m.run()
The same for the function main in myo.py (line 113)
ltime = time.time() #Set initial lasttime for further timeout
timeout = 1 #Timeout in seconds
while True:
if time.time() > (ltime + timeout):
print("Connection lost, try to reconnect")
m.connect()
ltime = time.time() #Set lasttime for further timeout
else:
ltime = time.time() #Set lasttime for further timeout
m.run()
With this modifications myo will reconnect after a few seconds.
Don't know how to uploads Commits.
Hi, thank you for this great lib. It works great, but if you leave the myo alone, it will automatically disconnect and never will come back again. Myo Firmware Version: 1.1.755.2 Therefore I decided to modify your lib.
In the myo_raw.py I've replaced in function Main (line 463):
...and changed function run (line 194) to:
In the classify_myo.py I've replaced in function Main (line 48):
The same for the function main in myo.py (line 113)
With this modifications myo will reconnect after a few seconds. Don't know how to uploads Commits.
Best regards garphi