Estoy viendo el siguiente comportamiento en un módulo HT-06 BT ( enlace ) conectado a un Arduino Uno .
El módulo funciona muy bien durante ~ 20 m y luego falla (la unidad parece apagarse; no se encienden luces en el dispositivo BT). Arduino sigue funcionando bien.
Periódicamente estoy consultando el dispositivo desde Python (PySerial) que se ejecuta en un OSX / MB a través de bluetooth integrado. Aquí hay un registro de la comunicación y puede ver el error después de 20m.
[!] 2015-03-05 15:15:01.344719
[x] Finding device and service port
[x] Attempting connection: (30:14:12:19:26:86) on (1)
[x] Blocking on recv
[x] Closing socket
^@^@^@^@^@
[!] 2015-03-05 15:20:00.766638
[x] Finding device and service port
[x] Attempting connection: (30:14:12:19:26:86) on (1)
[x] Blocking on recv
[x] Closing socket
^@^@^@^@^@
[!] 2015-03-05 15:25:01.265796
[x] Finding device and service port
[x] Attempting connection: (30:14:12:19:26:86) on (1)
[x] Blocking on recv
[x] Closing socket
^@^@^@^@
[!] 2015-03-05 15:30:00.787703
[x] Finding device and service port
[x] Attempting connection: (30:14:12:19:26:86) on (1)
[x] Blocking on recv
[x] Closing socket
^@^@^@^@^@^@
[!] 2015-03-05 15:35:00.795710
[x] Finding device and service port
[x] Attempting connection: (30:14:12:19:26:86) on (1)
Traceback (most recent call last):
File "/Users/test.py", line 28, in <module>
raise serr
socket.error: [Errno -536870195] Cannot connect to 1 on 30:14:12:19:26:86
^@^@^@^@^@
[!] 2015-03-05 15:40:01.194140
[x] Finding device and service port
[x] Attempting connection: (30:14:12:19:26:86) on (1)
Traceback (most recent call last):
File "/Users/test.py", line 28, in <module>
raise serr
socket.error: [Errno -536870195] Cannot connect to 1 on 30:14:12:19:26:86
^@^@^@^@^@
[!] 2015-03-05 15:45:00.857675
[x] Finding device and service port
[x] Attempting connection: (30:14:12:19:26:86) on (1)
Traceback (most recent call last):
File "/Users/test.py", line 28, in <module>
raise serr
socket.error: [Errno -536870195] Cannot connect to 1 on 30:14:12:19:26:86
Como puede ver, una vez que falla, nunca se recupera. Alguien tiene ideas de cómo remediar esto. Intentaré diagnosticar con otro módulo BT (tengo algunos) para ver si se trata de un comportamiento erróneo de un dispositivo defectuoso o un problema en mi arquitectura general.
TIA! (¡Gracias de antemano!)
ACTUALIZAR
Parece que no tiene nada que ver con el tiempo y más con el número de solicitudes antes de fallar. Por ejemplo, aumenté la frecuencia para ejecutar cada 2 minutos y se puede ver que, después de 4x intentos, la placa BT falla:
[!] 2015-03-05 19:16:00.679951
[x] Finding device and service port
[x] Attempting connection: (30:14:10:14:11:85) on (1)
[x] Blocking on recv
[x] Closing socket
[x] Nothing consumed (0), exit
^@^@
[!] 2015-03-05 19:18:00.835225
[x] Finding device and service port
[x] Attempting connection: (30:14:10:14:11:85) on (1)
[x] Blocking on recv
[x] Closing socket
[x] Nothing consumed (0), exit
^@^@
[!] 2015-03-05 19:20:01.161330
[x] Finding device and service port
[x] Attempting connection: (30:14:10:14:11:85) on (1)
[x] Blocking on recv
[x] Closing socket
[x] Nothing consumed (0), exit
^@
[!] 2015-03-05 19:22:01.499951
[x] Finding device and service port
[x] Attempting connection: (30:14:10:14:11:85) on (1)
[x] Blocking on recv
[x] Closing socket
[x] Nothing consumed (0), exit
^@^@
[!] 2015-03-05 19:24:01.119598
[x] Finding device and service port
[x] Attempting connection: (30:14:10:14:11:85) on (1)
Traceback (most recent call last):
File "/Users/test.py", line 28, in <module>
raise serr
socket.timeout: connect timed out
^@/Library/Python/2.7/site-packages/lightblue/_lightblue.py:88: UserWarning: findservices() couldn't get services for : Timed out getting services for
warnings.warn(msg)
Una vez más, una vez que falla, nunca se recuperará.