/ESP32_WiFi_SNIFF_BLE_ANDROID-APP_PathFinderLE_V01

esp32 as wifi Sniffer connected via BLE to Android-App

Primary LanguageC++MIT LicenseMIT

PathFinderLE - M5 MODULE

In THIS repo we have the INO code for the M5 Stick to measure (track) Mobile Devices and transfer those Data to the PathFinder APP.

Repo for PathFinder APP: https://github.com/iCounterBOX/PathFinderLE-Android-APP

image

At its core, Pathfinder is a tool for dynamic counting and storage of mobil devices motion-profiles Technically, the process is based on so-called WiFi-Beacons, Bluetooth beacons and BLE-C19-Exposure-Beacons. After a brief introduction to this technology, we will look at some example use cases.

image

We are surrounded by many devices that send out these beacons. Some send BlueTooth .. some WiFi. PathFinder scans these beacons and saves them locally for further statistical analysis. PathFinder AND M5 ( an ESP32 Module ) form a very powerful PAIR - If M5 is NOT available, then our APP processes ONLY BT or BLE beacons. Via RSSI signal we derive a distance value from this in a mathematically prepared manner. Similar to the procedure we also know from the official Corona warning app (CWA) ). On this basis, PathFinder can also recognize an SDV (Social distancing Violation) and, if necessary, trigger further alarms.

image

We summarize again briefly

  • PathFinder is essentially a mobile device beacon signal scanner
  • This procedure provides data. These are recorded and saved in a local database

image

PathFinder already provides some very meaningful statistics ... like visitor statistics or people counting

  • Counting based on BT ( classic )
  • Counting based on BLE ( BT low Energy )
  • Counting on C19 Exposure-Notification-Beacons

what do we need to run PathFinder?

The PathFinder Android APP is self-sufficient! Does not need WiFi (Home LAN or something else..) - does not burden the data volume (from your provider)!

The ESP32 Espresif MCU is required for PathFinder to scan WiFi beacons - but not a MUST!

Pathfinder APP / WITHOUT M5 (ESP-32):

WiFi beacon scan is NOT done. This means that ONLY statistical evaluations are available for BT / BLE and EXPOSURE (C19).

Pathfinder APP / WITH M5 (ESP-32):

In this combination, ESP (e.g. M5) scans the WiFi. ESP periodically transmits the collected WiFi beacons via BT to the PathFinder APP. In the PathFinder APP, these scans are then stored in a SQlite DB for further processing.

Some (possible) UseCases

image

From our point of view the "Market Density Indicator" is a very strong UC

The scenario: In times of Corona we want to avoid very full supermarkets. And there are also long queues at the cash registers and no parking spaces in front of the market.

In the Market PathFinder works as a data provider. The data is sent to the backend in the cloud.. The supermarket customer ONLY needs the PathFinder APP to receive the Market Density-Information.

Thanks for the sources of knowledge that I found on the web

ESP32-Wifi-Beacon-Scanner:

This sniffer example here base on some existing code i found on other GitHub-Repos here - thx-credidits to those! some of them exist only in cpp. so they need some adaption to get compiled as INO.

ETS-PoliTO / esp32-sniffer https://github.com/ETS-PoliTO/esp32-sniffer/blob/master/main/main.c
ESP32 WiFi MAC Scanner/Sniffer (promiscuous): https://www.hackster.io/p99will/esp32-wifi-mac-scanner-sniffer-promiscuous-4c12f4 ESP32 – WiFi sniffer: https://blog.podkalicki.com/esp32-wifi-sniffer/

Another code source is from my study of beacon-scan via the NODE MCU ESP8266..documented here on my Github.

Quite new for me is this BLE-Topoic as the NodeMCU does not have the BLE on board. BLE is a very huge lib. we need to take care to have the right settings..otherwise it cannot be compiled ( err: code is too big ..)

image

Release/Version-Log:

Sept. 2021:

PathFinder_V2:

  • new function FREEZE ( freeze the beacons arround you in a DB - any NEW device will trigger an Alarm)
  • Covid19 / Contact Tracing Beacons / Exposure Notification ( Strong for counting as well )
  • GEO-MAP-View - Devices that are close to PathFinder are displayed in RealTime on a map
  • Visitor-History-Graph - Shows the number of devices over time
  • Backup - The user saves all SQlite data collected by PathFinder on the SD

PathFinder_V1:

  • first working-together between ESP32 and pLE-APP
  • basic research + learning