Blynk App displays "Wasn't Online Yet" when it is Online

Hello

I’m trying to stablish a connection with an ESP-32S v1.1 module via bluetooth, for testing purposes I’ve put a virtual button on the Blynk app to turn on a LED on the module, it is totally able to do that so it actually connects via bluetooth.

Now that I tested that I wanted the app to send me a notification to my phone when the app connects to the module but the app never gets out of the “Wasn’t online yet” status and I think that prevents the notication to be sent.

I have an Android 9.0, Blynk Library version 0.6.1 (working on PlatformIO).

The code I’m using is pretty basic but I’m new to programming so maybe there’s something wrong there.

#define BLYNK_PRINT Serial
#define BLYNK_USE_DIRECT_CONNECT
#include <BlynkSimpleEsp32_BT.h>
#define LED 2
char auth [] = "Token";

BLYNK_WRITE(V3) {          // This LED works as intended
  delay(500);
  digitalWrite(LED,HIGH);
  delay(500);
  digitalWrite(LED,LOW);
}

BLYNK_APP_CONNECTED () {     //Not working at all
    Blynk.notify("Notification");
    Serial.println("To check if it actually makes the connection");
}

void setup() {
  pinMode(LED,OUTPUT);
  Serial.begin(115200);
  Serial.println("Waiting for connection...");
  Blynk.setDeviceName("MyDevice"); // Phone finds Device with Bluetooth and with app widget
  Blynk.begin(auth);
}

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

If anyone could help, I’d be forever grateful.

Some functionality doesn’t work with Bluetooth, I think this is one of those things that is affected.

Pete.

I’m very new to this also but I found using the delay() function messes with connections to the app.

You could try this and see if the problem persists

BlynkTimer timer;
timer.setInterval(500L, ledOn);

void ledOn(){

   BLYNK_WRITE(V3){
     digitalWrite(LED,HIGH);
   }

   timer.setInterval(500L, ledOff);
}

void ledOff(){

   BLYNK_WRITE(V3){
      digitalWrite(LED,LOW);
  }

}

Thank you for your quick reply, it’s a shame to read that, if nothing works I guess I’ll have to change the project.

I’ll try it, thank you very much for your reply.

No problem , update us on the results :ok_hand: