Arduino-esp32: BLE - Connecting to multiple peripherals one at a time not working

Created on 3 Aug 2019  路  9Comments  路  Source: espressif/arduino-esp32

Hardware:

Board: DOIT ESP32 DevKit V1
Core Installation version: 1.0.2
IDE name: Arduino IDE
Flash Frequency: 80Mhz
Upload Speed: 921600
Computer OS: Windows 10

Description:

I want to connect to all the peripherals detected in a BLE scan ONE AT A TIME. Once connected, read/update characteristic values, disconnect and move on to the next one.
If there is only one peripheral in range, it works fine. But if 2 come in range with the same Service and characteristics etc. The client tries to establish connection to the next one even before the first one gets disconnected. This causes the code to get stuck. No error, just stuck in the serial monitor.

Update:

For some reason, turning the Core debug level to debug makes the code run for more iterations than normally. Don't know how this is affecting the running the code but it is. It runs for 10-12 times then Serial monitor just stops just like in normal scenario.
I need the loop to run infinitely without risk of getting stuck like this. Any help will be highly appreciated.

Sketch: (leave the backquotes for code formatting)

#include "BLEDevice.h"
#include "BLEScan.h"

// The remote service we wish to connect to.
#define serviceUUID "51cc567a-e8c6-4af0-9315-e955c51ebe1d"
// The characteristics of the remote service we are interested in.
#define usernameUUID "e2322b44-d4b1-40bc-a95b-6d3a24537a62"
#define lastAccessUUID "7937b8b7-1692-4953-9c48-88838252f9ea"
#define deviceNameUUID "19A76C2D-DBBB-4A30-B927-991DCC75E5D8"

// Duration of scan in seconds
#define scanTime 5

static BLERemoteCharacteristic* pRemoteCharacteristic;
static BLEScan* pBLEScan;
std::string prevUsers[10];
uint8_t prevCount = 0;
static bool connected = false;

class MyClientCallback : public BLEClientCallbacks {
    void onConnect(BLEClient* pclient) {
      Serial.println(" - Connected to server\n");
      connected = true;
    }

    void onDisconnect(BLEClient* pclient) {
      Serial.println(" - Disconnected from server\n");
      connected = false;
    }
};

bool connectToServer(BLEAdvertisedDevice* currentDevice) {
  Serial.print("Forming a connection to ");
  Serial.println(currentDevice->getAddress().toString().c_str());

  BLEClient*  pClient  = BLEDevice::createClient();
  Serial.println(" - Created client");

  // Connect to the remote BLE Server.
  pClient->connect(currentDevice);  // if you pass BLEAdvertisedDevice instead of address, it will be recognized type of peer device address (public or private)
  Serial.println(" - Connected to server");

  pClient->setClientCallbacks(new MyClientCallback());

  // Obtain a reference to the service we are after in the remote BLE server.
  BLERemoteService* pRemoteService = pClient->getService(BLEUUID(serviceUUID));
  if (pRemoteService == nullptr) {
    Serial.print("Failed to find our service UUID: ");
    Serial.println(serviceUUID);
    pClient->disconnect();
    return false;
  }
  Serial.println(" - Found our service");


  // Obtain a reference to the characteristic in the service of the remote BLE server.
  pRemoteCharacteristic = pRemoteService->getCharacteristic(BLEUUID(usernameUUID));
  if (pRemoteCharacteristic == nullptr) {
    Serial.print("Failed to find our characteristic UUID: ");
    Serial.println(usernameUUID);
    pClient->disconnect();
    return false;
  }

  // Read the value of the characteristic.
  if (pRemoteCharacteristic->canRead()) {
    Serial.print("The username for this device is: ");
    Serial.println(pRemoteCharacteristic->readValue().c_str());

    // Add this username in history

  }

  // Obtain a reference to the characteristic in the service of the remote BLE server.
  pRemoteCharacteristic = pRemoteService->getCharacteristic(BLEUUID(deviceNameUUID));
  if (pRemoteCharacteristic == nullptr) {
    Serial.print("Failed to find our characteristic UUID: ");
    Serial.println(deviceNameUUID);
    pClient->disconnect();
    return false;
  }

  // Read the value of the characteristic.
  if (pRemoteCharacteristic->canRead()) {
    Serial.print("The device name for this client is: ");
    Serial.println(pRemoteCharacteristic->readValue().c_str());
  }

  // Obtain a reference to the characteristic in the service of the remote BLE server.
  pRemoteCharacteristic = pRemoteService->getCharacteristic(BLEUUID(lastAccessUUID));
  if (pRemoteCharacteristic == nullptr) {
    Serial.print("Failed to find our characteristic UUID: ");
    Serial.println(lastAccessUUID);
    pClient->disconnect();
    return false;
  }

  // Read the value of the characteristic.
  if (pRemoteCharacteristic->canRead()) {
    Serial.print("This device was last accessed ");
    Serial.print(pRemoteCharacteristic->readValue().c_str());
    Serial.println(" seconds before");
  }

  String newValue = "Time since boot: " + String(millis() / 1000);
  Serial.println("Setting new characteristic value to \"" + newValue + "\"");

  // Set the characteristic's value to be the array of bytes that is actually a string.
  pRemoteCharacteristic->writeValue(newValue.c_str(), newValue.length());

  pClient->disconnect();
}
/**
   Scan for BLE servers and find the first one that advertises the service we are looking for.
*/
class MyAdvertisedDeviceCallbacks: public BLEAdvertisedDeviceCallbacks {
    /**
        Called for each advertising BLE server.
    */
    void onResult(BLEAdvertisedDevice advertisedDevice) {
      Serial.print("BLE Advertised Device found: ");
      Serial.println(advertisedDevice.toString().c_str());
    } // onResult
}; // MyAdvertisedDeviceCallbacks

