This post is older than 2 years and might not be relevant anymore
More Info: Consider searching for newer posts

How UNreliable is notification? Or is this notification's fault?

I'm trying to send a string of bytes from nrf51822 to an android device.

I'm using notification.

There will be potentially thousands of data to be sent from nrf51822 to android.

For some reason, I can only send a limited number, 6 so far, it's way less than I had hoped for.

My android device is kind of obsolete, it was bought in 2013.

I understand the whole thing - using notificaction to send a large amount of data- may not be a great idea, but for now, I'm working on a prototype product, therefore 50 times per session will be fine. But so far, as I mentioned above, I got only 6. Beyond that my android program stops being responsive.

It could be the fault of the android device, but I want some expert idea on how bad an idea this is, you know, to send data using notification from nrf51822 to android? I mean, it could be quite reliable actually, if that is the case, I'll shift my debugging focus from nrf51822 to android.

Also, should I use notification?

  • It isn't unreliable at all. Notifications/indications and every other communication at the link level are 100% reliable. If a packet is accepted by the softdevice it's sent, if it's sent it's received, in order, totally guaranteed unless the link actually times out (at which point you get a link timeout). Although the spec allows notifications to be dropped at the receiving end I have yet to come across an implementation which does that as it would be stupid, you've received the packet, even a brain-dead android device from 2013 has enough buffer space to deliver it to your application.

    Instead of shifting your debugging focus, how about writing a better question about what you mean by 'wanting to send 50' but 'only being able to send 6'. And what is a 'session'? For all I can tell you're pumping out notifications, ignoring the reply which says you don't have a buffer left to send them and are wondering why most of them don't get through.

    People send absolute *** tons of data absolutely reliably using notifications, at great speed, it's actually pretty much THE best way to send a lot of data over BLE as fast as possible. So you're just doing something wrong.

  • Ha ok. I was going at it like a mule for the past 12 hours, I ain't got too much juice left to write better questions. By "I want 50", I mean I hope to transfer 50 notification from 51822 to android device. By session, I mean the time between establishing a GATT connection to its termination. I hope I can get as much as 5000 notifications pushed during one session in the future, but for now, I only need about 50 per session to prove to the client that it is feasible. At current stage, I only managed to send 6 before the android program gives up altogether, and I can't tell what's wrong with it because real-time debugging isn't supported on a 2013 device it seems.

    Thanks for the tip. I'll going at it like a mule again but only this time, not trying to fix a problem with nrf51822, which does not exist in the first place based on what you had said, instead I'll try to fix Android program.

  • Problem with nrf51822 doesn't exist if it is implemented correctly. Do you check for errors in nrf code when you pass data to SoftDevice?

  • It's all successful. Nothing wrong with the nrf51822 I figure. I'm still working on the android code. Must be that. Will get back later if that is the case.

Related