redbear / Duo

Resources for the RedBear Duo IoT development board.
http://redbear.cc/duo
227 stars 108 forks source link

sendNotify not working on 0.3.2 board/firmware #46

Closed wywarren closed 5 years ago

wywarren commented 6 years ago

After many days of tinkering and debugging I’ve finally found a workaround but it doesn’t seem to be a proper solution. Please refer to the logs I’ve posted here for my findings: BLEController Sketch Not Working with BLEController App using duo

After swimming through the docs on github, it tried changing the sample code from all sendNotify to all sendIndicate and all the examples and my custom app works now. What is the inherent difference between the two? The docs are just a copy and paste...

At the end of the day, I recently purchase the duo and I spent some time loading your samples onto it for BLEController and SimpleChat, both of which have problems when calling sendNotify.

With BLEController, it scans and finds the device and upon connection it doesn’t receive a response and disconnects.

With SimpleChat, on first run it can only receive one message from the duo. After that all other messages are discarded.

In both cases, the duo is still able to receive messages fine, while not being able to send.

After digging into the GitHub docs, I found that there was another send function sendIndicate which I converted all your sample code to using and the both started to work as expected.

I’m wondering if there is something inherently wrong with the base sendNotify function in the latest version of the firmware.

I looked up (and confirmed through experiencing it) that sendIndicate does not get as fast of a response and causes noticeable latency when sending large amounts of data as per the nature of indications. We want to use notifications at the end of the day.

Using the RedBear MiniBLE and the Shield, both send data fairly fast. Examples are not working for the duo.

Device: iPhone X
iOS: 11.4
Arduino RedBear Duo Board: v0.3.2
Firmware: v0.3.2
OS: OSX

Also have confirmed same problems on an Android phone.

Thanks,

Warren