Skip to content

BLEScan first scan ok, next no name, no service UUID #3677

@Nagymadar

Description

@Nagymadar

I am using BLE_scan.ino example. Unfortunately only the first scan gives valid device serviceUUID and Name. From the second scan onward SENSOR_PRO device gives no serviceUUID the HMSoft device gives empty string as Name. It seems it is an old bug, but still no solution? Serial data from boot:

Scanning...
Advertised Device: Name: SENSOR_PRO, Address: ed:3d:9a:96:86:a3, serviceUUID: 6a800001-b5a3-f393-e0a9-e50e24dcca9e
Advertised Device: Name: HMSoft, Address: 90:9a:77:27:65:15, manufacturer data: 484d909a77276515, serviceUUID: 0000ffe0-0000-1000-8000-00805f9b34fb, txPower: 0
Devices found: 2
Scan done!

Advertised Device: Name: SENSOR_PRO, Address: ed:3d:9a:96:86:a3
Advertised Device: Name: , Address: 90:9a:77:27:65:15, manufacturer data: 484d909a77276515, serviceUUID: 0000ffe0-0000-1000-8000-00805f9b34fb, txPower: 0
Devices found: 2
Scan done!

Advertised Device: Name: SENSOR_PRO, Address: ed:3d:9a:96:86:a3
Advertised Device: Name: , Address: 90:9a:77:27:65:15, manufacturer data: 484d909a77276515, serviceUUID: 0000ffe0-0000-1000-8000-00805f9b34fb, txPower: 0
Devices found: 2
Scan done!

etc...

Activity

chegewara

chegewara commented on Jan 29, 2020

@chegewara
Contributor

Its hard to do anything if i cant reproduce issue:

03:27:33.927 -> Device: 
03:27:33.927 -> TX power => -7
03:27:33.927 -> RSSI => -96
03:27:33.927 -> Name: Chege
03:27:34.226 -> Device: 
03:27:34.226 -> TX power => -7
03:27:34.226 -> RSSI => -85
03:27:34.226 -> Name: Chege
03:27:34.493 -> Device: 
03:27:34.493 -> TX power => -7
03:27:34.493 -> RSSI => -85
03:27:34.493 -> Name: Chege
03:27:34.792 -> Device: 
03:27:34.792 -> TX power => -7
03:27:34.792 -> RSSI => -86
03:27:34.792 -> Name: Chege
03:27:35.092 -> Device: 
03:27:35.092 -> TX power => -7
03:27:35.092 -> RSSI => -84
03:27:35.092 -> Name: Chege
03:27:35.658 -> Device: 
03:27:35.658 -> TX power => -7
03:27:35.658 -> RSSI => -89
03:27:35.658 -> Name: Chege
03:27:36.233 -> Device: 
03:27:36.233 -> TX power => -7
03:27:36.233 -> RSSI => -91
03:27:36.233 -> Name: Chege
03:27:36.529 -> Device: 
03:27:36.529 -> TX power => -7
03:27:36.529 -> RSSI => -81
03:27:36.529 -> Name: Chege

My peer device is android smartphone running nRF connect with advertising.
Here is scan callback:

class ScanResults: public BLEAdvertisedDeviceCallbacks {
  void onResult(BLEAdvertisedDevice device)
  {
    if(device.haveName())
    {
      Serial.printf("Device: \nTX power => %d\nRSSI => %d\n", device.getTXPower(), device.getRSSI());
      Serial.printf("Name: %s\n", device.getName().c_str());
    }
  }
};

I can only say that i am running this code on platformio with arduino + esp-idf, wifi and mqtt (code omitted).

Nagymadar

Nagymadar commented on Jan 29, 2020

@Nagymadar
Author

With the original arduino BLE_scan.ino, just modified the callback as below. Still no luck. I have tried haveName() too in the callback, but then I got back nothing after the first scan.

Hardware: ESP32 Wrover Module, default settings.

class MyAdvertisedDeviceCallbacks: public BLEAdvertisedDeviceCallbacks {
    void onResult(BLEAdvertisedDevice device) {
      //Serial.printf("Advertised Device: %s \n", device.toString().c_str());
      Serial.printf("Device: \nTX power => %d\nRSSI => %d\n", device.getTXPower(), device.getRSSI());
      Serial.printf("Name: %s\n", device.getName().c_str());
    }
};

Results:

Scanning...
Device: 
TX power => 0
RSSI => -91
Name: Comet Blue
Device: 
TX power => 12
RSSI => -92
Name: 
Device: 
TX power => 0
RSSI => -78
Name: Comet Blue
Devices found: 3
Scan done!

