Page 1 of 2

ESP32 bluetooth

Posted: Mon Nov 04, 2019 10:08 pm
by vcch75
Hi !

I already runned several bluetooth examples, but all of them involve the Esp32 being added by the PC.
i want to do the opposite : the Esp32 connecting to a PC (or a phone) - with or without a pincode.

Can you help me doing this, or tell me whre i could find a code doing that ? I've been googling for weeks, and did not find the way to do it...

Re: ESP32 bluetooth

Posted: Wed Nov 06, 2019 2:09 am
by chegewara

Re: ESP32 bluetooth

Posted: Wed Nov 06, 2019 7:42 pm
by vcch75
Thanks a lot, exactly what I needed! Any advice on what to do to make this run in arduino/esp32 ?

Re: ESP32 bluetooth

Posted: Fri Nov 08, 2019 8:41 pm
by chegewara

Re: ESP32 bluetooth

Posted: Sat Nov 09, 2019 6:55 pm
by vcch75
Thanks a lot. Will look at it more in details.

Re: ESP32 bluetooth

Posted: Wed Nov 13, 2019 8:52 pm
by vcch75
BLEPin:38:14: error: 'class BLESecurity' has no member named 'setStaticPIN'

pSecurity->setStaticPIN(123456);

Re: ESP32 bluetooth

Posted: Wed Nov 13, 2019 8:55 pm
by vcch75
I installed the latest ESP32 library and Neil Kolban's BLE library, but i still have the error message :

BLEPin:38:14: error: 'class BLESecurity' has no member named 'setStaticPIN'

pSecurity->setStaticPIN(123456);

^

Re: ESP32 bluetooth

Posted: Thu Nov 14, 2019 11:59 am
by chegewara
Looks like arduino library has not been updated with this feature. You can copy/paste files from this library:
https://github.com/nkolban/esp32-snippe ... curity.cpp
https://github.com/nkolban/esp32-snippe ... Security.h

Re: ESP32 bluetooth

Posted: Thu Nov 14, 2019 8:57 pm
by vcch75
I could run the code but it is not exactly what I wanted to do.

What I would like to do is a soft that connects successively to all the bluetooth devices (which would trigger a message "ESP32 wants to connect with your PC" message on my PC for example). Any idea how to do this ?

Re: ESP32 bluetooth

Posted: Fri Nov 15, 2019 4:36 am
by chegewara
Then you need ble client on esp32 and peer device, like PC or smartphone, needs to advertise itself. Without that how esp32 could find it?