Closed davidmann4 closed 8 years ago
@davidmann4 interesting, I don't have any issues with my Nexus 7 running 5.1.1with nRF master control panel and Raspberry Pi kernel 4.0.9+.
Could you also please provide an hcidump capture? sudo hcidump -t -x
One thing to try is changing the GAP flags, maybe try 0x05 instead of 0x06: https://github.com/sandeepmistry/bleno/blob/master/lib/hci-socket/gap.js#L120
BLUEZ version - maybe also interessting
pi@raspberrypi ~ $ sudo apt-cache policy bluez
bluez:
Installed: 5.23-2+b1
Candidate: 5.23-2+b1
Version table:
*** 5.23-2+b1 0
500 http://mirrordirector.raspbian.org/raspbian/ jessie/main armhf Packages
100 /var/lib/dpkg/status
pi@raspberrypi ~ $ sudo hcidump -t -x
HCI sniffer - Bluetooth packet analyzer ver 5.23
device: hci0 snap_len: 1500 filter: 0xffffffff
2015-10-03 21:25:56.957443 < HCI Command: LE Set Advertise Enable (0x08|0x000a) plen 1
00
2015-10-03 21:25:56.959661 > HCI Event: Command Complete (0x0e) plen 4
LE Set Advertise Enable (0x08|0x000a) ncmd 1
status 0x00
2015-10-03 21:26:02.464363 < HCI Command: Set Event Mask (0x03|0x0001) plen 8
Mask: 0xfffffbff07f8bf3d
2015-10-03 21:26:02.465440 > HCI Event: Command Complete (0x0e) plen 4
Set Event Mask (0x03|0x0001) ncmd 1
status 0x00
2015-10-03 21:26:02.465540 < HCI Command: LE Set Event Mask (0x08|0x0001) plen 8
mask 0x1f00000000000000 (Reserved)
2015-10-03 21:26:02.467443 > HCI Event: Command Complete (0x0e) plen 4
LE Set Event Mask (0x08|0x0001) ncmd 1
status 0x00
2015-10-03 21:26:02.467526 < HCI Command: Read Local Version Information (0x04|0x0001) plen 0
2015-10-03 21:26:02.480454 > HCI Event: Command Complete (0x0e) plen 12
Read Local Version Information (0x04|0x0001) ncmd 1
status 0x00
HCI Version: 4.0 (0x6) HCI Revision: 0x1d86
LMP Version: 4.0 (0x6) LMP Subversion: 0x1d86
Manufacturer: Cambridge Silicon Radio (10)
2015-10-03 21:26:02.480647 < HCI Command: Read BD ADDR (0x04|0x0009) plen 0
2015-10-03 21:26:02.482435 > HCI Event: Command Complete (0x0e) plen 10
Read BD ADDR (0x04|0x0009) ncmd 1
status 0x00 bdaddr 00:1A:7D:DA:71:13
2015-10-03 21:26:02.519313 < HCI Command: LE Set Advertise Enable (0x08|0x000a) plen 1
00
2015-10-03 21:26:02.520445 > HCI Event: Command Complete (0x0e) plen 4
LE Set Advertise Enable (0x08|0x000a) ncmd 1
status 0x0c
Error: Command Disallowed
2015-10-03 21:26:02.521130 < HCI Command: LE Set Advertising Parameters (0x08|0x0006) plen 15
min 100.000ms, max 100.000ms
type 0x00 (ADV_IND - Connectable undirected advertising) ownbdaddr 0x00 (Public)
directbdaddr 0x00 (Public) 00:00:00:00:00:00
channelmap 0x07 filterpolicy 0x00 (Allow scan from any, connection from any)
2015-10-03 21:26:02.522484 > HCI Event: Command Complete (0x0e) plen 4
LE Set Advertising Parameters (0x08|0x0006) ncmd 1
status 0x00
2015-10-03 21:26:02.542100 < HCI Command: LE Set Scan Response Data (0x08|0x0009) plen 32
06 05 08 74 65 73 74 00 00 00 00 00 00 00 00 00 00 00 00 00
00 00 00 00 00 00 00 00 00 00 00 00
2015-10-03 21:26:02.543459 > HCI Event: Command Complete (0x0e) plen 4
LE Set Scan Response Data (0x08|0x0009) ncmd 1
status 0x00
2015-10-03 21:26:02.543635 < HCI Command: LE Set Advertising Data (0x08|0x0008) plen 32
15 02 01 06 11 06 F0 FF FF FF FF FF FF FF FF FF FF FF FF FF
FF FF 00 00 00 00 00 00 00 00 00 00
2015-10-03 21:26:02.545459 > HCI Event: Command Complete (0x0e) plen 4
LE Set Advertising Data (0x08|0x0008) ncmd 1
status 0x00
2015-10-03 21:26:02.545555 < HCI Command: LE Set Advertise Enable (0x08|0x000a) plen 1
01
2015-10-03 21:26:02.547437 > HCI Event: Command Complete (0x0e) plen 4
LE Set Advertise Enable (0x08|0x000a) ncmd 1
status 0x00
2015-10-03 21:26:02.547512 < HCI Command: LE Set Scan Response Data (0x08|0x0009) plen 32
06 05 08 74 65 73 74 00 00 00 00 00 00 00 00 00 00 00 00 00
00 00 00 00 00 00 00 00 00 00 00 00
2015-10-03 21:26:02.549446 > HCI Event: Command Complete (0x0e) plen 4
LE Set Scan Response Data (0x08|0x0009) ncmd 1
status 0x00
2015-10-03 21:26:02.549565 < HCI Command: LE Set Advertising Data (0x08|0x0008) plen 32
15 02 01 06 11 06 F0 FF FF FF FF FF FF FF FF FF FF FF FF FF
FF FF 00 00 00 00 00 00 00 00 00 00
2015-10-03 21:26:02.551443 > HCI Event: Command Complete (0x0e) plen 4
LE Set Advertising Data (0x08|0x0008) ncmd 1
status 0x00
hmm also funny is that he does not output anything when I start the script first and then run the dump command and take my nexus5 and connect - seems like I get no connection at all!
Cpi@raspberrypi ~ $ sudo hcidump -t -x
HCI sniffer - Bluetooth packet analyzer ver 5.23
device: hci0 snap_len: 1500 filter: 0xffffffff
changed gap flags without any success - hmm maybe change BLUEZ ?
do you have any good guide how to switch it to another version?
solved the issue - i was still paired with the MAC of my dongl from pybluez
removed the paired device on android and it worked!
thank you for your input - have to read about the GAP stuff ... what did it changed?(pretty sure it was not the issue anyways ... )
@davidmann4 cool, thanks for the follow up.
I don't think you need the GAP flag change I suggested, you can read up on in in the Core Specification ...
do you use some kind of stratup script on your pi to disable bluetoothd?
@davidmann4 I just run the stock BlueZ 4.99 bluetoothd, then there's no need to disable it.
Some options to disable:
1) sudo chmod -x /usr/sbin/bluetoothd
2) update-rc.d bluetooth disable
P.S.: It's best to ask general questions like this on Gitter: https://gitter.im/sandeepmistry/bleno
maybe similar to #119 - tried everything what you mentioned there
I would like to connect to my Raspberry PI 2 from my Nexus 5 (Android)
my setup:
Raspberrypi 2 with Bus 001 Device 006: ID 0a12:0001 Cambridge Silicon Radio, Ltd Bluetooth Dongle (HCI mode)
when I try to connect I hang at connecting...
thx for your effort - I already tried bluepy and pyBluez - they had no good BLE support ... your lib looks promissing :+1: