2

I am using noble & bleno via node.js to connect to a BLE peripheral from Rasbian, yet something goes wrong and the connection can not be made. I tried multiple different BLE dongles and they all fail the same way. Currently I have a CSR 4.0 attached. The connections works just fine when being made from OS X, iOS or Android.

Here is the HCI Dump:

2015-11-22 18:36:54.732907 < HCI Command: LE Create Connection (0x08|0x000d) plen 25
bdaddr 00:12:6F:6B:C7:32 type 0
interval 96 window 48 initiator_filter 0
own_bdaddr_type 0 min_interval 6 max_interval 12
latency 0 supervision_to 200 min_ce 4 max_ce 6

2015-11-22 18:36:54.734511 > HCI Event: Command Status (0x0f) plen 4
LE Create Connection (0x08|0x000d) status 0x0c ncmd 1
Error: Command Disallowed

Now when I try a connection via hcitool lecc or gatttool the connection is made - yet trying to write characteristic values fails with Characteristic Write Request failed: Attribute requires authentication before read/write. Is this related?

I am on Linux raspberrypi 4.1.13+ #826 PREEMPT Fri Nov 13 20:13:22 GMT 2015 armv6l GNU/Linux

paulgavrikov
  • 1,883
  • 3
  • 29
  • 51
  • You simply do not have access to those commands. Try running it with `sudo` or as root. The Write Request Failed is because of the security used, which you could have easily found [here](http://stackoverflow.com/questions/24046351/attribute-requires-authentication-before-read-write) or [here](http://stackoverflow.com/questions/30896386/bluetooth-low-energy-listening-for-notifications-indications-on-raspberry-pi-b) – Zimano Dec 21 '15 at 10:38
  • I am running under su & had tried all security levels - din't help. But I found the problem. Will update it – paulgavrikov Dec 21 '15 at 13:40
  • That's great! Do post it in a new answer though :) – Zimano Dec 21 '15 at 13:41

1 Answers1

2

Unfortunately even security-level high or medium didn't help.

The issue was, that I had a connection from a Central (RPi is Peripheral) and I wanted to connect to another Peripheral, which would put the RPi into Central mode. Apparently this doesn't work with BlueZ. So I ended up with using 2 Bluetooth Dongles.

If you are looking for another OS: Mac OS X does support this though.

Also I was told that Bluetooth 4.1 Dongles might work with this.

paulgavrikov
  • 1,883
  • 3
  • 29
  • 51