book collections email follower instructable user
Picture of Nano ESP32 BLE Scanner

This instructables show how to use ESP32 to make wireless BLE signal scanner, all scanned data will send to the HTTP server via WiFi.

Step 1: Why BLE Scanner?

Picture of Why BLE Scanner?

BLE (Bluetooth Low Energy) signal is very common for current digital device, mobile phone, wrist band, iBeacon, assets tag. This signal not only help you pair up the devices, it also can report the device status, such as battery level, heart rate, motion (walking, running, falling), temperature, panic button, anti-loss ... etc.

It is a valuable big data for location tracking if we can collect the BLE signal at certain number of position.

In long run, the BLE scanner should fix in selected position. However, selecting a right place require trial and error. A tiny wireless BLE scanner is handy to help you check where is the right place.

Hi, can you explain how to use your node.js files?
How many BLE devices it will discover in each scan
Gouster44 months ago
It would be cool to make it server-less. I mean webserver hosted on ESP32 with static ip.
once site would be opened by any device, u can see list of found devices with signal strenght and so..

What do u think?
陳亮 (author)  Gouster44 months ago
I think IoT in most case require some sort of server. Imagine you have ten of them in an area, it is time consuming to access the data one by one.
JonathanB3698 months ago
I get this error when flashing from Arduino after following your instructions, any ideas?

ets Jun 8 2016 00:22:57
rst:0xc (SW_CPU_RESET),boot:0x13 (SPI_FAST_FLASH_BOOT)
configsip: 0, SPIWP:0xee
mode:DIO, clock div:1
entry 0x40080310
Guru Meditation Error: Core 1 panic'ed (LoadProhibited). Exception was unhandle d.
Core 1 register dump:
PC : 0x40198e3a PS : 0x00060030 A0 : 0x800d1849 A1 : 0x3f fdad70
A2 : 0x00000000 A3 : 0x3ffd8f80 A4 : 0x3ffc98cc A5 : 0x80 000020
A6 : 0x00000000 A7 : 0x3ffd59cc A8 : 0x00000005 A9 : 0x00 000020
A10 : 0x00000010 A11 : 0x00000000 A12 : 0x80092c4c A13 : 0x3f fd5880
A14 : 0x00000003 A15 : 0x00060023 SAR : 0x00000000 EXCCAUSE: 0x00 00001c
EXCVADDR: 0x00000150 LBEG : 0x00000000 LEND : 0x00000000 LCOUNT : 0x00 000000
Backtrace: 0x40198e3a:0x3ffdad70 0x400d1846:0x3ffdadb0 0x401cd24a:0x3ffdaee0
Me too
mohandhanush2510 months ago
i also did the same you did,i am using esp wroom32 form lolin32 development board.
i connected sd card reader with that board and i programming using arduino.
my project is it scans the nearby ble devices and store the datas with time form the server(NTP) and store those values in txt file in sd card and after some time the txt file is send to the server..i completed in development board.
now how to repeat the same in custom pcb??.
can you please help me
Please post your code! I am looking to do something similar by logging bt scans to csv on sd card.
陳亮 (author)  mohandhanush2510 months ago
Hi mohandhanush25, did you encounter any problems while following my steps?
i dont understand y you used, dev dock circuits
can you please tell me how to program wroom32 module with arduino using usb to ttl connector
陳亮 (author)  mohandhanush2510 months ago
Simply follow the dev dock circuit can program ESP32.
ok after this setup,will the separate wroom32 module works like a development board, can i connect sd card read with miso,mosi pins of wroom32,will it work??
陳亮 (author)  mohandhanush2510 months ago
I never tried connect SD card myself, but I have tried M5Stack, ESP32 should work with SD well.
after this setup, can i connect sd card module directly with wroom32 pins of miso,mosi. will it work the same way which worked in development board??
陳亮 (author)  mohandhanush2510 months ago
for power saving, you may find more info in my previous instructables:
ok without dev dock. can i program wroom32 module with arduino??
陳亮 (author)  mohandhanush2510 months ago
dev dock only a simple circuit connect DTR and RTS to GPIO 0 and reset pins. If you insist don’t like connect this circuit, simply pull down GPIO 0 manually and then reset ESP32 to enter program model before you press upload in Arduino IDE.
fguiet9 months ago
Thank you for sharing this project.
I have sole BLE beacon sending temperature and humidity value in the services can I get those values with your Arduino program? At the moment you only get rssi, manufacturer data and address.
Thank you,
mohandhanush2510 months ago
when i upload this code,it shows sketch is too big,how to solve it
陳亮 (author)  mohandhanush2510 months ago
Sticky follow step 11 details.
kaefert1 year ago

