BLYNK
HOME       📲 GETTING STARTED       📗 DOCS       ❓HELP CENTER       👉 SKETCH BUILDER

[BETA] ESP32 BLE initial support

Well, as I ran into months ago, probably just a phone compatibility… One refused to work properly while the other worked great.

It appears that it will simply work or not. Nothing else can be done that I am aware of as it is BETA and apparently untouched for awhile.

1 Like

Ok. I testing with my sister’s tablet ( asus zenpad8 with android 6 ) and its working like a charm. so the problem with my smartphone.

1 Like

Can you add

#define BLYNK_DEBUG

and show the debug info?

Hi,

I’m using:
Blynk App Android 2.26.7
Blynk Lib Arduino 0.5.3
ESP core feature/stage
What is ESP32_BLE_Android ?

I have no problems connecting to the ESP32 with BLE, but on the Blynk Android app it stays disconnected.

Booting...
Starting BLE...
[30]
    ___  __          __
   / _ )/ /_ _____  / /__
  / _  / / // / _ \/  '_/
 /____/_/\_, /_//_/_/\_\
        /___/ v0.5.3 on ESP32

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

Done
Battery level updated - voltage (935) battery level (3.74)
[41950] BLE connect

Any hints?

Thank you

Just for reference,

Everything is working now, I missed the step were I need to add a BLE widget to my project.

If I use thw BLE widget on my Android app to pair with the ESP32 everything works as expected without connection issues.

Source: Problems with Bluetooth

1 Like

2 posts were merged into an existing topic: Blynk interfering with Bluetooth Serial on ESP32

Hi,
just for reference: with an iPhone SE the BLE communication is working properly.
Best regards,
Christian

Hi,

i’m using:
Blynk App Android 2.27.0
Blynk Lib Arduino 0.5.4
ESP32 core (last stable version)
Mobile Samsung S5

From the App i cannot connect to the ESP32 module via BLE:

From the debug module this is the output:

    ___  __          __
   / _ )/ /_ _____  / /__
  / _  / / // / _ \/  '_/
 /____/_/\_, /_//_/_/\_\
        /___/ v0.5.4 on ESP32 

[10168] BLE connect
[11874] >> [02|00|01|00] d4f4ab9b5f8b4b1
[11875] >[02|00|01|00] 
[11919] >> e9ef93e6ba69f3e1f
[11920] >**AUTH_CODE** 
[11920] Invalid header type: 2
[20919] BLE disconnect
[20919] Disconnected

Sketch is the following:

#define BLYNK_PRINT Serial
#define BLYNK_DEBUG
#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[] = "**AUTH_CODE**";


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

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

  Blynk.setDeviceName("ESP32BLE");

  Blynk.begin(auth);


}


void loop()
{
  Blynk.run();

}

Obviously AUTH_CODE is a 32 digits code generated by Blynk

What am i missing?

Yesterday we did uploaded a new build of same version with some fixes for BLE and some crash fixes. Please check if you have the latest version. Also you need to have in the sketch the same auth token that you have in your project’s device that is used for BLE widget, so the device with BLE connection type.

2 Likes

Absolutelly the same setup, except Samsung A5.
Output is different:


/ _ )/ /_ _____ / /__
/ _ / / // / _ / '/
/
//_, /////_
/
__/ v0.5.4 on Arduino

[32553] BLE connect
[32553] Login timeout
[32554] <[02|00|01|00] 83fc252d29fa46a
[32554] <4846f72af9154a704
[34426] >> [02|00|01|00] 83fc252d29fa46a
[34426] >[02|00|01|00]
[34471] >> 4846f72af9154a704
[34471] >83fc252d29fa4**846f72af9154a704
[34471] Ready
[34538] <[11|00|02|00]Vver[00]0.5.4[00]h-bea
[34539] <t[00]10[00]buff-in[00]1024[00]de
[34542] <v[00]Arduino[00]con[00]Esp32_
[34544] <BLE[00]build[00]Nov 16 201
[34546] <8 12:06:21[00]
[34547] <[00|00|01|00|C8]
[34576] >> [00|00|02|00|C8]
[34577] >[00|00|02|00|C8]
[43440] BLE disconnect
[43440] Disconnected

On smartphone I see: endless Connecting
On Android tablet I see:

  1. Two copies of my ESP32 devices
  2. Debug ouput shows only last 9 symbols of auth string.

Anybody from Blynk stuff are going to solve the problem??

