BLYNK
BLYNK.IO       📲 GETTING STARTED       📗 DOCS       👉 SKETCH BUILDER

Blynk (legacy) ble It says connecting for a long time but not connecting

• Esp32s ble
• Android 4.4.2
• Blynk server
• Version 1.1.0


#define BLYNK_USE_DIRECT_CONNECT

#include <BlynkSimpleEsp32_BLE.h>
#include <BLEDevice.h>
#include <BLEServer.h>

// You should get Auth Token in the Blynk App.
// Go to the Project Settings (nut icon).
char auth[] = "X0TJTB-54TVrgIyl-x-SecukBkumRZJc";

void setup()
{
  // Debug console
  Serial.begin(9600);

  Serial.println("Waiting for connections...");

  Blynk.setDeviceName("Blynk");

  Blynk.begin(auth);
}

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

First of all, please edit your post and add triple backticks ``` before and after your whole sketch.

you’re using blynk legacy so you should downgrade the blynk library to version 0.6.1

thanks i will try

Well, you haven’t included any Blynk libraries, and even if you had, I don’t see how this sketch tells the Blynk library to use the ESP32’s BLE port to establish the connection.

Pete.

I installed both the library and the code is one of the code samples of the blynk library but the problem still persists.

Post the serial output.

Desktop.rar - 13 KB

I can’t post photos directly because I’m a new user.

now i tried again it worked thank you all.

but sometimes it still doesn’t work.(not working now)

not solved still only worked once, not working now

How are you powering your board ?

We don’t want a photo of your serial monitor output, we want the text, formatted with triple backticks the same was as when you post code.

You’ve edited your forts post multiple times since your initial sketch, but I still don’t see how it knows to use the BLE connection - although I’ve never used BLE with Blynk.

Pete.

17:27:06.610 -> configsip: 0, SPIWP:0xee
17:27:06.610 -> clk_drv:0x00,q_drv:0x00,d_drv:0x00,cs0_drv:0x00,hd_drv:0x00,wp_drv:0x00
17:27:06.610 -> mode:DIO, clock div:1
17:27:06.610 -> load:0x3fff0018,len:4
17:27:06.610 -> load:0x3fff001c,len:1044
17:27:06.610 -> load:0x40078000,len:10124
17:27:06.610 -> load:0x40080400,len:5856
17:27:06.610 -> entry 0x400806a8
17:27:07.031 -> Waiting for connections...
17:27:07.031 -> [28] 
17:27:07.031 ->     ___  __          __
17:27:07.031 ->    / _ )/ /_ _____  / /__
17:27:07.031 ->   / _  / / // / _ \/  '_/
17:27:07.031 ->  /____/_/\_, /_//_/_/\_\
17:27:07.031 ->         /___/ v0.6.1 on ESP32
17:27:07.031 -> 

This pops up when I try to connect from the phone.
17:29:58.757 -> lld_pdu_get_tx_flush_nb HCI packet count mismatch (0, 1)

Which version of the Arduino ESP32 core are you using ?

how can i learn this.

Open the Arduino IDE, go to tools/board/board manager and search for esp32.

Okay, try the latest version of the esp32 core (2.0.4).

2.0.4 none


I couldn’t send 2 photos at the same time, I sent it as an extra message.

Enter the following url into the “Additional Board Manager URLs” field.
https://raw.githubusercontent.com/espressif/arduino-esp32/gh-pages/package_esp32_dev_index.json

i uploaded i will try now