Fix BLE Connection problem Packet too big on BBC Microbit, RFDuino, nRF51822,

When using BLE on boards using the library arduino-BLEPeripheral, the Blynk connection request nearly always fails with the message “Packet too big”.
Following boards are using the library arduino-BLEPeripheral when using Blynk:

  • BBC Microbit
  • RF Duino BLE
  • RedBearLab nRF51822
  • and other nRF51822 based boards
  • nRF8001 based boards

Cause
The main cause of this problem is the size of the receiving buffer, which has only has a maximum size of 20 bytes. Other Blynk implementations of BLE boards however have a receiving buffer of 512 bytes maximum.

Solution
I created a pull request https://github.com/blynkkk/blynk-library/pull/463 to solve this issue, and to make the code more in line with other Blynk BLE implementations:
I only tested with Android & BBC Microbit, so I am looking forward to hear results on other setups.

If you can’t wait until a next release of the Arduino library, which hopefully will contain this fix, or in case you want to test it, you can simply replace BlynkBLEPeripheralSerial.h with the following one:

Good luck!

B.T.W. “Packet too big” can also occur in case of packet loss during bad BLE reception quality or when using SoftwareSerial, but this fix is only for the mentioned boards.

Hi,

I had aborted my tests until read your message!

I executed the your patch and looks that got big progress! I compiled and transfer the program to the NINA B112 and now i can connect it using BLINKY APP, using the REDBEAR option, because they still dont have to U-BLOX NINA B112.

But i have some questions

  1. is it possible select/add other GPIOS that the default REDBEAR ? For example, select the GPIO 23 of the NRF52832 ?

  2. I am connected to BLE, but…shows this message

  3. Can with that APP version (not registred), read more that one ANALOG ?

Thanks

Can you show the ouput on Serial after defining
#define BLYNK_DEBUG

Thank you so much for sharing this! This was the key to getting a Microbit and Blynk talking to each other.I really hope it does get merged into the library!