Device: 
TX power => 0
RSSI => -95
Name: 
Device: 
TX power => 0
RSSI => -79
Name: 
Device: 
TX power => 12
RSSI => -92
Name: 
Devices found: 3
Scan done!

Device: 
TX power => 0
RSSI => -90
Name: 
Device: 
TX power => 12
RSSI => -94
Name: 
Device: 
TX power => 0
RSSI => -86
Name: 
Devices found: 3
Scan done!
Nagymadar

Nagymadar commented on Jan 29, 2020

@Nagymadar
Author

Comet Blue looses its name, while SENSOR_PRO looses its UUID after the first scan. See results and full code below:

Results:

Scanning...
Device Name: SENSOR_PRO, TX: 0, RSSI: -70, UUID: 6a800001-b5a3-f393-e0a9-e50e24dcca9e
Device Name: Comet Blue, TX: 0, RSSI: -90, UUID: 47e9ee00-47e9-11e4-8939-164230d1df67
Devices found: 2
Scan done!

Device Name: SENSOR_PRO, TX: 0, RSSI: -58
Device Name: , TX: 0, RSSI: -89, UUID: 47e9ee00-47e9-11e4-8939-164230d1df67
Devices found: 2
Scan done!

Device Name: , TX: 0, RSSI: -91, UUID: 47e9ee00-47e9-11e4-8939-164230d1df67
Device Name: SENSOR_PRO, TX: 0, RSSI: -58
Devices found: 2
Scan done!

Device Name: SENSOR_PRO, TX: 0, RSSI: -58
Device Name: , TX: 0, RSSI: -91, UUID: 47e9ee00-47e9-11e4-8939-164230d1df67
Devices found: 2
Scan done!

I edited the serial print format in the code to make it readable:

#include <BLEDevice.h>
#include <BLEUtils.h>
#include <BLEScan.h>
#include <BLEAdvertisedDevice.h>

int scanTime = 5; //In seconds
BLEScan* pBLEScan;


class MyAdvertisedDeviceCallbacks: public BLEAdvertisedDeviceCallbacks {
    void onResult(BLEAdvertisedDevice device) {
      Serial.printf("Device Name: %s, TX: %d, RSSI: %d", device.getName().c_str(), device.getTXPower(), device.getRSSI());
      if (device.haveServiceUUID()) Serial.printf(", UUID: %s", device.getServiceUUID().toString().c_str());
      Serial.println("");
    }
};


void setup() {
  Serial.begin(115200);
  Serial.println("Scanning...");

  BLEDevice::init("");
  pBLEScan = BLEDevice::getScan(); //create new scan
  pBLEScan->setAdvertisedDeviceCallbacks(new MyAdvertisedDeviceCallbacks());
  pBLEScan->setActiveScan(true); //active scan uses more power, but get results faster
  pBLEScan->setInterval(100);
  pBLEScan->setWindow(99);  // less or equal setInterval value
}

void loop() {
  // put your main code here, to run repeatedly:
  BLEScanResults foundDevices = pBLEScan->start(scanTime, false);
  Serial.print("Devices found: ");
  Serial.println(foundDevices.getCount());
  Serial.println("Scan done!\n");
  pBLEScan->clearResults();   // delete results fromBLEScan buffer to release memory
  delay(2000);
}
Nagymadar

Nagymadar commented on Jan 30, 2020

@Nagymadar
Author

Can I produce some debug info for you? (raw data print or something)

chegewara

chegewara commented on Jan 31, 2020

@chegewara
Contributor

You can print raw advertising data for each device in onResult() callback with:
getPayload() and getPayloadLength() and Serial functions.

This way we can investigate it. Remember to print hex values.

Nagymadar

Nagymadar commented on Jan 31, 2020

@Nagymadar
Author

I switched also on Warnings and printed heap size. Here it is:

[W][esp32-hal-psram.c:30] psramInit(): PSRAM init failed!
Scanning...
Device: Name: SENSOR_PRO, Address: e5:89:06:ef:6d:e8, serviceUUID: 6a800001-b5a3-f393-e0a9-e50e24dcca9e 
Payload [33] = { 0B 09 53 45 4E 53 4F 52 5F 50 52 4F 02 01 06 11 07 9E CA DC 24 0E E5 A9 E0 93 F3 A3 B5 01 00 80 6A }
[W][BLEScan.cpp:69] handleGAPEvent(): ESP_GAP_SEARCH_INQ_CMPL_EVT
Devices found: 1
Heap: 178128
Scan done!

