travisgoodspeed/PyMetaWatch — Issue #3: rfcomm close issues
Author: robomotic
Created: 2011-11-04 15:09:23+00:00
State: open

Hello Travis,
I really love your python port for the metawatch.
I have found a sort of bug, this is my code:
try:
while True:
mw.idle()
#check command line input
c = getkey()
if c == 'q': ## break on a Return/Enter keypress
print 'Command Quit'
break
if c == 'v': ## break on a Return/Enter keypress
print 'Command Vibra'
mw.buzz()
if c == 'm': ## break on a Return/Enter keypress
print 'Medication reminder'
mw.writeText(mode,'Remember Pill XYZ')
mw.updatedisplay(mode)
if c == 's': ## break on a Return/Enter keypress
print 'Command Sound'
mw.buzz()

except KeyboardInterrupt:

mode=0
mw.updatedisplay(mode)
pass

mw.close();

Every time I close either via Q key press or with a CTRL+C, if I try to reconnect I get a:
bluetooth.btcommon.BluetoothError: (112, 'Host is down')

The watch stays unresponsive and shows only the time and the pda icon with an x.
The only way to reactivate it is to reset via mspdebugger.
I'm using the last firmware.
The rfcomm seems fine:
epokh@epokh-quad:~/programs/PyMetaWatch$ rfkill list
0: phy0: Wireless LAN
Soft blocked: no
Hard blocked: no
1: hci0: Bluetooth
Soft blocked: no
Hard blocked: no
Not sure what is going on the watch!