Page 1 of 1

How to hide BLE in ESP32?

Posted: Wed Jul 04, 2018 1:56 pm
by SombraRPK
Hi! I’m currently working on a project in which I don’t want my BLE device to be found by any other device. I’ve tried initializing the Bluetooth with no name but it’s still being found. I just want to establish the Bluetooth connection via MAC address.

Any idea is welcomed.

Thanks in advance, guys.

Re: How to hide BLE in ESP32?

Posted: Thu Jul 05, 2018 12:42 pm
by bobolink
iOS has BLE services that are sort of hidden (like time and battery services). They don’t want to waste battery advertising them if you don’t need them.
You find them by knowing a long UUID a priori. The process is called service “solicitation” in the BLE specification. If that is any help.

Re: How to hide BLE in ESP32?

Posted: Wed Aug 01, 2018 8:47 pm
by SombraRPK
Thanks @bobolink. I'll check the BLE specification, but just to be sure, what you're saying is that if service solicitation is like "enabled" then the ESP32 can be found, otherwise it remains hidden?

Re: How to hide BLE in ESP32?

Posted: Thu Aug 02, 2018 12:02 pm
by bobolink
I think it has to be supported in the BLE implementation on the ESP32. It’s optional.
The ESP32 isn’t “found” because it isn’t advertising (transmitting) its services all the time. Its receiver is listening for a certain transmission, if heard then it starts advertising as a normal peripheral.
It’s complicated because the ESP32 performs two roles. As Central and as Peripheral.
I don’t know if that is what you had in mind or you wanted to control the radio directly with some kind of low probability of intercept waveform. Which is way beyond me.

Here is a video I did on soliciting services on the iPhone. It’s embarrassing to watch since I was just leaning YouTube and the narrator sounds like an idiot :D
https://youtu.be/d0woZaZjkAs

Re: How to hide BLE in ESP32?

Posted: Thu Aug 02, 2018 12:57 pm
by bobolink
Again, not sure if solicitation is the kind of hiding you want but ANCS is an iPhone BLE service which must be solicited. Here is someone talking ANCS implementation on the ESP32 with Mr. Kolban
https://github.com/nkolban/esp32-snippets/issues/430

Re: How to hide BLE in ESP32?

Posted: Wed Aug 15, 2018 1:40 am
by mike_acosta_v
Hi, you can prob this:

BLEServer *server = NULL;
server = BLEDevice::createServer();
servidor->getAdvertising()->c(1,0);


This is the function:
/*
void BLEAdvertising::setScanFilter(bool scanRequestWhitelistOnly, bool connectWhitelistOnly) {
ESP_LOGD(LOG_TAG, ">> setScanFilter: scanRequestWhitelistOnly: %d, connectWhitelistOnly: %d", scanRequestWhitelistOnly, connectWhitelistOnly);
if (!scanRequestWhitelistOnly && !connectWhitelistOnly) {
m_advParams.adv_filter_policy = ADV_FILTER_ALLOW_SCAN_ANY_CON_ANY;
ESP_LOGD(LOG_TAG, "<< setScanFilter");
return;
}
if (scanRequestWhitelistOnly && !connectWhitelistOnly) {
m_advParams.adv_filter_policy = ADV_FILTER_ALLOW_SCAN_WLST_CON_ANY;
ESP_LOGD(LOG_TAG, "<< setScanFilter");
return;
}
if (!scanRequestWhitelistOnly && connectWhitelistOnly) {
m_advParams.adv_filter_policy = ADV_FILTER_ALLOW_SCAN_ANY_CON_WLST;
ESP_LOGD(LOG_TAG, "<< setScanFilter");
return;
}
if (scanRequestWhitelistOnly && connectWhitelistOnly) {
m_advParams.adv_filter_policy = ADV_FILTER_ALLOW_SCAN_WLST_CON_WLST;
ESP_LOGD(LOG_TAG, "<< setScanFilter");
return;
}
} // setScanFilter
*/
This code is for Arduino.

Re: How to hide BLE in ESP32?

Posted: Thu Aug 16, 2018 4:07 pm
by mike_acosta_v
I'm sorry.
This is the correct:

BLEServer *server = NULL;
server = BLEDevice::createServer();
server->getAdvertising()->setScanFilter(1,0);

Re: How to hide BLE in ESP32?

Posted: Wed Aug 29, 2018 3:23 pm
by necati
bobolink wrote:I think it has to be supported in the BLE implementation on the ESP32. It’s optional.
The ESP32 isn’t “found” because it isn’t advertising (transmitting) its services all the time. Its receiver is listening for a certain transmission, if heard then it starts advertising as a normal peripheral.
It’s complicated because the ESP32 performs two roles. As Central and as Peripheral.
I don’t know if that is what you had in mind or you wanted to control the radio directly with some kind of low probability of intercept waveform. Which is way beyond me.

Here is a video I did on soliciting services on the iPhone. It’s embarrassing to watch since I was just leaning YouTube and the narrator sounds like an idiot :D
https://youtu.be/d0woZaZjkAs
I'm new to BLE technology. I do research for ESP32.

You know the communication between the Macbook and the magic mouse. Mouse broadcasts. The Macbook will receive this broadcast.
Here the MacBook does not appear with other device scans. But bluetooth is on. Can we configure the same for esp32?

I am working on an android project. You can also think about IOS. I want to make a ble communication with Esp32. I only have one wish. Esp32 does not appear when scanning other bluetooth devices.

ESP32 does not appear in the scan of andorid and iOS devices. Just like the MacBook.

How does good communication take place? Android phone has esp32's Service_UUID or Characteristic_UUID. Is it possible to connect to ESP32 even though it does not appear in any browsing?

Re: How to hide BLE in ESP32?

Posted: Mon Sep 17, 2018 12:21 am
by zeitounian
Good night, your work was very good, I need help to connect the Iphone to the ESP32, I do not succeed in my attempts, how do I run the devices, how do I pair with Android.

Re: How to hide BLE in ESP32?

Posted: Tue Oct 09, 2018 11:37 pm
by SombraRPK
Great! Thank you all, guys! Tried the mike_acosta's code and now it is working wonderfully!