-
Notifications
You must be signed in to change notification settings - Fork 452
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
Issue with more than four characteristics #35
Comments
There should be no limitations on the number of characteristics. Do you have some sample code you can share? I'll test it out with an iOS device. Also, which Android app are you using? A few people have mentioned BLE on Android is a little flaky sometimes. |
Yes, Android BLE stack can be a bit unstable, but here the problem seams to come from the bleno part. Here is the piece of code I use on bleno side:
service.js :
sensorXCharacteristic.js :
On the Android side, I use an app on my own. When I connect to the device, I enable notifications for each characteristic. Their value can be 0 or 1, so I have squares 'lights' to display the value of the characteristics (green for 1 and red for 0). With 5 characteristic on bleno side, after a while the Android app does not reflect the latest write command on the 'lights' because the 'write response' packet is never send by the bleno app. |
@Wardleth thanks for the sample code. I'll add it to my list of things to try out. In the mean time, do you think you can try it out with the nRF Master Control Panel (BLE) for Android |
Hi Sandeep, I have side tasks today, so I'll try the application tomorrow. |
Sandeep, |
Thanks for taking the time to try this out! Interesting, maybe it's the big write sequence causing the issues. Would you able to try and create a script that uses noble to replicate the behaviour? |
I'm not very skilled in Javascript, but I'll try to reproduce the bug with noble. |
Hi Sandeep, I'm trying the develop a noble script. I tried your example to discover devices but I cannot find any devices. I run the bleno and noble scripts on the same device (internal bluetooth), so the issue might come from there ? Is it possible to use my linux as peripheral and as central with only one local device ? |
Probably you need two. They can be on same machine. You state on which your program should run with setting environment variables. You can state that way even debug level to see more what is going on: |
Humm ok. This is sad. I have no other local device to test bleno and noble together. |
No worries, can you share what you have so far, preferably on a Github repo or Gist. An outline of the write sequence would also be useful. |
The bleno code that I already posted is globally everything i've done on the peripheral side. I just have 5 SensorXCharacteristic files with X = A, B, C, D, E.
Say this, I found an alternative to my issue by combining the 5 characteristics in only one, so there is no more issue. But there is still a problem with the first version, and it might comme from bleno, I don't know. |
This should be fixed by 40497e8, there was some buffering issues with the stdin/stdout C/node.js pipe, the newline wasn't guarantee to be there after a single read call. |
Hi Sandeep,
I have an issue trying to simulate a peripheral with your tool.
I coded a unique service with five characteristics with notify and write properties. From an Android app, I enable notifications for every characteristics and then I simulate modifications by sending 'write' commands and catching notifications.
The problem is that after a variable amount of commands sent, bleno does not send back the 'write response' as before (but still send the notification), so Android waits until a timeout disconnects the device. If I disable a characteristic, so I now have four of them instead of five, I get no issue and everything works fine...
Is there any limitations in the number of characterstics that a service can have ?
Wardleth
The text was updated successfully, but these errors were encountered: