[SOLVED] Android Bluetooth - pull data no longer works

• Hardware model + communication type: Arduino UNO with Bluetooth module HC-06
• Smartphone OS: Android 6.0.1
• App version: 2.26.4
• Blynk server
• Blynk Library version 0.5.3

Problem: the pull data mechanism no longer works in the Android app when working with Bluetooth classic communication

Create one Button widget on V1
Create one Widget “Value Display Settings” on V2 with 1 sec reading rate

The widget “value display settings” never sends the request to read the value, but it should request V2 every second

Sketch:


#define BLYNK_DEBUG
#define BLYNK_PRINT Serial
#define BLYNK_USE_DIRECT_CONNECT

#include <BlynkSimpleSerialBLE.h>
#include <SoftwareSerial.h>

SoftwareSerial BTSerial(2, 3); // RX, TX

char auth[] = "...";

// Widget Button on V1
BLYNK_WRITE(V1)
{
  BLYNK_PRINT.println("BLYNK_WRITE V1");
}

// Widget "Value Display Settings" on V2 with 1 sec reading rate
BLYNK_READ(V2)
{
  BLYNK_PRINT.println("BLYNK_READ V2");
  int t = 1234;
  Blynk.virtualWrite(V2, t);
}

void setup()
{
  BLYNK_PRINT.begin(115200);
  BLYNK_PRINT.println("Setup started");

  BTSerial.begin(9600);
  Blynk.begin(BTSerial, auth);
}

void loop()
{
  Blynk.run();
}


Debug output:

Setup started
[0] 
    ___  __          __
   / _ )/ /_ _____  / /__
  / _  / / // / _ \/  '_/
 /____/_/\_, /_//_/_/\_\
        /___/ v0.5.3 on Arduino Uno

  Give Blynk a Github star! => https://github.com/blynkkk/blynk-library

[14] Connecting...
[6014] Connecting...
[12014] Connecting...
[14284] >[02|00|01|00] 
[14318] >5fxxxxxxxxxxxxx4b69b1
[14319] Ready
[14319] Free RAM: 1516
[14320] <[00|00|01|00|C8]
[17009] >[14|00|02|00|08]
[17017] >vw[00]1[00]440
BLYNK_WRITE V1
[17221] >[14|00|03|00|06]
[17227] >vw[00]1[00]0
BLYNK_WRITE V1
[17743] >[14|00|04|00|08]
[17753] >vw[00]1[00]440
BLYNK_WRITE V1
[17847] >[14|00|05|00|06]
[17853] >vw[00]1[00]0
BLYNK_WRITE V1
[18310] >[14|00|06|00|08]
[18318] >vw[00]1[00]440


(B.T.W. I discovered this issue during the development of the ESP32 Bluetooth (classic!) Blynk adapter. But I found out that the bug could be reproduced on HC-06)

Bug is also in 2.26.5

Hm, we’ll check it

It works in 2.26.7.

1 Like