Hi everyone,
I intend to build a remote controle using HC-05 (ZS-040) bluetooth module. I need it to act as master in bluetooth connection, and using it I have problem to connect to certain slave devices - I highlight that only to some of them, to the others no problem. Also no problem when HC-05 acts as slave, see following table:
| second device | HC-05 as master | HC-05 as slave | Sony Ericsson K550i as master |
|---|---|---|---|
| notebook (Ubuntu 14.04) with Foxcon Broadcom BCM20702 bluetooth chip | FAIL | OK | OK |
| bluetooth dongle Conwise CW6622, MBT-503-03 | FAIL | OK | OK |
| bluetooth dongle Asus BT400 | FAIL | OK | FAIL |
| mobile phone Sony Ericsson K550i | OK | OK | - |
| bluetooth module ConnectBlue OBS410i | OK | not tested | OK |
On HC-05 in AT mode I first pair the devices, it is all right, and then issue the LINK command, which fails. The communication with HC-05 looks like:
AT+ROLE=1
OK
AT+PAIR=1234,56,abcdef,20
OK
AT+LINK=1234,56,abcdef
FAIL
On notebook (Ubuntu 14.04) I run bluetooth daemon in verbose mode by commad
sudo bluetoothd -nd
and get error log like:
bluetoothd[6803]: plugins/mgmtops.c:mgmt_event() cond 1
bluetoothd[6803]: plugins/mgmtops.c:mgmt_event() Received 36 bytes from management socket
bluetoothd[6803]: plugins/mgmtops.c:mgmt_device_connected() hci0 device 98:D3:31:90:5F:A4 connected eir_len 17
bluetoothd[6803]: src/adapter.c:adapter_get_device() 98:D3:31:90:5F:A4
bluetoothd[6803]: plugins/mgmtops.c:mgmt_event() cond 1
bluetoothd[6803]: plugins/mgmtops.c:mgmt_event() Received 14 bytes from management socket
bluetoothd[6803]: plugins/mgmtops.c:mgmt_device_disconnected() hci0 device 98:D3:31:90:5F:A4 disconnected
bluetoothd[6803]: src/event.c:btd_event_disconn_complete()
bluetoothd[6803]: src/adapter.c:adapter_remove_connection()
I cannot see there any error, it looks like HC-05 disconnects itself, but only on computer. The question I am not able to answer is: why? And how to debug, what happens on HC-05?
Comments under line:
- Asus BT400 dongle seems crappy, not working for any device
- I tested both dongles both on ubuntu and windows - with exactly the same result
- I played also with AT+SENM command - security and encryption on HC-05, with no result