void setup() {
  Serial.begin(115200);
  Serial.println("Starting Arduino BLE Client application...");
  BLEDevice::init("");

  // Retrieve a Scanner and set the callback we want to use to be informed when we
  // have detected a new device.  Specify that we want active scanning and start the
  // scan to run for scantime seconds.
  pBLEScan = BLEDevice::getScan(); //create new scan
  pBLEScan->setAdvertisedDeviceCallbacks(new MyAdvertisedDeviceCallbacks());
  pBLEScan->setInterval(1349);
  pBLEScan->setWindow(449);
  pBLEScan->setActiveScan(true);

} // End of setup.


// This is the Arduino main loop function.
void loop() {

  BLEScanResults foundDevices = pBLEScan->start(scanTime, false);
  Serial.print("Devices found: ");
  Serial.println(foundDevices.getCount());
  Serial.println("Scan done!");

  for (uint8_t i = 0; i < foundDevices.getCount(); i++) {
    while(connected); // Wait till previous connection gets free

    BLEAdvertisedDevice* advertisedDevice = new BLEAdvertisedDevice(foundDevices.getDevice(i));

    // We have found a device, let us now see if it contains the service we are looking for.
    if (advertisedDevice->haveServiceUUID() && advertisedDevice->isAdvertisingService(BLEUUID(serviceUUID))) {
      bool alreadyHandled = false;

      if (alreadyHandled == false) {
        Serial.print("BLE Address: ");
        Serial.println(advertisedDevice->getAddress().toString().c_str());

        if (connectToServer(advertisedDevice)) {
          Serial.println("We are now connected to the BLE Server.");
        } else {
          Serial.println("We have failed to connect to the server; there is nothin more we will do.");
        }
      }

    } // Found our server
  }

  pBLEScan->clearResults();   // delete results fromBLEScan buffer to release memory

  delay(5000); // Delay a second between loops.
} // End of loop

Debug Messages:

The screenshot from the Serial Monitor:

Starting Arduino BLE Client application...
BLE Advertised Device found: Name: Galaxy S8+, Address: 79:35:43:80:fc:dd, serviceUUID: 51cc567a-e8c6-4af0-9315-e955c51ebe1d
BLE Advertised Device found: Name: Galaxy S8+, Address: 7e:43:b2:77:0c:86, serviceUUID: 51cc567a-e8c6-4af0-9315-e955c51ebe1d
BLE Advertised Device found: Name: , Address: 19:a9:0d:ee:63:83, manufacturer data: 060001092002edb717646d49d0e382ef733de8b3da9a0c899c17f74ed9
Devices found: 3
Scan done!
BLE Address: 79:35:43:80:fc:dd
Forming a connection to 79:35:43:80:fc:dd
 - Created client
 - Connected to server
 - Found our service
The username for this device is: mohsin
The device name for this client is: Galaxy S8+
This device was last accessed Time since boot: 30 seconds before
Setting new characteristic value to "Time since boot: 7"
We are now connected to the BLE Server.
BLE Address: 7e:43:b2:77:0c:86
Forming a connection to 7e:43:b2:77:0c:86
 - Created client
 - Disconnected from server