I have had issues connecting to BLE if I had multiple devices I was testing on.

Delete the BLE widget, then close/shutoff the App on all but one device then reload the widget and try again on that device alone.

I’m doing it permanently. One more detail:
BLE widget does not check correct device choosen, i.e. if no device was selected, BLE widget still trying to connect and hangs.

As could be seen from my first debug output, connection established for 9 seconds and then closing. If I have time to run Blynk project on phone, I see data transfer for theese 9 seconds.

From my testing, I don’t think it has that ability… it is meant to link between one phone/tablet and one BLE device, period, not pick and chose which currently active phone/tablet/App/device to connect to.

So pick the one you want to use “permanently” and test with that one alone, for now.

PS… this topic is about the BETA ESP32-BLE support… are you using an Arduino and a separate BLE module?

I did it several times.
Now the behaviours are absolutely symmetrical on Phone and Tablet:
9 seconds connection then fail. And endless Connecting… on BLE widget.

Most probably something is broken in ESP32 Arduino core.

No, this is a side effect of choosing M5Stack-Core-ESP32 board. If I use ESP Dev Module this string is correct, but nothing changed.
See above:

1 Like

OK, well, I loaded up an existing WiFi sketch and switched it over to BLE to give my own ESP32 a run…

Using the latest IDE installed core

image

And strangely, my sketch actually starts running a timed blinking vLED sequence while the connection attempt (according to the App) is still in progress… of course it never does connect for me either… just stays on this screen… forever???

[18] 
    ___  __          __
   / _ )/ /_ _____  / /__
  / _  / / // / _ \/  '_/
 /____/_/\_, /_//_/_/\_\
        /___/ v0.5.4 on Arduino

[220537] BLE connect
[221561] >> [02|00|01|00] d1f522be4873416
[221561] >[02|00|01|00] 
[221563] >> 79fe4b24119d89d81
[221564] >d1f522be487341679fe4b24119d89d81
[221578] Ready
[221644] <[11|00|01|00]Vver[00]0.5.4[00]h-bea
[221645] <t[00]10[00]buff-in[00]1024[00]de
[221690] <v[00]Arduino[00]con[00]Esp32_
[221732] <BLE[00]build[00]Nov 16 201
[221772] <8 04:13:56[00]
[221852] >> [00|00|01|00|C8]
[221852] >[00|00|01|00|C8]
[221866] <[10|00|02|00|06]vr[00]0[00]1
[221901] <[00|00|01|00|C8]
[222018] <[14|00|03|00|08]vw[00]3[00]255
[222518] <[14|00|04|00|06]vw[00]3[00]0
[223018] <[14|00|05|00|08]vw[00]3[00]255
[223518] <[14|00|06|00|06]vw[00]3[00]0
[224018] <[14|00|07|00|08]vw[00]3[00]255
[224518] <[14|00|08|00|06]vw[00]3[00]0
[225018] <[14|00|09|00|08]vw[00]3[00]255
[225518] <[14|00|0A|00|06]vw[00]3[00]0
[226018] <[14|00|0B|00|08]vw[00]3[00]255
[226518] <[14|00|0C|00|06]vw[00]3[00]0
[227018] <[14|00|0D|00|08]vw[00]3[00]255
[227518] <[14|00|0E|00|06]vw[00]3[00]0
[228018] <[14|00|0F|00|08]vw[00]3[00]255
[228518] <[14|00|10|00|06]vw[00]3[00]0
[229018] <[14|00|11|00|08]vw[00]3[00]255
[229518] <[14|00|12|00|06]vw[00]3[00]0
[230018] <[14|00|13|00|08]vw[00]3[00]255
[230518] <[14|00|14|00|06]vw[00]3[00]0
[230577] BLE disconnect
[230577] Disconnected

I will have to take your word for it :stuck_out_tongue: thankfully I use WiFi 99.9% of the time… that seems to work just fine :smiley:

Well, I have 3 ESP32 devices:
M5Stack Core, M5Stack Fire, ESP-WROVER-KIT and Samsung A5 + Chuwi V89.

With all possible combinations I got results as in my first post. So, I gues it was rather comprehensive experiment.

PS
I did not try Arduino iDE yet. All tests were done with VisualMicro and platformio.

I did… and no worky either. But it did at one time, for me, back at the beginning timeframe of this topic… so later Core changes broke something.

And since esspressif is doing their own thing… until they settle down and the Blynk devs have the time, I guess this ESP32 BLE Beta is stuck in limbo.