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

Any solutions working on Edison ? #84

Closed
danki opened this issue Nov 17, 2014 · 16 comments
Closed

Any solutions working on Edison ? #84

danki opened this issue Nov 17, 2014 · 16 comments

Comments

@danki
Copy link

danki commented Nov 17, 2014

Am desperately trying to get Bleno working on Edison but i saw somewhere the bluetoothd messes Bleno up.

Is there any solutions out there that are working ?

@danki
Copy link
Author

danki commented Nov 17, 2014

Forgot to mention that im trying to set u BT server/slave, but its not transmitting any services that im adding via Bleno

@rexstjohn
Copy link

I have been working on this problem myself. I am building an Edison BLE service using Bleno: https://github.com/rexstjohn/IntelEdisonBLEGATT/tree/master/EdisonGatt.

So far I can get Bluetooth LE running: http://rexstjohn.com/configure-intel-edison-for-bluetooth-le-smart-development/#more-2958

Then I can detect it using my Xcode Bluetooth scanner: http://rexstjohn.com/bluetooth-smart-ble-scanning-on-osx-xcode-6/#more-3005

Once I detect it, it seems that the service only advertises for a brief time then turns itself off. I suspect configuration issues with BlueZ. Am I wrong in thinking Bleno will keep advertising at regular intervals once started?

I can see that there is a Battery and Manufacturer (Device Information) service available but I can't connect and read the descriptors.

When I run "hciconfig hci0 leadv 3" I can see the device being consistently advertised, even when I clear the Bluetooth LE scanner I am using so I think what is happening is that a single advertisement is happening and then it goes down, resulting in an inability to connect and read the data there.

@sandeepmistry
Copy link
Collaborator

@danki this is related to #24, bluetoothd in BlueZ 5.x does not play nicely with bleno ...

I had to run the following commands before starting my bleno app:

rfkill unblock bluetooth
killall bluetoothd
hciconfig hci0 up

Keep in mind, secure characteristics can't be used because bluetoothd is not running.

@danki
Copy link
Author

danki commented Nov 18, 2014

@rexstjohn thnx for your reply, ill check yours out a bit later, currently in im hurry to get the main part working and @sandeepmistry solution seems to work out temporarily to get me started.
Thank you @sandeepmistry !

@rexstjohn
Copy link

@danki's solution worked perfectly, once I did the steps he outlined I was able to connect and read characteristics.

Here is guidance for additional support including a script you can run to do this automatically and keep it running: http://rexstjohn.com/notes-for-getting-bleno-and-intel-edison-working-together/

@sandeepmistry
Copy link
Collaborator

@danki thanks for the update! I'll close this issue for now.

@rexstjohn thanks for the link! Can you please create another issue for why the "bash script" is needed. I would like more info. on the expected vs. actual behaviour.

@sandeepmistry
Copy link
Collaborator

@danki @rexstjohn an more permanent way to disable bluetoothd:

systemctl disable bluetooth

I'm still trying to track down what the bluetooth-rfkill-event service does, I think it's causing the advertising to behave weird. When I run test.js it cycles between advertising a local name of test and BlueZ 5.18

@danki
Copy link
Author

danki commented Nov 19, 2014

@sandeepmistry i actually tried that earlier but got unsupported from bleno, only thing that did work was your tip of killall bluetoothd, no idea idea why. I will later flash my Edison and set Bleno up on clean Poky and ill try to disable bluetooth then, maybe ive changed something in pure frustration :P

@rexstjohn
Copy link

@sandeepmistry I don't think the Bash script is needed and will see if "killall bluetoothd" / "systemctl disable bluetooth" are sufficient by themselves.I will post a bug if I find otherwise.

Side notes: People want to get really fancy with Edison might do something like this:

exports.killBluetoothd = function() {
console.log('Unblocking BLE');
function puts(error, stdout, stderr) { sys.puts(stdout) }
exec("killall bluetoothd", puts);
};

@adageable
Copy link

Any further results on this from the intel Edison side? I've been trying to follow the same steps as detailed in a previous comment (So far I can get Bluetooth LE running: http://rexstjohn.com/configure-intel-edison-for-bluetooth-le-smart-development/#more-2958), however, I'm not seeing any effect running the commands:

rfkill unblock bluetooth
killall bluetoothd
hciconfig hci0 up