The following is the screenshot with Debug level changed:

Starting Arduino BLE Client application...
[D][FreeRTOS.cpp:158] take(): Semaphore taking: name: ScanEnd (0x3ffdecf8), owner: <N/A> for start
[D][FreeRTOS.cpp:167] take(): Semaphore taken:  name: ScanEnd (0x3ffdecf8), owner: start
[D][BLEAdvertisedDevice.cpp:418] setRSSI(): - setRSSI(): rssi: -83
[D][BLEAdvertisedDevice.cpp:247] parseAdvertisement(): Type: 0x01 (), length: 1, data: 1a
[D][BLEAdvertisedDevice.cpp:247] parseAdvertisement(): Type: 0x09 (), length: 10, data: 47616c6178792053382b
[D][BLEAdvertisedDevice.cpp:407] setName(): - setName(): name: Galaxy S8+
[D][BLEAdvertisedDevice.cpp:247] parseAdvertisement(): Type: 0x09 (), length: 10, data: 47616c6178792053382b
[D][BLEAdvertisedDevice.cpp:407] setName(): - setName(): name: Galaxy S8+
[D][BLEAdvertisedDevice.cpp:247] parseAdvertisement(): Type: 0x07 (), length: 16, data: 1dbe1ec555e91593f04ac6e87a56cc51
[D][BLEAdvertisedDevice.cpp:447] setServiceUUID(): - addServiceUUID(): serviceUUID: 51cc567a-e8c6-4af0-9315-e955c51ebe1d
BLE Advertised Device found: Name: Galaxy S8+, Address: 7e:7d:5a:f6:22:fd, serviceUUID: 51cc567a-e8c6-4af0-9315-e955c51ebe1d
[D][BLEAdvertisedDevice.cpp:418] setRSSI(): - setRSSI(): rssi: -83
[D][BLEAdvertisedDevice.cpp:247] parseAdvertisement(): Type: 0x01 (), length: 1, data: 1a
[D][BLEAdvertisedDevice.cpp:247] parseAdvertisement(): Type: 0x09 (), length: 10, data: 47616c6178792053382b
[D][BLEAdvertisedDevice.cpp:407] setName(): - setName(): name: Galaxy S8+
[D][BLEAdvertisedDevice.cpp:247] parseAdvertisement(): Type: 0x09 (), length: 10, data: 47616c6178792053382b
[D][BLEAdvertisedDevice.cpp:407] setName(): - setName(): name: Galaxy S8+
[D][BLEAdvertisedDevice.cpp:247] parseAdvertisement(): Type: 0x07 (), length: 16, data: 1dbe1ec555e91593f04ac6e87a56cc51
[D][BLEAdvertisedDevice.cpp:447] setServiceUUID(): - addServiceUUID(): serviceUUID: 51cc567a-e8c6-4af0-9315-e955c51ebe1d
BLE Advertised Device found: Name: Galaxy S8+, Address: 65:4f:aa:61:0e:5d, serviceUUID: 51cc567a-e8c6-4af0-9315-e955c51ebe1d
[D][BLEScan.cpp:97] handleGAPEvent(): Ignoring 7e:7d:5a:f6:22:fd, already seen it.
[D][BLEScan.cpp:97] handleGAPEvent(): Ignoring 65:4f:aa:61:0e:5d, already seen it.
[D][BLEScan.cpp:97] handleGAPEvent(): Ignoring 7e:7d:5a:f6:22:fd, already seen it.
[D][BLEScan.cpp:97] handleGAPEvent(): Ignoring 65:4f:aa:61:0e:5d, already seen it.
[D][BLEScan.cpp:97] handleGAPEvent(): Ignoring 7e:7d:5a:f6:22:fd, already seen it.
[D][BLEScan.cpp:97] handleGAPEvent(): Ignoring 65:4f:aa:61:0e:5d, already seen it.
[D][BLEScan.cpp:97] handleGAPEvent(): Ignoring 7e:7d:5a:f6:22:fd, already seen it.
[D][BLEScan.cpp:97] handleGAPEvent(): Ignoring 65:4f:aa:61:0e:5d, already seen it.
[D][BLEScan.cpp:97] handleGAPEvent(): Ignoring 7e:7d:5a:f6:22:fd, already seen it.
[D][BLEScan.cpp:97] handleGAPEvent(): Ignoring 65:4f:aa:61:0e:5d, already seen it.
[W][BLEScan.cpp:69] handleGAPEvent(): ESP_GAP_SEARCH_INQ_CMPL_EVT
Devices found: 2
Scan done!
BLE Address: 65:4f:aa:61:0e:5d
Forming a connection to 65:4f:aa:61:0e:5d
 - Created client
