How to hide BLE in ESP32?
How to hide BLE in ESP32?
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.
Any idea is welcomed.
Thanks in advance, guys.
Re: How to hide BLE in ESP32?
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.
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?
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?
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
https://youtu.be/d0woZaZjkAs
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
https://youtu.be/d0woZaZjkAs
Re: How to hide BLE in ESP32?
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
https://github.com/nkolban/esp32-snippets/issues/430
-
- Posts: 2
- Joined: Wed Aug 15, 2018 1:34 am
Re: How to hide BLE in ESP32?
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.
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.
-
- Posts: 2
- Joined: Wed Aug 15, 2018 1:34 am
Re: How to hide BLE in ESP32?
I'm sorry.
This is the correct:
BLEServer *server = NULL;
server = BLEDevice::createServer();
server->getAdvertising()->setScanFilter(1,0);
This is the correct:
BLEServer *server = NULL;
server = BLEDevice::createServer();
server->getAdvertising()->setScanFilter(1,0);
Re: How to hide BLE in ESP32?
I'm new to BLE technology. I do research for ESP32.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
https://youtu.be/d0woZaZjkAs
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?
-
- Posts: 5
- Joined: Mon Sep 17, 2018 12:16 am
Re: How to hide BLE in ESP32?
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?
Great! Thank you all, guys! Tried the mike_acosta's code and now it is working wonderfully!
Who is online
Users browsing this forum: No registered users and 81 guests