Thank you very much for this! It works fine at first, but after a few hours it stops posting data, and only prints this repeated on the serial console until I power cycle:

Task watchdog got triggered. The following tasks did not reset the watchdog in time:
- IDLE (CPU 0)
Tasks currently running:
CPU 0: wifi

陳亮 (author)  kaefert1 year ago

I guess it stucked at connecting WiFi...

billp1191 year ago

I am having issues with the Arduino sketch being too big. I am using Arduino IDE V1.8.5 on windows 10. Here is the error message I receive. Can you help?

"Sketch uses 1357670 bytes (103%) of program storage space. Maximum is 1310720 bytes.
Global variables use 72828 bytes (24%) of dynamic memory, leaving 222084 bytes for local variables. Maximum is 294912 bytes.
Sketch too big; see for tips on reducing it.
Error compiling for board ESP32 Dev Module."

okay, I didn't follow step 10. Once I did I did receive a different error...."Error at line 7: CSV flag column contains unknown flag
'</p>'". Once I removed the </p> from the same line it all worked fine. I am working on the HTTP server connections next so please disregard my earlier comment- you did a great job here!!

陳亮 (author)  billp1191 year ago
Hi billp119,
Yes step 10 is very important, thats why I need clone the main branch and amend it.
kaefert 陳亮1 year ago

sadly with the current library versions it doesn't fit even with those modifications. see

陳亮 (author)  kaefert1 year ago
If you are using latest library, it have a “no ota” option, it can fit 2 MB firmware in it.
kaefert 陳亮1 year ago

thanks for the reply. can you tell me how to set that option in arduino IDE or in some textfile in ~/Arduino/hardware/espressif/esp32/* or how else?

陳亮 (author)  kaefert1 year ago

Updated step 10 and 11, please take a look

kaefert 陳亮1 year ago

Thanks! That worked! However, I observe 2 strange things now:

1.) The serial output cuts off 36 chars before the end of the http reply (tried modifying it and always the last 36 characters are not printed to serial) - afterwards there's nothing printed, also not the "Enter deep sleep .." message.

2.) My Post Data PHP-Script doesn't receive any parameters, If I call it with `curl --data "param1=value1&m2=value2"` it works, but from the ESP32 it doesn't get any data. (even though I can see it printing some Payload on the serial console)

UPDATE: add 1.) problem vanishes when I disable the sleep by setting it to 0. So I guess the serial printline is forked and does not blocks the processing and the sleep then kills the forked serial write process. But maybe you can help me explain problem 2.)

UPDATE2: okey, made it work for me. See

陳亮 (author) 1 year ago

Hi FabriceV1, I have revised the calculation. The theoretic live time should around 23 hours and the actual measured time is near 20 hours.

raphan1 year ago

I can't even imagine how to work without a shematic, have you got one ? Thx

raphan raphan1 year ago

I meant "schematic" !

FabriceV11 year ago

Hi Sir!
Excellent and very detailled build, but I'm affraid your battery autonomy calculus is wrong.
And in terms of power management, it could be much upgraded!
You use a linear voltage regulator, these components are made to theoriticaly only be abble to lower the voltage, and come with no safety, so it will drain the battery until the integrated safety of the cell cuts out (around 3V this type). It means very deep discharge each time, not good for it.
The available energy is not to be computed with the average 3.7V!! The true capacity is depending on the discharge curve, but can be roughly estimated by the capacity (mAh) over the difference between full voltage and empty voltage (4.2-3V = 1.2V this type), not 3.7!
Also, just putting your calculus in a calculator doesn't match the 11h.
Very clean on other aspects, I like your programmer and charger.