Device: Name: SENSOR_PRO, Address: e5:89:06:ef:6d:e8 
Payload [15] = { 0B 09 53 45 4E 53 4F 52 5F 50 52 4F 02 01 06 }
[W][BLEScan.cpp:69] handleGAPEvent(): ESP_GAP_SEARCH_INQ_CMPL_EVT
Devices found: 1
Heap: 178168
Scan done!

Device: Name: SENSOR_PRO, Address: e5:89:06:ef:6d:e8 
Payload [15] = { 0B 09 53 45 4E 53 4F 52 5F 50 52 4F 02 01 06 }
[W][BLEScan.cpp:69] handleGAPEvent(): ESP_GAP_SEARCH_INQ_CMPL_EVT
Devices found: 1
Heap: 178168
Scan done!
Nagymadar

Nagymadar commented on Jan 31, 2020

@Nagymadar
Author

Don't ask me how, but one version of the code worked, but only once. Then I changed one character in the code (printf format), uploaded it and failed again. Change back to the working one, fail again.

Now I changed the hardware to a completely different board: NodeMcu ESP32. Same error. I switced on verbose level debug. Does this help you? See below first and second scans. I put *** what is printed from code. The first scan ends at *** Scan done!.

What is your ESP board settings? I updated every board and library. You?

