BLE: How to update widget values when Blynk app PLAYs?

I’m working on a UI for BLE nRF52 device and I can not seem to get widget parameters to update after clicking play in the Blynk project. After clicking play, all widget settings seem to be reset and are out of sync with defaults I’ve setup on the hardware.

I’ve tried a combination of

BLYNK_CONNECTED(), BLYNK_APP_CONNECTED(), Blynk.syncAll(), (with “Notify Devices When App Connected” enabled) BLYNK_READ(), and running things like Blynk.virtualWrite(V1, ws2812fx.getSpeed()) within each of these functions and many other places. Regardless, every time I connect to the device and then hit PLAY, all the widgets simply reset and do not respect the previous settings, current settings, or any of the functions I’m attempting to use to update these values.

Any help would be greatly appreciated.

If I set the following, both the value of the V0 widget and LCD on V4 are updated after connecting to the nRF52 using the BLE widget:

WidgetLCD lcd(V4);

Blynk.virtualWrite(V0, ws2812fx.getMode());
lcd.print(0, 0, ws2812fx.getModeName(ws2812fx.getMode()));

But on clicking play, the value of the V0 widget is reset to zero, yet the value of the lcd remains and is not reset.

Setting the following seems to have no effect on either V0 widget or lcd:

Blynk.virtualWrite(V0, ws2812fx.getMode());
lcd.print(0, 0, ws2812fx.getModeName(ws2812fx.getMode()));

Is the reason that these functions are simply broken when using the Blynk app over BLE given that BLE support is in beta? I can’t even get these functions to update the value of the Display widget and have this maintained when clicking the play button.

Should I repost this in the “Issues and Errors” category?

I think it is simply a case of the BLYNK_CONNECTED() function needing a direct server link, and that is not directly available in BT/BLE… as is the case for a few other Server based commands and functions.

BLYNK_CONNECTED() does seem to fire on establishing a connection via the BLE widget. But then on playing the app, BLYNK_APP_CONNECTED() does not seem to work.

That is a function of the MCU (sketch) asking the Server the state of the App connection (to the server)… but in the case of BT/BLE, the sketch isn’t actually talking to the server directly, thus no worky.

BT/BLE is an “odd for IoT” setup in my opinion.

Blynk uses a…

App <-network-> Server <-network-> MCU setup, which is ideal for IoT

So upgrading the Beta BT/BLE interface use case of…

BT/BLE based MCU <-BT/BLE-> App <-network-> Server <-network-> MCU

…is clearly going to take some time/effort… assuming the Developers actually want to integrate BT/BLE fully into the fold.

Time will tell.

it would be nice if there was a ble.connected event call from the manufacturer library.