• Stars
    star
    256
  • Rank 159,219 (Top 4 %)
  • Language
    C
  • License
    MIT License
  • Created about 6 years ago
  • Updated over 1 year ago

Reviews

There are no reviews yet. Be the first to send feedback to the community and the maintainers!

Repository Details

ᛡᛒ BLE Scanner + Data persistence on SD Card for M5Stack, M5Core2, Odroid-Go, ESP32-Wrover-Kit and other models

ESP32-BLECollector

Join the chat at https://gitter.im/ESP32-BLECollector/ESP32-BLECollector Build Status

A BLE Scanner with persistence.

ESP32 BLECollector running on Wrover-Kit ESP32 BLECollector running on M5Stack

🎬 Demo video

BLECollector is just a passive BLE scanner with a fancy UI. All BLE data found by the BLE Scanner is collected into a sqlite3 format on the SD Card.

Public Mac addresses are compared against OUI list, while Vendor names are compared against BLE Device list.

Those two database files are provided in a db format (mac-oui-light.db and ble-oui.db).

On first run, a default blemacs.db file is created, this is where BLE data will be stored. When a BLE device is found by the scanner, it is populated with the matching oui/vendor name (if any) and eventually inserted in the blemasc.db file.

⚠️ This sketch is big! Use the "No OTA (Large Apps)" or "Minimal SPIFFS (Large APPS with OTA)" partition scheme to compile it. The memory cost of using sqlite and BLE libraries is quite high.

⚠️ Builds using ESP32-Wrover can eventually choose the 3.6MB SPIFFS partition scheme, and have the BLECollector working without the SD Card. Experimental support only since SPIFFS tends to get slower and buggy when the partition becomes full.

Hardware requirements

  • [mandatory] ESP32-Wroom or ESP32-Wrover (Wrover is recommended)
  • [mandatory] SD Card (breakout or bundled in Wrover-Kit, M5Stack, Odroid-Go, LoLinD32 Pro)
  • [mandatory] Micro SD (FAT32 formatted, max 4GB)
  • [mandatory] mac-oui-light.db and ble-oui.db files copied on the Micro SD Card root
  • [mandatory] ST7789/ILI9341 320x240 TFT (or bundled in Wrover-Kit, M5Stack, Odroid-Go, LoLinD32 Pro, D-Duino32-XS)
  • [optional] (but recommended) I2C RTC Module (see #define HAS_EXTERNAL_RTC in Settings.h)
  • [optional] Serial GPS Module (see #define HAS_GPS in Settings.h)
  • [ NEW][optional] XPad Buttons Shield from Radomir Dopieralski

Software requirements (updated)

Behaviours (auto-selected except for WiFi):

  • Hobo: when no TinyRTC module exists in your build, only uptime will be displayed
  • Rogue: TinyRTC module adjusted after flashing (build DateTime), shares time over BLE
  • Chronomaniac: TinyRTC module adjusts itself via GPS, shares time over BLE
  • With WiFi: Temporary dual BLE/WiFi mode to allow downloading or serving .db files, see #define WITH_WIFI in Settings.h

Optional I2C RTC Module requirements

  • Wire your TinyRTC to RTC_SDA/RTC_SCL (see Settings.h or Display.h to override)
  • Insert the SD Card
  • Set #define HAS_EXTERNAL_RTC true in Settings.h
  • Flash the ESP with partition scheme Minimal SPIFFS (Large APPS with OTA)

Optional Serial GPS Module requirements

  • Wire your GPS module to TX1/RX1 (edit GPS_RX and GPS_TX in GPS.h
  • Set #define HAS_GPS true in Settings.h
  • Flash the ESP with partition scheme Minimal SPIFFS (Large APPS with OTA)
  • Wait for the GPS to find a fix
  • issue the command gpstime in the serial console

Optional XPad Buttons Shield requirements

  • Wire your XPad Buttons Shield to XPAD_SDA/XPAD_SCL (see HID_XPad.h to override)
  • Enable the module in Display.h : #define hasXPaxShield() (bool) true
  • Controls are:
    • Down / Up : brightness
    • Right / Left : unassigned (yet)
    • A : start/stop scan
    • B / C : toggle mac filter
    • D : unassigned (yet)

Time Sharing

  • Once the time is set using RTC, GPS or NTP, the BLECollector may start the TimeSharing service and advertise a DateTime characteristic for other BLECollectors to sync with.
  • Builds with no RTC/GPS will try to identify this service during their scan duty cycle and subscribe for notifications.

File Downloading (still experimental)

Sending the DownloadDB command will:

  • Stop BLE
  • Start WiFi
  • Synchronize time to a nearby NTP server
  • Download the latest oui/vendors database from github

Serial command interface

Available Commands:

01)             help : Print this list
02)             halp : Same as help except it doesn't print anything
03)            start : Start/resume scan
04)             stop : Stop scan
05)     toggleFilter : Toggle vendor filter on the TFT (persistent)
06)       toggleEcho : Toggle BLECards in the Serial Console (persistent)
07)      setTimeZone : Set the timezone for next NTP Sync (persistent)
08)    setSummerTime : Toggle CEST / CET for next NTP Sync (persistent)
09)             dump : Dump returning BLE devices to the display and updates DB
10)    setBrightness : Set brightness to [value] (0-255) (persistent)
11)               ls : Show [dir] Content on the SD
12)               rm : Delete [file] from the SD
13)          restart : Restart BLECollector ('restart now' to skip replication)
14)       screenshot : Make a screenshot and save it on the SD
15)       screenshow : Show screenshot
16)           toggle : toggle a bool value
17)          resetDB : Hard Reset DB + forced restart
18)          pruneDB : Soft Reset DB without restarting (hopefully)
19)         bleclock : Broadcast time to another BLE Device (implicit)
20)          bletime : Get time from another BLE Device (explicit)
21)          gpstime : Sync time from GPS
22)           latlng : Print the GPS lat/lng
23)          stopBLE : Stop BLE (use 'restart' command to re-enable)
24)        startWiFi : Start WiFi (will stop BLE)
25)      setPoolZone : Set NTP Pool Zone for next NTP Sync (persistent)
26)          NTPSync : Update time from NTP (will start WiFi)
27)       DownloadDB : Download or update db files (will start WiFi and update NTP first)
28)      setWiFiSSID : Set WiFi SSID
29)      setWiFiPASS : Set WiFi Password