[W][esp32-hal-psram.c:30] psramInit(): PSRAM init failed!
*** Restart finished. Scanning...
[V][BLEScan.cpp:195] start(): >> start(duration=5)
[D][FreeRTOS.cpp:189] take(): Semaphore taking: name: ScanEnd (0x3ffdcfc4), owner: <N/A> for start
[D][FreeRTOS.cpp:198] take(): Semaphore taken:  name: ScanEnd (0x3ffdcfc4), owner: start
[V][BLEScan.cpp:227] start(): << start()
[V][FreeRTOS.cpp:63] wait(): >> wait: Semaphore waiting: name: ScanEnd (0x3ffdcfc4), owner: start for start
[V][BLEUtils.cpp:1817] gapEventToString(): gapEventToString: Unknown event type 2 0x02
[V][BLEUtils.cpp:1049] dumpGapEvent(): Received a GAP event: Unknown event type
[V][BLEUtils.cpp:1264] dumpGapEvent(): *** dumpGapEvent: Logger not coded ***
[V][BLEUtils.cpp:1817] gapEventToString(): gapEventToString: Unknown event type 7 0x07
[V][BLEUtils.cpp:1049] dumpGapEvent(): Received a GAP event: Unknown event type
[V][BLEUtils.cpp:1264] dumpGapEvent(): *** dumpGapEvent: Logger not coded ***
[V][BLEUtils.cpp:1817] gapEventToString(): gapEventToString: Unknown event type 3 0x03
[V][BLEUtils.cpp:1049] dumpGapEvent(): Received a GAP event: Unknown event type
[V][BLEUtils.cpp:1264] dumpGapEvent(): *** dumpGapEvent: Logger not coded ***
[D][BLEAdvertisedDevice.cpp:418] setRSSI(): - setRSSI(): rssi: -49
[V][BLEUtils.cpp:746] advTypeToString():  adv data type: 0x9
[D][BLEAdvertisedDevice.cpp:247] parseAdvertisement(): Type: 0x09 (), length: 10, data: 53454e534f525f50524f
[D][BLEAdvertisedDevice.cpp:407] setName(): - setName(): name: SENSOR_PRO
[V][BLEUtils.cpp:746] advTypeToString():  adv data type: 0x1
[D][BLEAdvertisedDevice.cpp:247] parseAdvertisement(): Type: 0x01 (), length: 1, data: 06
[V][BLEUtils.cpp:746] advTypeToString():  adv data type: 0x7
[D][BLEAdvertisedDevice.cpp:247] parseAdvertisement(): Type: 0x07 (), length: 16, data: 9ecadc240ee5a9e093f3a3b50100806a
[D][BLEAdvertisedDevice.cpp:447] setServiceUUID(): - addServiceUUID(): serviceUUID: 6a800001-b5a3-f393-e0a9-e50e24dcca9e
***   Device: Name: SENSOR_PRO, Address: e5:89:06:ef:6d:e8, serviceUUID: 6a800001-b5a3-f393-e0a9-e50e24dcca9e 
***   Payload [33] = { 0B 09 53 45 4E 53 4F 52 5F 50 52 4F 02 01 06 11 07 9E CA DC 24 0E E5 A9 E0 93 F3 A3 B5 01 00 80 6A }
[V][BLEUtils.cpp:1817] gapEventToString(): gapEventToString: Unknown event type 3 0x03
[V][BLEUtils.cpp:1049] dumpGapEvent(): Received a GAP event: Unknown event type
[V][BLEUtils.cpp:1264] dumpGapEvent(): *** dumpGapEvent: Logger not coded ***
[D][BLEAdvertisedDevice.cpp:418] setRSSI(): - setRSSI(): rssi: -89
[V][BLEUtils.cpp:746] advTypeToString():  adv data type: 0x1
[D][BLEAdvertisedDevice.cpp:247] parseAdvertisement(): Type: 0x01 (), length: 1, data: 06
[V][BLEUtils.cpp:746] advTypeToString():  adv data type: 0x7
[D][BLEAdvertisedDevice.cpp:247] parseAdvertisement(): Type: 0x07 (), length: 16, data: 67dfd13042163989e411e94700eee947
[D][BLEAdvertisedDevice.cpp:447] setServiceUUID(): - addServiceUUID(): serviceUUID: 47e9ee00-47e9-11e4-8939-164230d1df67
[V][BLEUtils.cpp:746] advTypeToString():  adv data type: 0xff
[D][BLEAdvertisedDevice.cpp:247] parseAdvertisement(): Type: 0xff (), length: 8, data: 2d2a00000000b665
[D][BLEAdvertisedDevice.cpp:395] setManufacturerData(): - manufacturer data: 2d2a00000000b665
[V][BLEUtils.cpp:746] advTypeToString():  adv data type: 0x9
[D][BLEAdvertisedDevice.cpp:247] parseAdvertisement(): Type: 0x09 (), length: 10, data: 436f6d657420426c7565
[D][BLEAdvertisedDevice.cpp:407] setName(): - setName(): name: Comet Blue
***   Device: Name: Comet Blue, Address: 1a:06:f8:4e:e1:d6, manufacturer data: 2d2a00000000b665, serviceUUID: 47e9ee00-47e9-11e4-8939-164230d1df67 
***   Payload [43] = { 02 01 06 11 07 67 DF D1 30 42 16 39 89 E4 11 E9 47 00 EE E9 47 09 FF 2D 2A 00 00 00 00 B6 65 0B 09 43 6F 6D 65 74 20 42 6C 75 65 }
[V][BLEUtils.cpp:1817] gapEventToString(): gapEventToString: Unknown event type 3 0x03
[V][BLEUtils.cpp:1049] dumpGapEvent(): Received a GAP event: Unknown event type
[V][BLEUtils.cpp:1264] dumpGapEvent(): *** dumpGapEvent: Logger not coded ***
[D][BLEAdvertisedDevice.cpp:418] setRSSI(): - setRSSI(): rssi: -87
[V][BLEUtils.cpp:746] advTypeToString():  adv data type: 0x1
[D][BLEAdvertisedDevice.cpp:247] parseAdvertisement(): Type: 0x01 (), length: 1, data: 06
[V][BLEUtils.cpp:746] advTypeToString():  adv data type: 0x7
[D][BLEAdvertisedDevice.cpp:247] parseAdvertisement(): Type: 0x07 (), length: 16, data: 67dfd13042163989e411e94700eee947
[D][BLEAdvertisedDevice.cpp:447] setServiceUUID(): - addServiceUUID(): serviceUUID: 47e9ee00-47e9-11e4-8939-164230d1df67
[V][BLEUtils.cpp:746] advTypeToString():  adv data type: 0xff
[D][BLEAdvertisedDevice.cpp:247] parseAdvertisement(): Type: 0xff (), length: 8, data: 2c22000000004d9f
[D][BLEAdvertisedDevice.cpp:395] setManufacturerData(): - manufacturer data: 2c22000000004d9f
[V][BLEUtils.cpp:746] advTypeToString():  adv data type: 0x9
[D][BLEAdvertisedDevice.cpp:247] parseAdvertisement(): Type: 0x09 (), length: 10, data: 436f6d657420426c7565
[D][BLEAdvertisedDevice.cpp:407] setName(): - setName(): name: Comet Blue
***   Device: Name: Comet Blue, Address: 9c:8e:8e:60:7f:85, manufacturer data: 2c22000000004d9f, serviceUUID: 47e9ee00-47e9-11e4-8939-164230d1df67 
***   Payload [43] = { 02 01 06 11 07 67 DF D1 30 42 16 39 89 E4 11 E9 47 00 EE E9 47 09 FF 2C 22 00 00 00 00 4D 9F 0B 09 43 6F 6D 65 74 20 42 6C 75 65 }
[V][BLEUtils.cpp:1817] gapEventToString(): gapEventToString: Unknown event type 3 0x03
[V][BLEUtils.cpp:1049] dumpGapEvent(): Received a GAP event: Unknown event type
[V][BLEUtils.cpp:1264] dumpGapEvent(): *** dumpGapEvent: Logger not coded ***
[D][BLEScan.cpp:97] handleGAPEvent(): Ignoring 9c:8e:8e:60:7f:85, already seen it.
[V][BLEUtils.cpp:1817] gapEventToString(): gapEventToString: Unknown event type 3 0x03
[V][BLEUtils.cpp:1049] dumpGapEvent(): Received a GAP event: Unknown event type
[V][BLEUtils.cpp:1264] dumpGapEvent(): *** dumpGapEvent: Logger not coded ***
[D][BLEScan.cpp:97] handleGAPEvent(): Ignoring e5:89:06:ef:6d:e8, already seen it.
[V][BLEUtils.cpp:1817] gapEventToString(): gapEventToString: Unknown event type 3 0x03
[V][BLEUtils.cpp:1049] dumpGapEvent(): Received a GAP event: Unknown event type
[V][BLEUtils.cpp:1264] dumpGapEvent(): *** dumpGapEvent: Logger not coded ***
[D][BLEScan.cpp:97] handleGAPEvent(): Ignoring 9c:8e:8e:60:7f:85, already seen it.
[V][BLEUtils.cpp:1817] gapEventToString(): gapEventToString: Unknown event type 3 0x03
[V][BLEUtils.cpp:1049] dumpGapEvent(): Received a GAP event: Unknown event type
[V][BLEUtils.cpp:1264] dumpGapEvent(): *** dumpGapEvent: Logger not coded ***
[D][BLEScan.cpp:97] handleGAPEvent(): Ignoring e5:89:06:ef:6d:e8, already seen it.
[V][BLEUtils.cpp:1817] gapEventToString(): gapEventToString: Unknown event type 3 0x03
[V][BLEUtils.cpp:1049] dumpGapEvent(): Received a GAP event: Unknown event type
[V][BLEUtils.cpp:1264] dumpGapEvent(): *** dumpGapEvent: Logger not coded ***
[D][BLEScan.cpp:97] handleGAPEvent(): Ignoring 1a:06:f8:4e:e1:d6, already seen it.
[V][BLEUtils.cpp:1817] gapEventToString(): gapEventToString: Unknown event type 3 0x03
[V][BLEUtils.cpp:1049] dumpGapEvent(): Received a GAP event: Unknown event type
[V][BLEUtils.cpp:1264] dumpGapEvent(): *** dumpGapEvent: Logger not coded ***
[D][BLEScan.cpp:97] handleGAPEvent(): Ignoring 9c:8e:8e:60:7f:85, already seen it.
[V][BLEUtils.cpp:1817] gapEventToString(): gapEventToString: Unknown event type 3 0x03
[V][BLEUtils.cpp:1049] dumpGapEvent(): Received a GAP event: Unknown event type
[V][BLEUtils.cpp:1264] dumpGapEvent(): *** dumpGapEvent: Logger not coded ***
[W][BLEScan.cpp:69] handleGAPEvent(): ESP_GAP_SEARCH_INQ_CMPL_EVT
[V][FreeRTOS.cpp:143] give(): Semaphore giving: name: ScanEnd (0x3ffdcfc4), owner: start
[V][FreeRTOS.cpp:77] wait(): << wait: Semaphore released: name: ScanEnd (0x3ffdcfc4), owner: <N/A>
*** Devices found: 3
*** Heap: 177708
*** Scan done!