[I][BLEDevice.cpp:600] addPeerDevice(): add conn_id: 0, GATT role: client
[D][FreeRTOS.cpp:158] take(): Semaphore taking: name: RegEvt (0x3ffdeee4), owner: <N/A> for connect
[D][FreeRTOS.cpp:167] take(): Semaphore taken:  name: RegEvt (0x3ffdeee4), owner: connect
[D][BLEDevice.cpp:154] gattClientEventHandler(): gattClientEventHandler [esp_gatt_if: 4] ... Unknown
[D][BLEClient.cpp:158] gattClientEventHandler(): gattClientEventHandler [esp_gatt_if: 4] ... Unknown
[D][FreeRTOS.cpp:158] take(): Semaphore taking: name: OpenEvt (0x3ffdef44), owner: <N/A> for connect
[D][FreeRTOS.cpp:167] take(): Semaphore taken:  name: OpenEvt (0x3ffdef44), owner: connect
[D][BLEDevice.cpp:154] gattClientEventHandler(): gattClientEventHandler [esp_gatt_if: 4] ... Unknown
[D][BLEClient.cpp:158] gattClientEventHandler(): gattClientEventHandler [esp_gatt_if: 4] ... Unknown
[D][BLEDevice.cpp:584] updatePeerDevice(): update conn_id: 4, GATT role: client
[D][BLEDevice.cpp:154] gattClientEventHandler(): gattClientEventHandler [esp_gatt_if: 4] ... Unknown
[D][BLEClient.cpp:158] gattClientEventHandler(): gattClientEventHandler [esp_gatt_if: 4] ... Unknown
 - Connected to server
[D][FreeRTOS.cpp:158] take(): Semaphore taking: name: SearchCmplEvt (0x3ffdefa4), owner: <N/A> for getServices
[D][FreeRTOS.cpp:167] take(): Semaphore taken:  name: SearchCmplEvt (0x3ffdefa4), owner: getServices
[D][BLEClient.cpp:457] handleGAPEvent(): BLEClient ... handling GAP event!
[D][BLEDevice.cpp:154] gattClientEventHandler(): gattClientEventHandler [esp_gatt_if: 4] ... Unknown
[D][BLEClient.cpp:158] gattClientEventHandler(): gattClientEventHandler [esp_gatt_if: 4] ... Unknown
[D][BLEDevice.cpp:154] gattClientEventHandler(): gattClientEventHandler [esp_gatt_if: 4] ... Unknown
[D][BLEClient.cpp:158] gattClientEventHandler(): gattClientEventHandler [esp_gatt_if: 4] ... Unknown
[D][BLEDevice.cpp:154] gattClientEventHandler(): gattClientEventHandler [esp_gatt_if: 4] ... Unknown
[D][BLEClient.cpp:158] gattClientEventHandler(): gattClientEventHandler [esp_gatt_if: 4] ... Unknown
[D][BLEDevice.cpp:154] gattClientEventHandler(): gattClientEventHandler [esp_gatt_if: 4] ... Unknown
[D][BLEClient.cpp:158] gattClientEventHandler(): gattClientEventHandler [esp_gatt_if: 4] ... Unknown
 - Found our service
