• Skip to main content
  • Skip to primary sidebar

RNTLab.com

The Ultimate Shortcut to Learn Electronics and Programming with Open Source Hardware and Software

  • Courses
  • Forum
    • Forum
    • Ask Question
  • Shop
  • Account
  • Blog
  • Login

Strange behavior with BLE Scan — long advertised device list then foundDevices.getCount() returns zero!

Q&A Forum › Category: ESP32 › Strange behavior with BLE Scan — long advertised device list then foundDevices.getCount() returns zero!
0 Vote Up Vote Down
Michael Conant asked 4 years ago

I’m going through the ESP32  tutorial Unit 2 on BLE…and scratching my head on very strange results…when I run the BLE Scan example, I get a loooong list of Advertised Devices that continue to repeat — showing “MyESP32” and apparently 6 other devices — posting 1500 lines!  And the list finally ends with “Devices found: 0”.  Please help.

EDIT: using a DOIT ESP32 Devkit V1 — and have had no problems with the tutorials until this point.

Here’s a copy of the last several dozen lines from the serial output :
12:15:22.207 -> Advertised Device: Name: , Address: 41:b6:11:b0:78:95, manufacturer data: 0600010920025ec42c36e2e87c011f2a2354c2d3124925b5d150a0726e
12:15:22.207 -> Advertised Device: Name: MyESP32, Address: 7c:9e:bd:f4:55:42, txPower: 3
12:15:22.207 -> Advertised Device: Name: , Address: 50:de:06:71:13:12, manufacturer data: 4c001005061440ad5e, txPower: 12
12:15:22.253 -> Advertised Device: Name: MyESP32, Address: 7c:9e:bd:f4:55:42, txPower: 3
12:15:22.253 -> Advertised Device: Name: , Address: 3d:a0:df:6d:83:95, manufacturer data: 4c00090603110a010ba4
12:15:22.253 -> Advertised Device: Name: , Address: 41:b6:11:b0:78:95, manufacturer data: 0600010920025ec42c36e2e87c011f2a2354c2d3124925b5d150a0726e
12:15:22.300 -> Advertised Device: Name: MyESP32, Address: 7c:9e:bd:f4:55:42, txPower: 3
12:15:22.300 -> Advertised Device: Name: , Address: 5f:c4:a9:e8:52:a6, manufacturer data: 4c000100000000000000000000000000100000, txPower: 7
12:15:22.300 -> Advertised Device: Name: , Address: 1b:4b:a6:ed:dc:c4, serviceUUID: 0000fd6f-0000-1000-8000-00805f9b34fb
12:15:22.347 -> Advertised Device: Name: , Address: 7a:7c:34:54:67:b8, manufacturer data: 8e0531574d4848383432534331313135, serviceUUID: 0000feb8-0000-1000-8000-00805f9b34fb
12:15:22.347 -> Advertised Device: Name: MyESP32, Address: 7c:9e:bd:f4:55:42, txPower: 3
12:15:22.394 -> Advertised Device: Name: , Address: 41:b6:11:b0:78:95, manufacturer data: 0600010920025ec42c36e2e87c011f2a2354c2d3124925b5d150a0726e
12:15:22.394 -> Advertised Device: Name: MyESP32, Address: 7c:9e:bd:f4:55:42, txPower: 3
12:15:22.394 -> Advertised Device: Name: , Address: 50:de:06:71:13:12, manufacturer data: 4c001005061440ad5e, txPower: 12
12:15:22.439 -> Advertised Device: Name: MyESP32, Address: 7c:9e:bd:f4:55:42, txPower: 3
12:15:22.486 -> Advertised Device: Name: , Address: 3d:a0:df:6d:83:95, manufacturer data: 4c00090603110a010ba4
12:15:22.486 -> Advertised Device: Name: MyESP32, Address: 7c:9e:bd:f4:55:42, txPower: 3
12:15:22.486 -> Advertised Device: Name: , Address: 41:b6:11:b0:78:95, manufacturer data: 0600010920025ec42c36e2e87c011f2a2354c2d3124925b5d150a0726e
12:15:22.486 -> Advertised Device: Name: , Address: 34:c0:59:2f:da:c4, manufacturer data: 4c00090602b00a010bba
12:15:22.486 -> Advertised Device: Name: , Address: 5f:c4:a9:e8:52:a6, manufacturer data: 4c000100000000000000000000000000100000, txPower: 7
12:15:22.486 -> Advertised Device: Name: MyESP32, Address: 7c:9e:bd:f4:55:42, txPower: 3
12:15:22.531 -> Advertised Device: Name: MyESP32, Address: 7c:9e:bd:f4:55:42, txPower: 3
12:15:22.576 -> Advertised Device: Name: , Address: 50:de:06:71:13:12, manufacturer data: 4c001005061440ad5e, txPower: 12
12:15:22.576 -> Advertised Device: Name: , Address: 41:b6:11:b0:78:95, manufacturer data: 0600010920025ec42c36e2e87c011f2a2354c2d3124925b5d150a0726e
12:15:22.620 -> Advertised Device: Name: , Address: 1b:4b:a6:ed:dc:c4, serviceUUID: 0000fd6f-0000-1000-8000-00805f9b34fb
12:15:22.620 -> Advertised Device: Name: MyESP32, Address: 7c:9e:bd:f4:55:42, txPower: 3
12:15:22.620 -> Advertised Device: Name: , Address: 3d:a0:df:6d:83:95, manufacturer data: 4c00090603110a010ba4
12:15:22.620 -> Advertised Device: Name: MyESP32, Address: 7c:9e:bd:f4:55:42, txPower: 3
12:15:22.667 -> Advertised Device: Name: , Address: 34:c0:59:2f:da:c4, manufacturer data: 4c00090602b00a010bba
12:15:22.667 -> Advertised Device: Name: , Address: 5f:c4:a9:e8:52:a6, manufacturer data: 4c000100000000000000000000000000100000, txPower: 7
12:15:22.667 -> Advertised Device: Name: , Address: 41:b6:11:b0:78:95, manufacturer data: 0600010920025ec42c36e2e87c011f2a2354c2d3124925b5d150a0726e
12:15:22.714 -> Advertised Device: Name: MyESP32, Address: 7c:9e:bd:f4:55:42, txPower: 3
12:15:22.761 -> Advertised Device: Name: MyESP32, Address: 7c:9e:bd:f4:55:42, txPower: 3
12:15:22.761 -> Advertised Device: Name: , Address: 50:de:06:71:13:12, manufacturer data: 4c001005061440ad5e, txPower: 12
12:15:22.808 -> Advertised Device: Name: MyESP32, Address: 7c:9e:bd:f4:55:42, txPower: 3
12:15:22.808 -> Advertised Device: Name: , Address: 3d:a0:df:6d:83:95, manufacturer data: 4c00090603110a010ba4
12:15:22.855 -> Advertised Device: Name: MyESP32, Address: 7c:9e:bd:f4:55:42, txPower: 3
12:15:22.855 -> Advertised Device: Name: , Address: 5f:c4:a9:e8:52:a6, manufacturer data: 4c000100000000000000000000000000100000, txPower: 7
12:15:22.855 -> Advertised Device: Name: , Address: 1b:4b:a6:ed:dc:c4, serviceUUID: 0000fd6f-0000-1000-8000-00805f9b34fb
12:15:22.902 -> Advertised Device: Name: MyESP32, Address: 7c:9e:bd:f4:55:42, txPower: 3
12:15:22.902 -> Advertised Device: Name: , Address: 41:b6:11:b0:78:95, manufacturer data: 0600010920025ec42c36e2e87c011f2a2354c2d3124925b5d150a0726e
12:15:22.902 -> Devices found: 0
12:15:22.902 -> Scan done!

