0

Trying to connect a Redbear Blend Micro Arduino board over BLE from a Rasperry Pi B+ Raspbian Jessie kernel 4.1.13+ (also tried on wheezy w identical issue) Bluez 5.37

Tried several different ways of installing Bluez but in essence followed this http://www.elinux.org/RPi_Bluetooth_LE.

pi@raspberrypi:~ $ sudo hciconfig
hci0:   Type: BR/EDR  Bus: USB
    BD Address: 5C:F3:70:75:A3:EA  ACL MTU: 1021:8  SCO MTU: 64:1
    UP RUNNING 
    RX bytes:1722 acl:0 sco:0 events:85 errors:0
    TX bytes:788 acl:0 sco:0 commands:70 errors:0

pi@raspberrypi:~ $ sudo hcitool lescan
LE Scan ...
EC:EA:FA:D8:F9:77 BlendMicro
EC:EA:FA:D8:F9:77 BlendMicro

pi@raspberrypi:~ $ sudo gatttool -b EC:EA:FA:D8:F9:77 -t random -I
[EC:EA:FA:D8:F9:77][LE]> connect
Attempting to connect to EC:EA:FA:D8:F9:77
Error: connect: Connection refused (111)
[EC:EA:FA:D8:F9:77][LE]> 

The same procedure on my Ubuntu:

ubuntu:~$ sudo gatttool -b EC:EA:FA:D8:F9:77 -t random -I
[   ][EC:EA:FA:D8:F9:77][LE]> connect
[CON][EC:EA:FA:D8:F9:77][LE]> primary
[CON][EC:EA:FA:D8:F9:77][LE]> 
attr handle: 0x0001, end grp handle: 0x0007 uuid: 00001800-0000-1000-8000-00805f9b34fb
attr handle: 0x0008, end grp handle: 0x000b uuid: 00001801-0000-1000-8000-00805f9b34fb
attr handle: 0x000c, end grp handle: 0x0011 uuid: 713d0000-503e-4c75-ba94-3148f18d941e
attr handle: 0x0012, end grp handle: 0xffff uuid: 0000180a-0000-1000-8000-00805f9b34fb
[CON][EC:EA:FA:D8:F9:77][LE]>

What I tried: Different versions of Bluez5 installation and don't think that is the issue. I read that the Raspberian kernel version didn't support Bluez 5 and downgraded to 3.10.25+ which resulted in the Raspberry's USB ports being disconnected

https://www.raspberrypi.org/forums/viewtopic.php?f=28&t=120539&p=819468

Tried three different bluetooth dongles (including a plugable and a CSR) and they all give the same error on the RBi and works fine on the Ubuntu.

I'm aware of this stack posting.Cannot connect to BLE device on Raspberry Pi

Community
  • 1
  • 1
TomSjogren
  • 769
  • 10
  • 20

1 Answers1

0

This is solved.

Bluez 5 is not compatible with the default Kernel version 4.1.13 for Raspbian Jessie or Wheezy.

The solution is to step back to an earlier Kernel. In my case I first tried Kernel 3.10.25+ which killed all USB port on my RBi B+. Then downgraded to Kernel 3.12.36+ and that solved the issue and I can now connect from gatttool.

Downgrading is easy. Just do:

sudo rpi-update f74b92120e0d469fc5c2dc85b2b5718d877e1cbb
sudo reboot

And the connection below

pi@raspberrypi:~ $ sudo gatttool -b EC:EA:FA:D8:F9:77 -t random -I
[EC:EA:FA:D8:F9:77][LE]> connect
Attempting to connect to EC:EA:FA:D8:F9:77
Connection successful
[EC:EA:FA:D8:F9:77][LE]> primary
attr handle: 0x0001, end grp handle: 0x0007 uuid: 00001800-0000-1000-8000-00805f9b34fb
attr handle: 0x0008, end grp handle: 0x000b uuid: 00001801-0000-1000-8000-00805f9b34fb
attr handle: 0x000c, end grp handle: 0x0011 uuid: 713d0000-503e-4c75-ba94-3148f18d941e
attr handle: 0x0012, end grp handle: 0xffff uuid: 0000180a-0000-1000-8000-00805f9b34fb
TomSjogren
  • 769
  • 10
  • 20