[D][BLEDevice.cpp:154] gattClientEventHandler(): gattClientEventHandler [esp_gatt_if: 4] ... Unknown
[D][BLERemoteService.cpp:191] retrieveCharacteristics(): Found a characteristic: Handle: 42, UUID: e2322b44-d4b1-40bc-a95b-6d3a24537a62
[D][BLEClient.cpp:158] gattClientEventHandler(): gattClientEventHandler [esp_gatt_if: 4] ... Unknown
[E][BLERemoteCharacteristic.cpp:274] retrieveDescriptors(): esp_ble_gattc_get_all_descr: Unknown
[D][BLERemoteService.cpp:191] retrieveCharacteristics(): Found a characteristic: Handle: 44, UUID: 7937b8b7-1692-4953-9c48-88838252f9ea
[E][BLERemoteCharacteristic.cpp:274] retrieveDescriptors(): esp_ble_gattc_get_all_descr: Unknown
[D][BLERemoteService.cpp:191] retrieveCharacteristics(): Found a characteristic: Handle: 46, UUID: 19a76c2d-dbbb-4a30-b927-991dcc75e5d8
[E][BLERemoteCharacteristic.cpp:274] retrieveDescriptors(): esp_ble_gattc_get_all_descr: Unknown
The username for this device is: [D][FreeRTOS.cpp:158] take(): Semaphore taking: name: ReadCharEvt (0x3ffe13fc), owner: <N/A> for readValue
[D][FreeRTOS.cpp:167] take(): Semaphore taken:  name: ReadCharEvt (0x3ffe13fc), owner: readValue
[D][BLEClient.cpp:457] handleGAPEvent(): BLEClient ... handling GAP event!
[D][BLEDevice.cpp:154] gattClientEventHandler(): gattClientEventHandler [esp_gatt_if: 4] ... Unknown
[D][BLEClient.cpp:158] gattClientEventHandler(): gattClientEventHandler [esp_gatt_if: 4] ... Unknown
mohsin
The device name for this client is: [D][FreeRTOS.cpp:158] take(): Semaphore taking: name: ReadCharEvt (0x3ffe1950), owner: <N/A> for readValue
[D][FreeRTOS.cpp:167] take(): Semaphore taken:  name: ReadCharEvt (0x3ffe1950), owner: readValue
[D][BLEDevice.cpp:154] gattClientEventHandler(): gattClientEventHandler [esp_gatt_if: 4] ... Unknown
[D][BLEClient.cpp:158] gattClientEventHandler(): gattClientEventHandler [esp_gatt_if: 4] ... Unknown
Galaxy S8+
This device was last accessed [D][FreeRTOS.cpp:158] take(): Semaphore taking: name: ReadCharEvt (0x3ffe16d0), owner: <N/A> for readValue
[D][FreeRTOS.cpp:167] take(): Semaphore taken:  name: ReadCharEvt (0x3ffe16d0), owner: readValue
[D][BLEDevice.cpp:154] gattClientEventHandler(): gattClientEventHandler [esp_gatt_if: 4] ... Unknown
[D][BLEClient.cpp:158] gattClientEventHandler(): gattClientEventHandler [esp_gatt_if: 4] ... Unknown
Time since boot: 154 seconds before
Setting new characteristic value to "Time since boot: 7"
[D][FreeRTOS.cpp:158] take(): Semaphore taking: name: WriteCharEvt (0x3ffe1790), owner: <N/A> for writeValue
[D][FreeRTOS.cpp:167] take(): Semaphore taken:  name: WriteCharEvt (0x3ffe1790), owner: writeValue
[D][BLEDevice.cpp:154] gattClientEventHandler(): gattClientEventHandler [esp_gatt_if: 4] ... Unknown
[D][BLEClient.cpp:158] gattClientEventHandler(): gattClientEventHandler [esp_gatt_if: 4] ... Unknown
We are now connected to the BLE Server.
[D][BLEDevice.cpp:154] gattClientEventHandler(): gattClientEventHandler [esp_gatt_if: 4] ... Unknown
7e:7d:5a:f6:22:fd
[D][BLEClient.cpp:158] gattClientEventHandler(): gattClientEventHandler [esp_gatt_if: 4] ... Unknown
7e:7d:5a:f6:22:fd
[D][BLEDevice.cpp:154] gattClientEventHandler(): gattClientEventHandler [esp_gatt_if: 4] ... Unknown
[D][BLEClient.cpp:158] gattClientEventHandler(): gattClientEventHandler [esp_gatt_if: 4] ... Unknown
[I][BLEDevice.cpp:600] addPeerDevice(): add conn_id: 1, GATT role: client
[I][BLEDevice.cpp:611] removePeerDevice(): remove: 0, GATT role client
[D][FreeRTOS.cpp:158] take(): Semaphore taking: name: RegEvt (0x3ffdf4f0), owner: <N/A> for connect
[D][BLEDevice.cpp:154] gattClientEventHandler(): gattClientEventHandler [esp_gatt_if: 4] ... Unknown
[D][FreeRTOS.cpp:167] take(): Semaphore taken:  name: RegEvt (0x3ffdf4f0), owner: connect
[D][BLEClient.cpp:158] gattClientEventHandler(): gattClientEventHandler [esp_gatt_if: 4] ... Unknown
[D][BLEDevice.cpp:154] gattClientEventHandler(): gattClientEventHandler [esp_gatt_if: 4] ... Unknown
[D][BLEClient.cpp:158] gattClientEventHandler(): gattClientEventHandler [esp_gatt_if: 4] ... Unknown
[D][FreeRTOS.cpp:158] take(): Semaphore taking: name: OpenEvt (0x3ffdf1e0), owner: <N/A> for connect
[D][FreeRTOS.cpp:167] take(): Semaphore taken:  name: OpenEvt (0x3ffdf1e0), owner: connect
[D][BLEDevice.cpp:154] gattClientEventHandler(): gattClientEventHandler [esp_gatt_if: 4] ... Unknown
[D][BLEClient.cpp:158] gattClientEventHandler(): gattClientEventHandler [esp_gatt_if: 4] ... Unknown
[D][BLEDevice.cpp:584] updatePeerDevice(): update conn_id: 4, GATT role: client
[D][BLEDevice.cpp:154] gattClientEventHandler(): gattClientEventHandler [esp_gatt_if: 4] ... Unknown
[D][BLEClient.cpp:158] gattClientEventHandler(): gattClientEventHandler [esp_gatt_if: 4] ... Unknown
 - Connected to server