4 Answers
0 Vote Up Vote Down
Sara Santos Staff answered 4 years ago

Hi Michael.
That’s not a common behavior.
Do you have your ESP32 Boards installation up to date? In your Arduino IDE, go to Tools> Boards > Boards Manager and search for ESP32. Check the version that you have installed. If there is a more recent version, install it.
If this doesn’t solve the issue, I’ll try the project myself to check if there is something wrong.
Regards,
Sara

0 Vote Up Vote Down
Michael Conant answered 4 years ago

Hi Sara,
I checked the software installation; the esp32 version is 1.0.6, the latest.  I’ve also played around with using the code from the example sketches for the board vs. using the code from the tutorial (which are a bit different) but that did not change this odd behavior.  One other note…the boards are DOIT ESP32 DEVKIT V1 clones from  DORHEA, though they appear physically, electrically and logically identical, and my other sketches seem to work.  Thanks for looking into this!
Mike

0 Vote Up Vote Down
Michael Conant answered 4 years ago

Update — I found that after installing the “ESP BLE Arduino” library by Neil Kolban v.1.0.1 made the sketch WORK.  I’m not sure all the factors going on here, but the comments under the library item’s more info link states that the latest release of the library is 0.4.7, that the repository is kept for archive, and that the BLE code is now included in Arduino directly.  Very confusing!  The lesson doesn’t mention this. I’m new to the whole github world so not sure what this is all about. Perhaps we have some incompatibilities between versions.  Anyway, I just started playing with visual studio (using your web server tutorials!) as a way of managing my projects and that’s how I found about the root cause and my workaround. I really appreciate the ability to establish dependencies on library code within that tool, vs. the Arduino IDE

0 Vote Up Vote Down
Sara Santos Staff answered 4 years ago

Hi Michael.
 
The first code in that unit is different from the code in the Arduino IDE examples folder. However, it still works as expected. 
 
I tested the second code, and it has the same behavior as you mentioned. At the time we wrote that chapter, this was not supposed to happen. So, I guess that some update has changed things.
 
I really don’t understand what’s going on with that library. It should have worked without installing the library.
I’m glad you found a solution. Thanks for sharing it. We’ll need to update that whole chapter soon.
 
VS Code is handy when it comes to handling libraries. I also like it.
 
Regards,
Sara  
 

Primary Sidebar

Login to Ask or Answer Questions

This Forum is private and it’s only available for members enrolled in our Courses.

Login »

Latest Course Updates

  • [eBook Updated] Learn Raspberry Pi Pico/Pico W with MicroPython eBook – Version 1.2 May 26, 2025
  • [New Edition] Build ESP32-CAM Projects eBook – 2nd Edition April 16, 2025

You must be logged in to view this content.

Contact Support - Refunds - Privacy - Terms - MakerAdvisor.com - Member Login

Copyright © 2013-2025 · RandomNerdTutorials.com · All Rights Reserved

Insert/edit link

Enter the destination URL

Or link to existing content

    No search term specified. Showing recent items. Search or use up and down arrow keys to select an item.