Regardless, after execution, my beacon is briefly detected, then drops out as described in the steps prior to the workarounds above (basically, these workarounds appear to do nothing on my hardware, wasn't sure if anyone has seen similar issues).

@danki
Copy link
Author

danki commented Nov 11, 2015

@adageable could you run following command on your edison and paste it back here:

root@sednew:~# npm show bleno | grep "version:" && opkg list-installed | grep bluez && uname -a && cat /etc/version && cat /etc/issue  
  version: '0.3.2',
bluez5 - 5.24-r0
bluez5-dev - 5.24-r0
bluez5-obex - 5.24-r0
pulseaudio-lib-bluez5-util - 5.0-r0
pulseaudio-module-bluez5-device - 5.0-r0
pulseaudio-module-bluez5-discover - 5.0-r0
Linux sednew 3.10.17-poky-edison+ #1 SMP PREEMPT Wed Apr 29 03:54:01 CEST 2015 i686 GNU/Linux
weekly-146
Poky (Yocto Project Reference Distro) 1.6.1 \n \l

EDIT: Ohh and also this:

root@sednew:~# node --version && npm --version
v0.10.35
1.4.28

@adageable
Copy link

Couple of notes here:

(0) Thanks for replying!

(1) I'm running this through the Intel IoT XDK / Studio... so I'm not 100% clear if the package management works the same (I ran the bluetooth code from IoT studio and received much the same result, however, as trying the Url from Rex St. John (I ran it both ways, with the same result, I believe). I've since repeated the test following all of the instructions from http://rexstjohn.com/configure-intel-edison-for-bluetooth-le-smart-development/#more-2958

(2) Results from your queries

root@edison1:/# npm show bleno | grep "version:" && opkg list-installed | grep bluez && uname -a && cat /etc/version && cat /etc/issue
version: '0.3.2',
bluez5 - 5.24-r0 
bluez5-dev - 5.24-r0
bluez5-obex - 5.24-r0
pulseaudio-lib-bluez5-util - 6.0-r0 
pulseaudio-module-bluez5-device - 6.0-r0    
pulseaudio-module-bluez5-discover - 6.0-r0
Linux edison1 3.10.17-poky-edison+ #1 SMP PREEMPT Fri Jun 19 12:06:40 CEST 2015 i686 GNU/Linux                                                                              
weekly-159.devkit-2.0
Poky (Yocto Project Reference Distro) 1.7.2 \n \l                                                                                                                           



root@edison1:/# node --version && npm --version                                                                                                                             
v0.10.38                                    
1.4.28 

@danki
Copy link
Author

danki commented Nov 11, 2015

@adageable thanks for posting dumps.
Now i see you use poky 1.7.2, that is the ww25 edison image. I did use that too here few weeks till about 4 days ago. Im not really sure what is going on, but BLE didnt work for me at all in ww25 image. Not as commandline tool and def not properly with bleno.

So my best recommendation for you would be, go back to ww18 (weekly 146).

When looking at "weekly-159.devkit-2.0" i would guess it is some kind of dev / nightly build. Havent found any docs on what has been changed in that particular build.
For example, configure_edison --setup is now gone there, instead one would just run configure_edison.

@adageable
Copy link

@danki Thanks for taking the time to help!
Interesting... looks like the BLE stack and the edison images aren't as stable as I hoped. I will try the downgrade and post the results here just for verification (in a few days, unfortunately, as I'm caught up in other work).

Any ideas for contacts within the Edison community to escalate these issues with the images? I downloaded and attempted to run a very similar bluetooth demo directly from the Intel IoT studio, and the out of the box sample demo shows the same behavior (I'm assuming for the same reasons). You can have a bluetooth beacon if you want, but only for a few seconds!

@danki
Copy link
Author

danki commented Nov 13, 2015

Yeah i think its safer for you to go with ww18 (weekly-146) as i belive ww25 is some pre- or alpha release for developers to test and adapt code for.
Not really sure what Intel has changed in ww25, seems bluez is still at 5.24, but why BLE app behaviors are so different is kind of a mystery to me.

I would definitely flag the issues on Intel Edison forums but since 2014-nov i have not been able to log in to forums for some reason, tested with all kinds of browsers... nothing. Tho seems few peeps have flagged ww25 on forums to be un-safe for production usage. Lets hope intel puts together a decent page for tracking Edison related news and updates, current ones are just horrible :/

@sandeepmistry
Copy link
Collaborator

@danki good to ww25 is not stable, maybe that's why 146 is the latest via configure_edison. @rexstjohn any comments on 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

4 participants