[D][FreeRTOS.cpp:158] take(): Semaphore taking: name: SearchCmplEvt (0x3ffdf240), owner: <N/A> for getServices
[D][FreeRTOS.cpp:167] take(): Semaphore taken:  name: SearchCmplEvt (0x3ffdf240), owner: getServices
[D][BLEClient.cpp:457] handleGAPEvent(): BLEClient ... handling GAP event!
[D][BLEDevice.cpp:154] gattClientEventHandler(): gattClientEventHandler [esp_gatt_if: 4] ... Unknown
[D][BLEClient.cpp:158] gattClientEventHandler(): gattClientEventHandler [esp_gatt_if: 4] ... Unknown
[D][BLEDevice.cpp:154] gattClientEventHandler(): gattClientEventHandler [esp_gatt_if: 4] ... Unknown
[D][BLEClient.cpp:158] gattClientEventHandler(): gattClientEventHandler [esp_gatt_if: 4] ... Unknown
[D][BLEDevice.cpp:154] gattClientEventHandler(): gattClientEventHandler [esp_gatt_if: 4] ... Unknown
[D][BLEClient.cpp:158] gattClientEventHandler(): gattClientEventHandler [esp_gatt_if: 4] ... Unknown
[D][BLEDevice.cpp:154] gattClientEventHandler(): gattClientEventHandler [esp_gatt_if: 4] ... Unknown
[D][BLEClient.cpp:158] gattClientEventHandler(): gattClientEventHandler [esp_gatt_if: 4] ... Unknown
[D][BLEDevice.cpp:154] gattClientEventHandler(): gattClientEventHandler [esp_gatt_if: 4] ... Unknown
[D][BLEClient.cpp:158] gattClientEventHandler(): gattClientEventHandler [esp_gatt_if: 4] ... Unknown
[D][BLERemoteService.cpp:191] retrieveCharacteristics(): Found a characteristic: Handle: 42, UUID: e2322b44-d4b1-40bc-a95b-6d3a24537a62
[D][BLEClient.cpp:457] handleGAPEvent(): BLEClient ... handling GAP event!
[E][BLERemoteCharacteristic.cpp:274] retrieveDescriptors(): esp_ble_gattc_get_all_descr: Unknown
[D][BLERemoteService.cpp:191] retrieveCharacteristics(): Found a characteristic: Handle: 44, UUID: 7937b8b7-1692-4953-9c48-88838252f9ea
[E][BLERemoteCharacteristic.cpp:274] retrieveDescriptors(): esp_ble_gattc_get_all_descr: Unknown
[D][BLERemoteService.cpp:191] retrieveCharacteristics(): Found a characteristic: Handle: 46, UUID: 19a76c2d-dbbb-4a30-b927-991dcc75e5d8
[E][BLERemoteCharacteristic.cpp:274] retrieveDescriptors(): esp_ble_gattc_get_all_descr: Unknown
The username for this device is: [D][FreeRTOS.cpp:158] take(): Semaphore taking: name: ReadCharEvt (0x3ffe2564), owner: <N/A> for readValue
[D][FreeRTOS.cpp:167] take(): Semaphore taken:  name: ReadCharEvt (0x3ffe2564), owner: readValue
[D][BLEDevice.cpp:154] gattClientEventHandler(): gattClientEventHandler [esp_gatt_if: 4] ... Unknown
[D][BLEClient.cpp:158] gattClientEventHandler(): gattClientEventHandler [esp_gatt_if: 4] ... Unknown
mohsin
The device name for this client is: [D][FreeRTOS.cpp:158] take(): Semaphore taking: name: ReadCharEvt (0x3ffe2bac), owner: <N/A> for readValue
[D][FreeRTOS.cpp:167] take(): Semaphore taken:  name: ReadCharEvt (0x3ffe2bac), owner: readValue
[D][BLEDevice.cpp:154] gattClientEventHandler(): gattClientEventHandler [esp_gatt_if: 4] ... Unknown
[D][BLEClient.cpp:158] gattClientEventHandler(): gattClientEventHandler [esp_gatt_if: 4] ... Unknown
Galaxy S8+
This device was last accessed [D][FreeRTOS.cpp:158] take(): Semaphore taking: name: ReadCharEvt (0x3ffe2624), owner: <N/A> for readValue
[D][FreeRTOS.cpp:167] take(): Semaphore taken:  name: ReadCharEvt (0x3ffe2624), owner: readValue
[D][BLEDevice.cpp:154] gattClientEventHandler(): gattClientEventHandler [esp_gatt_if: 4] ... Unknown
[D][BLEClient.cpp:158] gattClientEventHandler(): gattClientEventHandler [esp_gatt_if: 4] ... Unknown
Time since boot: 7 seconds before
Setting new characteristic value to "Time since boot: 8"
[D][FreeRTOS.cpp:158] take(): Semaphore taking: name: WriteCharEvt (0x3ffe29c4), owner: <N/A> for writeValue
[D][FreeRTOS.cpp:167] take(): Semaphore taken:  name: WriteCharEvt (0x3ffe29c4), owner: writeValue
[D][BLEDevice.cpp:154] gattClientEventHandler(): gattClientEventHandler [esp_gatt_if: 4] ... Unknown
[D][BLEClient.cpp:158] gattClientEventHandler(): gattClientEventHandler [esp_gatt_if: 4] ... Unknown
We are now connected to the BLE Server.
[D][BLEDevice.cpp:154] gattClientEventHandler(): gattClientEventHandler [esp_gatt_if: 4] ... Unknown
[D][BLEClient.cpp:158] gattClientEventHandler(): gattClientEventHandler [esp_gatt_if: 4] ... Unknown
[D][BLEDevice.cpp:154] gattClientEventHandler(): gattClientEventHandler [esp_gatt_if: 4] ... Unknown
[D][BLEClient.cpp:158] gattClientEventHandler(): gattClientEventHandler [esp_gatt_if: 4] ... Unknown
[I][BLEDevice.cpp:611] removePeerDevice(): remove: 1, GATT role client
[D][BLEDevice.cpp:154] gattClientEventHandler(): gattClientEventHandler [esp_gatt_if: 4] ... Unknown
[D][FreeRTOS.cpp:158] take(): Semaphore taking: name: ScanEnd (0x3ffdecf8), owner: <N/A> for start
[D][FreeRTOS.cpp:167] take(): Semaphore taken:  name: ScanEnd (0x3ffdecf8), owner: start

stale

Most helpful comment

All 9 comments

[STALE_SET] This issue has been automatically marked as stale because it has not had recent activity. It will be closed in 14 days if no further activity occurs. Thank you for your contributions.

[STALE_CLR] This issue has been removed from the stale queue. Please ensure activity to keep it openin the future.

@wakwak-koba maybe submit a PR with your changes since your repo may be out of date on other parts of the core...

I merged to the latest 1.0.4 a few hours ago.

@wakwak-koba great, but submitting a PR is best for the end user.

Also just solved all my connection/disconnection problems with the version from @wakwak-koba. Please do a PR for that @wakwak-koba

[STALE_SET] This issue has been automatically marked as stale because it has not had recent activity. It will be closed in 14 days if no further activity occurs. Thank you for your contributions.

[STALE_DEL] This stale issue has been automatically closed. Thank you for your contributions.

Was this page helpful?
0 / 5 - 0 ratings