Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

Doesn't work with 3.10 kernel on raspbery pi #18

Closed
lazka opened this issue Jan 21, 2014 · 16 comments
Closed

Doesn't work with 3.10 kernel on raspbery pi #18

lazka opened this issue Jan 21, 2014 · 16 comments

Comments

@lazka
Copy link

lazka commented Jan 21, 2014

Since the kernel update bleno doesn't get any data. I've enabled debug (DEBUG='*') output and I see nothing when trying to connect.

@lazka
Copy link
Author

lazka commented Jan 21, 2014

This one works: raspberrypi-bootloader_1.20130902-1 (kenrel 3.6)
This one doesn't: raspberrypi-bootloader_1.20131209-1 (kernel 3.10)

http://archive.raspberrypi.org/debian/pool/main/r/raspberrypi-firmware/

@zdennis
Copy link

zdennis commented Jan 21, 2014

The 3.6.11+ kernel works fine.

Do you need to re-build libbluetooth-dev or bluez at all?

@lazka
Copy link
Author

lazka commented Jan 21, 2014

I didn't rebuild anything between kernel changes if that's what you mean (I also don't have bluez installed)
I can also confirm on my debian sid dev machine that 3.6 works but 3.12 doesn't.

May I ask what you use to connect to bleno? I'm using android 4.3/4.4

@zdennis
Copy link

zdennis commented Jan 21, 2014

@lazka, I'm connecting with an iOS7 device using CoreBluetooth. I haven't with Android yet.

@sandeepmistry
Copy link
Collaborator

Which version of BlueZ are you using? I'm using the stock 4.99 on mine, see uname output below:

pi@raspberrypi ~ $ uname -a
Linux raspberrypi 3.6.11+ #474 PREEMPT Thu Jun 13 17:14:42 BST 2013 armv6l GNU/Linux

I can also connect from my Nexus 7 running 4.4. I've heard about issues with BLE and Android - see issue #6.

Is there an easy way to switch kernel versions?

@pdominique
Copy link

Lazka > I have an issue that might be similar: when I run the test-ibeacon.js application I can see the beacon on my Android app (iBeacon Locate on Android 4.4) or iPhone app (iLocate) only for a few seconds and then it disappears from the list. I just got my Pi and I installed Raspbian via NOOBS 1.3.4. My kernel is:

Linux raspberrypi 3.10.27+ #630 PREEMPT Fri Jan 17 19:44:36 GMT 2014 armv6l GNU/Linux

@pdominique
Copy link

Just to confirm that my issue is also gone now that I use kernel 3.6.11+ instead of 3.10.27+.

@sandeepmistry
Copy link
Collaborator

Thanks @pdominique I'll get a another SD setup for my RPi to try out the 3.10 kernel.

@sandeepmistry
Copy link
Collaborator

Changing the following in hci-ble.c seems to makes things work on kernel 3.10.x

// set advertisement and scan data
hci_le_set_advertising_data(hciSocket, (uint8_t*)&advertisementDataBuf, advertisementDataLen, 1000); 
hci_le_set_scan_response_data(hciSocket, (uint8_t*)&scanDataBuf, scanDataLen, 1000);

// start advertising
hci_le_set_advertise_enable(hciSocket, 1, 1000);

to

// set scan data
hci_le_set_scan_response_data(hciSocket, (uint8_t*)&scanDataBuf, scanDataLen, 1000);

// start advertising
hci_le_set_advertise_enable(hciSocket, 1, 1000);

// set advertisement data
hci_le_set_advertising_data(hciSocket, (uint8_t*)&advertisementDataBuf, advertisementDataLen, 1000); 

followed by a node-gyp rebuild.

Need to verify this doesn't break anything in kernel 3.6.x before pushing to master.

@lazka
Copy link
Author

lazka commented Jan 25, 2014

Thanks for looking into this, I'll give it a try.

btw I did use hcitool to set up advertising and disabled it in bleno, but maybe it's the same problem there.

@lazka
Copy link
Author

lazka commented Feb 3, 2014

I can confirm that the above mentioned change makes it work here with kernel 3.12.8 and libbluetooth 4.101

Thanks!

@joelind
Copy link

joelind commented Feb 3, 2014

Has anybody tried this with Bluez 5? I am not able to connect with Bluez 5
/ Kernel 3.12, but the same code runs fine on Bluez 4.101 and Kernel 3.9.

On Mon, Feb 3, 2014 at 8:00 AM, Christoph Reiter
notifications@github.comwrote:

I can confirm that the above mentioned change makes it work here with
kernel 3.12.8 and libbluetooth 4.101

Thanks!

Reply to this email directly or view it on GitHubhttps://github.com//issues/18#issuecomment-33952114
.

@lazka
Copy link
Author

lazka commented Feb 3, 2014

@joelind I've just checked with libbluetooth 5.5 (what's in debian experimental.. 5.14 would be the newest) and it also works.

Make sure to disable/enable bluetooth on Android before testing.

@sandeepmistry
Copy link
Collaborator

Thanks @lazka, have you had a chance to try kernel 3.6 with the change? I still haven't had a chance to try it out, hopefully I get a chance by the end of the weekend.

@joelind someone emailed me with the same issue running BlueZ 5.14 on Fedora 20. Can you try stopping bluetoothd? I'm thinking it might be listening for ATT L2CAP connections ...

@joelind
Copy link

joelind commented Feb 4, 2014

@sandeepmistry that did the trick!

@sandeepmistry
Copy link
Collaborator

@joelind thanks for trying it out, now to figure out what the user space strategy (if there is any) for the newer BlueZ. There doesn't seem to be a way to turn off this behaviour in bluetoothd.

I've created #24 to track this.

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
None yet
Projects
None yet
Development

No branches or pull requests

5 participants