[V][BLEScan.cpp:195] start(): >> start(duration=5)
[D][FreeRTOS.cpp:189] take(): Semaphore taking: name: ScanEnd (0x3ffdcfc4), owner: <N/A> for start
[D][FreeRTOS.cpp:198] take(): Semaphore taken:  name: ScanEnd (0x3ffdcfc4), owner: start
[V][BLEScan.cpp:227] start(): << start()
[V][FreeRTOS.cpp:63] wait(): >> wait: Semaphore waiting: name: ScanEnd (0x3ffdcfc4), owner: start for start
[V][BLEUtils.cpp:1817] gapEventToString(): gapEventToString: Unknown event type 2 0x02
[V][BLEUtils.cpp:1049] dumpGapEvent(): Received a GAP event: Unknown event type
[V][BLEUtils.cpp:1264] dumpGapEvent(): *** dumpGapEvent: Logger not coded ***
[V][BLEUtils.cpp:1817] gapEventToString(): gapEventToString: Unknown event type 7 0x07
[V][BLEUtils.cpp:1049] dumpGapEvent(): Received a GAP event: Unknown event type
[V][BLEUtils.cpp:1264] dumpGapEvent(): *** dumpGapEvent: Logger not coded ***
[V][BLEUtils.cpp:1817] gapEventToString(): gapEventToString: Unknown event type 3 0x03
[V][BLEUtils.cpp:1049] dumpGapEvent(): Received a GAP event: Unknown event type
[V][BLEUtils.cpp:1264] dumpGapEvent(): *** dumpGapEvent: Logger not coded ***
[D][BLEAdvertisedDevice.cpp:418] setRSSI(): - setRSSI(): rssi: -78
[V][BLEUtils.cpp:746] advTypeToString():  adv data type: 0x1
[D][BLEAdvertisedDevice.cpp:247] parseAdvertisement(): Type: 0x01 (), length: 1, data: 06
[V][BLEUtils.cpp:746] advTypeToString():  adv data type: 0x7
[D][BLEAdvertisedDevice.cpp:247] parseAdvertisement(): Type: 0x07 (), length: 16, data: 67dfd13042163989e411e94700eee947
[D][BLEAdvertisedDevice.cpp:447] setServiceUUID(): - addServiceUUID(): serviceUUID: 47e9ee00-47e9-11e4-8939-164230d1df67
[V][BLEUtils.cpp:746] advTypeToString():  adv data type: 0xff
[D][BLEAdvertisedDevice.cpp:247] parseAdvertisement(): Type: 0xff (), length: 8, data: 2c22000000004d9f
[D][BLEAdvertisedDevice.cpp:395] setManufacturerData(): - manufacturer data: 2c22000000004d9f
***   Device: Name: , Address: 9c:8e:8e:60:7f:85, manufacturer data: 2c22000000004d9f, serviceUUID: 47e9ee00-47e9-11e4-8939-164230d1df67 
***   Payload [31] = { 02 01 06 11 07 67 DF D1 30 42 16 39 89 E4 11 E9 47 00 EE E9 47 09 FF 2C 22 00 00 00 00 4D 9F }
[V][BLEUtils.cpp:1817] gapEventToString(): gapEventToString: Unknown event type 3 0x03
[V][BLEUtils.cpp:1049] dumpGapEvent(): Received a GAP event: Unknown event type
[V][BLEUtils.cpp:1264] dumpGapEvent(): *** dumpGapEvent: Logger not coded ***
[D][BLEScan.cpp:97] handleGAPEvent(): Ignoring 9c:8e:8e:60:7f:85, already seen it.
[V][BLEUtils.cpp:1817] gapEventToString(): gapEventToString: Unknown event type 3 0x03
[V][BLEUtils.cpp:1049] dumpGapEvent(): Received a GAP event: Unknown event type
[V][BLEUtils.cpp:1264] dumpGapEvent(): *** dumpGapEvent: Logger not coded ***
[D][BLEAdvertisedDevice.cpp:418] setRSSI(): - setRSSI(): rssi: -53
[V][BLEUtils.cpp:746] advTypeToString():  adv data type: 0x9
[D][BLEAdvertisedDevice.cpp:247] parseAdvertisement(): Type: 0x09 (), length: 10, data: 53454e534f525f50524f
[D][BLEAdvertisedDevice.cpp:407] setName(): - setName(): name: SENSOR_PRO
[V][BLEUtils.cpp:746] advTypeToString():  adv data type: 0x1
[D][BLEAdvertisedDevice.cpp:247] parseAdvertisement(): Type: 0x01 (), length: 1, data: 06
***   Device: Name: SENSOR_PRO, Address: e5:89:06:ef:6d:e8 
***   Payload [15] = { 0B 09 53 45 4E 53 4F 52 5F 50 52 4F 02 01 06 }
[V][BLEUtils.cpp:1817] gapEventToString(): gapEventToString: Unknown event type 3 0x03
[V][BLEUtils.cpp:1049] dumpGapEvent(): Received a GAP event: Unknown event type
[V][BLEUtils.cpp:1264] dumpGapEvent(): *** dumpGapEvent: Logger not coded ***
[D][BLEScan.cpp:97] handleGAPEvent(): Ignoring e5:89:06:ef:6d:e8, already seen it.
[V][BLEUtils.cpp:1817] gapEventToString(): gapEventToString: Unknown event type 3 0x03
[V][BLEUtils.cpp:1049] dumpGapEvent(): Received a GAP event: Unknown event type
[V][BLEUtils.cpp:1264] dumpGapEvent(): *** dumpGapEvent: Logger not coded ***
[D][BLEAdvertisedDevice.cpp:418] setRSSI(): - setRSSI(): rssi: -87
[V][BLEUtils.cpp:746] advTypeToString():  adv data type: 0x1
[D][BLEAdvertisedDevice.cpp:247] parseAdvertisement(): Type: 0x01 (), length: 1, data: 06
[V][BLEUtils.cpp:746] advTypeToString():  adv data type: 0x7
[D][BLEAdvertisedDevice.cpp:247] parseAdvertisement(): Type: 0x07 (), length: 16, data: 67dfd13042163989e411e94700eee947
[D][BLEAdvertisedDevice.cpp:447] setServiceUUID(): - addServiceUUID(): serviceUUID: 47e9ee00-47e9-11e4-8939-164230d1df67
[V][BLEUtils.cpp:746] advTypeToString():  adv data type: 0xff
[D][BLEAdvertisedDevice.cpp:247] parseAdvertisement(): Type: 0xff (), length: 8, data: 2d2a00000000b665
[D][BLEAdvertisedDevice.cpp:395] setManufacturerData(): - manufacturer data: 2d2a00000000b665
***   Device: Name: , Address: 1a:06:f8:4e:e1:d6, manufacturer data: 2d2a00000000b665, serviceUUID: 47e9ee00-47e9-11e4-8939-164230d1df67 
***   Payload [31] = { 02 01 06 11 07 67 DF D1 30 42 16 39 89 E4 11 E9 47 00 EE E9 47 09 FF 2D 2A 00 00 00 00 B6 65 }
[V][BLEUtils.cpp:1817] gapEventToString(): gapEventToString: Unknown event type 3 0x03
[V][BLEUtils.cpp:1049] dumpGapEvent(): Received a GAP event: Unknown event type
[V][BLEUtils.cpp:1264] dumpGapEvent(): *** dumpGapEvent: Logger not coded ***
[D][BLEScan.cpp:97] handleGAPEvent(): Ignoring 1a:06:f8:4e:e1:d6, already seen it.
[V][BLEUtils.cpp:1817] gapEventToString(): gapEventToString: Unknown event type 3 0x03
[V][BLEUtils.cpp:1049] dumpGapEvent(): Received a GAP event: Unknown event type
[V][BLEUtils.cpp:1264] dumpGapEvent(): *** dumpGapEvent: Logger not coded ***
[D][BLEScan.cpp:97] handleGAPEvent(): Ignoring 9c:8e:8e:60:7f:85, already seen it.
[V][BLEUtils.cpp:1817] gapEventToString(): gapEventToString: Unknown event type 3 0x03
[V][BLEUtils.cpp:1049] dumpGapEvent(): Received a GAP event: Unknown event type
[V][BLEUtils.cpp:1264] dumpGapEvent(): *** dumpGapEvent: Logger not coded ***
[D][BLEScan.cpp:97] handleGAPEvent(): Ignoring 1a:06:f8:4e:e1:d6, already seen it.
[V][BLEUtils.cpp:1817] gapEventToString(): gapEventToString: Unknown event type 3 0x03
[V][BLEUtils.cpp:1049] dumpGapEvent(): Received a GAP event: Unknown event type
[V][BLEUtils.cpp:1264] dumpGapEvent(): *** dumpGapEvent: Logger not coded ***
[D][BLEScan.cpp:97] handleGAPEvent(): Ignoring 1a:06:f8:4e:e1:d6, already seen it.
[V][BLEUtils.cpp:1817] gapEventToString(): gapEventToString: Unknown event type 3 0x03
[V][BLEUtils.cpp:1049] dumpGapEvent(): Received a GAP event: Unknown event type
[V][BLEUtils.cpp:1264] dumpGapEvent(): *** dumpGapEvent: Logger not coded ***
[D][BLEScan.cpp:97] handleGAPEvent(): Ignoring 9c:8e:8e:60:7f:85, already seen it.
[V][BLEUtils.cpp:1817] gapEventToString(): gapEventToString: Unknown event type 3 0x03
[V][BLEUtils.cpp:1049] dumpGapEvent(): Received a GAP event: Unknown event type
[V][BLEUtils.cpp:1264] dumpGapEvent(): *** dumpGapEvent: Logger not coded ***
[D][BLEScan.cpp:97] handleGAPEvent(): Ignoring 9c:8e:8e:60:7f:85, already seen it.
[V][BLEUtils.cpp:1817] gapEventToString(): gapEventToString: Unknown event type 3 0x03
[V][BLEUtils.cpp:1049] dumpGapEvent(): Received a GAP event: Unknown event type
[V][BLEUtils.cpp:1264] dumpGapEvent(): *** dumpGapEvent: Logger not coded ***
[D][BLEScan.cpp:97] handleGAPEvent(): Ignoring 9c:8e:8e:60:7f:85, already seen it.
[V][BLEUtils.cpp:1817] gapEventToString(): gapEventToString: Unknown event type 3 0x03
[V][BLEUtils.cpp:1049] dumpGapEvent(): Received a GAP event: Unknown event type
[V][BLEUtils.cpp:1264] dumpGapEvent(): *** dumpGapEvent: Logger not coded ***
[D][BLEScan.cpp:97] handleGAPEvent(): Ignoring 9c:8e:8e:60:7f:85, already seen it.
[V][BLEUtils.cpp:1817] gapEventToString(): gapEventToString: Unknown event type 3 0x03
[V][BLEUtils.cpp:1049] dumpGapEvent(): Received a GAP event: Unknown event type
[V][BLEUtils.cpp:1264] dumpGapEvent(): *** dumpGapEvent: Logger not coded ***
[W][BLEScan.cpp:69] handleGAPEvent(): ESP_GAP_SEARCH_INQ_CMPL_EVT
[V][FreeRTOS.cpp:143] give(): Semaphore giving: name: ScanEnd (0x3ffdcfc4), owner: start
[V][FreeRTOS.cpp:77] wait(): << wait: Semaphore released: name: ScanEnd (0x3ffdcfc4), owner: <N/A>
*** Devices found: 3
*** Heap: 177736
*** Scan done!
chegewara