Contributions are welcome :-)

Known issues / Roadmap

Implementing both LovyanGFX and Nimble-Arduino was such a huge optimization that none of the previous blockers exist any more!

Some ideas I'll try to implement in the upcoming changes:

  • Add GPS Coords to entries for better pruning as suggested by /u/playaspect
  • Better Analysis of ServiceData (see @reelyactive's advlib)
  • Extended logging (SDCard-less meshed builds)

Other ESP32 security related tools:

Credits/requirements:

More Repositories

1

M5Stack-SD-Updater

💾 Customizable menu system for M5Stack, M5Unified and ESP32-Chimera-Core - loads apps from the Micro SD card. Easily add you own apps
C++
310
star
2

ESP32-USB-Soft-Host

An Arduino wrapper to @sdima1357's usb_soft_host esp-idf example
C
249
star
3

ESP32-Chimera-Core

ESP32-Chimera-Core 👾 is an arduino library for M5Stack, Odroid-Go, D-Duino-32-XS and other ESP32/TFT/SD bundles
C++
153
star
4

ESP32-targz

🗜️ An Arduino library to unpack/uncompress tar, gz, and tar.gz files on ESP32 and ESP8266
C++
119
star
5

WUD-Ducky

An ESP32-S2 RubberDucky script parser, with Mouse/PenDrive support 🦆
C
94
star
6

ESP32-BLEBeaconSpam

BLE Beacon spam on ESP32
C++
50
star
7

ESP32-PsRamFS

🐏 💾 RamDisk for ESP32-Arduino using PsRam and fs::FS
C
46
star
8

Rotatey_Cube

🧊 3D gyrocsopic rotating cube on Arduino using an MPU650 and SSD1306 OLED
C++
40
star
9

ESP32-3DPrinter-Bridge

A network <=> ESP32 <=> USB (FTDI) <=> 3D printer Bridge
C++
38
star
10

YAMLDuino

YAML <=> JSON converter for ESP32, ESP8266, RP2040 and possibly other devices
C
34
star
11

M5Tube

Video player for M5Stack with Docker conversion support
C++
30
star
12

ESP8266-Hobo-Clock

Self adjustable ESP8266 clock without RTC and NTP
Arduino
24
star
13

esp32-DCF77_Analyzer_Clock

⏰ An ESP32 TFT interpretation of the @deruiter's DCF77-Analyzer-Clock-V2.0
C
23
star
14

ESP8266SDUpdater

💾 ESP8266 Prequel to M5Stack-SD-Updater
C++
23
star
15

esp8266_deauther_serial

Serial version of spacehuhn/esp8266_deauther
C
22
star
16

WiFiChanViz

WiFi scanner with visual persistence, intended to find the idlest channel e.g. to assign to a ZigBee device
C
20
star
17

ESP32-ENC28J60

ENC28J60 Ethernet driver for ESP32-Arduino 2.0.5, lwip compliant
C
19
star
18

ESP32-Raytracer

An ESP32 study based on Dmitry V. Sokolov's tinyraytracer https://github.com/ssloy/tinyraytracer
C
19
star
19

Rotatey_Balls

🧊 3D animated gyro balls with ESP32, SSD1306 and MPU6050
Arduino
17
star
20

M5Stack-ESP12-Shield

ESP12 shield for M5Stack - Flash your ESP through the M5!
C
16
star
21

ImgurUploader

🖼️ imgur.com 📤 image/video uploader library for ESP32
C++
14
star
22

signal-logr

Wifi Location signal logger written in NodeJS for Raspberry Pi now with RTL-SDR support
JavaScript
14
star
23

ESP32-GifPlayer

GIF player Demo for M5Stack, Odroid-GO, ESP32-Wrover-Kit, LoLinD32-Pro, D-Duino32-XS, and more...
C++
13
star
24

ESP32-SIDView

SidWiz viewer for ESP32 [WORK IN PROGRESS]
C++
13
star
25

M5Rotatey_Cube

🧊 Modified M5Stack/MPU9250 gyro/accel demo sketch
C++
11
star
26

ESP32-Hector

M5Stack sprite+ULP-sound demo
C
10
star
27

ESP32-AmigaBoingBall

An interpretation of the famous Amiga Boing Ball Demo on ESP32 with the help of @bodmer's TFT_eSPI
C++
10
star
28

ESP32-Tesseract

4D 🧊 Hypercube animation demo for ESP32/TFT based on Space Dandy's Catherine
C
10
star
29

LGFXMeter

LGFX based Gauge Decoration and Animation library 🧭
C++
10
star
30

jqsheep

This jQuery plugin animates sheeps around page elements
JavaScript
10
star
31

M5Stack-Raytracer

An ESP32 study based on Dmitry V. Sokolov's tinyraytracer https://github.com/ssloy/tinyraytracer
C
9
star
32

TFT_GIF

Animated GIF on ST7735 with ESP8266
C
9
star
33

ESP32-MSGEQ7

🔊 📈 MSGEQ7 based AudioSpectrum Visualizer for ESP32 and TFT
C++
8
star
34

M5Stack-Rickroll

Offline rickrolling for your M5Stack
C
8
star
35

ESP32-BLETimeServer

Time server module for ESP32-BLECollector
C++
7
star
36

M5Stack-NyanCat

A NyanCat for your M5Stack
C
6
star
37

YOURLS-GeoShortURL

🔗 YOURLS plugin to add per-country support to existing short URLs
PHP
6
star
38

kde-thumbnailer-qoi

KDE thumbnailer for QOI (Quite OK Image Format)
CMake
6
star
39

esp32-qemu-sim

Github action to run ESP32 compiled binaries in QEmu and collects output logs
Shell
6
star
40

tobozo.github.io

HTML
5
star
41

node-deauther

A HTTP to Serial bridge for esp8266_deauther
JavaScript
5
star
42

WiFiManagerTz

A NTP/Timezone extension to @tzapu's WiFiManager
C++
5
star
43

SerialServer

ESP8266WebServer to Serial syntactic substitute
C++
4
star
44

ESPWifiBench

ESP8266 / ESP32 Wifi bench
Arduino
4
star
45

ghetto_blaster

Rotary controls for OLED Ghetto Blaster
C
4
star
46

SpinningRat

Horizontally spinning rat 🐀 for M5Unified
C
3
star
47

rpi-camsentry

Pan / Tilt controls + head tracking + video streaming over websocket from RaspiCam
JavaScript
3
star
48

M5Core2-SoundBouncer

M5Stack / M5Core2 demo animating 16 metronomes
C
3
star
49

ESP32-reSID

reSID is a Vice MOS6581/MOS8580 Sound Interface Device Emulator for ESP32
C
2
star
50

ESP32-Flocker

🏗️ App-suite builder for ESP32
Shell
1
star
51

php-tor-control-port

CSS
1
star
52

dotfiles

1
star