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

Possibly the wrong advertisement data is being sent #12

Closed
zdennis opened this issue Jan 16, 2014 · 7 comments
Closed

Possibly the wrong advertisement data is being sent #12

zdennis opened this issue Jan 16, 2014 · 7 comments

Comments

@zdennis
Copy link

zdennis commented Jan 16, 2014

The advertisement data I'm seeing with TI RF Packet Sniffer is not what I would expect. Here's a simple peripheral showcasing the issue: https://gist.github.com/zdennis/8447896

When running the advertisement data is: 02 01 0A 02 0A 08 0C 09 43 53 52 38 35 31 30 20 41 31 30

However I'd expect the advertisement data to be: 02 01 05 11 06 d7 4f 4a f1 9b 70 15 91 4f 4c 1a 99 93 38 61 dd

In fact, this is what hci-ble.js thinks it's advertising in HciBle.prototype.startAdvertising but it's not what's being advertised. This is with both bleno 0.1.1 and also bleno @ ee06f6c .

This is using bluez 5.12 (I am currently building bluez 5.13 to try there as well).

Any thoughts?

@sandeepmistry
Copy link
Collaborator

Might be an issue in hci-ble.c the read is not buffered as well as it could be. You can try adding a printf there, then run with debug: sudo DEBUG=hci-ble node <file>.js to make sure they match up.

Also, I'm running 4.101 at home, but not much of the BlueZ user space lib is used.

@zdennis
Copy link
Author

zdennis commented Jan 16, 2014

Thanks for the debugging info @sandeepmistry . Everything seems fine all the way til https://github.com/sandeepmistry/bleno/blob/master/src/hci-ble.c#L27 . After that I'm not sure how to check the data as part of the hci_request.

I'm now on bluez 5.13 and it's the same issue. I will look some more tomorrow. I will try to downgrade to 4.101 as well and try that.

@sandeepmistry
Copy link
Collaborator

Hmm, that would mean the HCI command is failing or something. Did you check what status was?

What Linux distro, etc. are you running?

@dragom
Copy link
Contributor

dragom commented Jan 17, 2014

I had buffering problems on arduino Yun and bleno. stdbuf command from javascript spawn did not help.
So I add setvbuf(stdout, NULL, _IONBF, 0); on all i/o streams.
http://stackoverflow.com/questions/7876660/how-to-turn-off-buffering-of-stdout-in-c

@zdennis
Copy link
Author

zdennis commented Jan 18, 2014

@sandeepmistry I can't recreate this issue now. I'm guessing it was likely something on my end. I've got my peripheral working great on OSX and Linux now.

Closing this issue.

@zdennis zdennis closed this as completed Jan 18, 2014
@sandeepmistry
Copy link
Collaborator

Thanks @zdennis.

@dragom can you please submit a pull request for the setvbuf change? Also, it's cool that you got in running on the Yun! What's the best way to contact you to learn more about bleno + the Yun?

@dragom
Copy link
Contributor

dragom commented Jan 19, 2014

Here are notes to make bleno work on linino:
dragom/linino#1

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

3 participants