chegewara commented on Feb 1, 2020

@chegewara
Contributor

Can you try this before scan start, with value true:
https://github.com/espressif/arduino-esp32/blob/master/libraries/BLE/src/BLEScan.h#L51

Payload [33] means it does not fit advertising packet, so the other part has to be in scan response, which is scan only with active scanning (that should be enabled, and does not require any action, but worth to try, maybe esp-idf bug or settings in menuconfig).

Nagymadar

Nagymadar commented on Feb 2, 2020

@Nagymadar
Author

I have tried. No change. :-( Any other what I can try?

chegewara

chegewara commented on Feb 2, 2020

@chegewara
Contributor

Only thing i can say is that i never found similar issue and it is very strange.
It is obviously ignoring scan response packet which is received only during active scan.
Could you try with other esp32?

Nagymadar

Nagymadar commented on Feb 2, 2020

@Nagymadar
Author

I am using 2 boards:

  1. Waveshare e-paper ESP32
  2. NodeMCU ESP32S

I am getting close... I used to use Arduino's ESP32 Wrover Module board settings in tools menu. Changing to ESP32 Dev Module solved the problem on board 1, but not on board 2. Confusing... Any idea?

I've got this warning for both of them:

Multiple libraries were found for "BLEDevice.h"
 Used: C:\Users\detre\AppData\Local\Arduino15\packages\esp32\hardware\esp32\1.0.4\libraries\BLE
Using library BLE at version 1.0.1 in folder: C:\Users\detre\AppData\Local\Arduino15\packages\esp32\hardware\esp32\1.0.4\libraries\BLE 

But I do not find any other BLEDevice.h anywhere. Can be a problem?

Nagymadar

Nagymadar commented on Feb 2, 2020

@Nagymadar
Author

I scanned my whole c drive. No other BLEDevice.h.

chegewara

chegewara commented on Feb 3, 2020

@chegewara
Contributor

If i remember this board is using XTAL 26MHz:
NodeMCU ESP32S
Try to pick NodeMCU from boards.

Nagymadar

Nagymadar commented on Feb 3, 2020

@Nagymadar
Author

I've tried NodeMCU-32S board. No change. But I've looked it up: Clock Speed: 240 Mhz.

Interestingly when I changed back to ESP Dev board, it worked. Then put in 2 Serial.println("Done") lines just to change the code, and fails again! I removed them, works. Changed back and forth, now it does not work anyome. I am really confused. Once one compilation works, even after reset and 20+ scans. But some compilation just does not work. I 've checked the Arduino comp messages. The BLE library compilation sequence is a bit different. That is all. Any idea?

chegewara

chegewara commented on Feb 3, 2020

@chegewara
Contributor

I dont have explanation for that. What you can do is to see if you are not short on heap, or experiment with different boards selected in arduino.
Thats good you found it somehow related to hardware and board selected, but heap/stack shortage is last thing i can think of.

17 remaining items

Loading
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment

Metadata

Metadata

Assignees

No one assigned

    Labels

    Status: StaleIssue is stale stage (outdated/stuck)

    Type

    No type

    Projects

    No projects

    Milestone

    No milestone

    Relationships

    None yet

      Development

      No branches or pull requests

        Participants

        @chegewara@PatrikOO@Nagymadar@unisim1983@luisgodelmo

        Issue actions

          BLEScan first scan ok, next no name, no service UUID · Issue #3677 · espressif/arduino-esp32