microReticulumTbeam/exercises/26_Bluetooth_discover/README.md

2.7 KiB

Exercise 26: Bluetooth Discover

Plain BLE neighborhood sounder for LilyGO T-Beam SUPREME ESP32-S3 units. This exercise is not Reticulum and does not use LoRa.

Each unit waits for GPS UTC, GPS coordinates, PPS-backed RTC discipline, and then starts BLE advertising/scanning. AMY may run without SD logging because its card reader is defective; other units should mount SD and write logs.

Build

cd /usr/local/src/microreticulum/microReticulumTbeam/exercises/26_Bluetooth_discover
pio run -e amy
pio run -e bob
pio run -e cy
pio run -e dan
pio run -e ed
pio run -e flo
pio run -e guy

Upload example:

pio run -e bob -t upload
pio device monitor -b 115200 -p /dev/ttytBOB

Behavior

  • Advertises manufacturer data in this format: TBMSND|1|NODE|seq|uptime.
  • Accepts only advertisements with prefix TBMSND, version 1, and node name in AMY, BOB, CY, DAN, ED, FLO, GUY.
  • Displays heard nodes sorted by rolling RSSI average, strongest first.
  • Drops stale entries after 20 seconds.
  • Logs accepted advertisements to SD as /logs/YYYYMMDD_HHMISS_NODE_ble_seach.log.
  • Starts a WiFi AP for log access when SD is available.

Default web addresses:

  • AMY: http://192.168.23.1/
  • BOB: http://192.168.24.1/
  • CY: http://192.168.25.1/
  • DAN: http://192.168.26.1/
  • ED: http://192.168.27.1/
  • FLO: http://192.168.28.1/
  • GUY: http://192.168.29.1/

Field Procedure

  1. Flash all units with this sounder image, each with its own environment.
  2. Start all units where they can see sky and wait until each passes GPS/RTC startup discipline.
  3. Place one unit near the intended origin, preferably central to a star topology.
  4. Carry another unit and watch the OLED.
  5. Find a position where it hears only the intended neighbor with weak or moderate RSSI.
  6. Place it there.
  7. Repeat outward to create a chain.
  8. Record the topology manually before switching to the Reticulum BLE-interface firmware.

Limitations

  • RSSI is not a precise distance measurement.
  • Body position, antenna orientation, terrain, buildings, and foliage matter.
  • BLE advertisements are not guaranteed delivery.
  • Scan and advertise duty-cycle choices affect detection latency and power draw.
  • WiFi log download can affect BLE timing; use it for retrieving logs, not while making fine placement decisions.

Bench Acceptance Test

  • With AMY and BOB on the bench, AMY displays BOB with RSSI and age, and BOB displays AMY.
  • A third unrelated Bluetooth device nearby does not appear on OLED or accepted serial records.
  • If BOB is powered off, AMY ages BOB out after the stale timeout.
  • Serial output can be captured with:
pio device monitor -b 115200 -p /dev/ttytAMY | tee logs/ble_sounder_AMY_YYYYMMDD_HHMMSS.log