70 lines
1.4 KiB
Typst
70 lines
1.4 KiB
Typst
#import "/metadata.typ": *
|
|
#import "/tail/bibliography.typ": *
|
|
#import "/tail/glossary.typ": *
|
|
#import "/main/architecture/description.typ": *
|
|
|
|
#import "/resources/slides.typ": *
|
|
|
|
== Gateway — BLE to MQTT Bridge
|
|
|
|
#slide[
|
|
#grid(
|
|
columns: (1fr, 1fr),
|
|
gutter: 2em,
|
|
[
|
|
*Architecture*
|
|
- Raspberry Pi 4 — Python
|
|
- Passive @ble:short scan (bleak)
|
|
- MQTTS publisher (paho-mqtt)
|
|
- systemd service — auto-restart
|
|
- Remote access via Tailscale
|
|
],
|
|
[
|
|
*Data flow*\
|
|
Thingy:52
|
|
-> BLE advertising
|
|
Raspberry Pi
|
|
-> MQTTS (TLS)
|
|
RabbitMQ broker
|
|
->
|
|
InfluxDB
|
|
]
|
|
)
|
|
]
|
|
|
|
== Gateway — Key Challenges
|
|
|
|
#slide[
|
|
#grid(
|
|
columns: (1fr, 1fr),
|
|
gutter: 2em,
|
|
[
|
|
*BLE filtering*
|
|
- GATT → passive advertising
|
|
(BlueZ limitation)
|
|
- Filter: `company_id = 0xffff`
|
|
- exactly 14 bytes
|
|
- Continuous BLE scan (100% duty cycle)
|
|
- Deduplication: 10s cache per MAC address
|
|
],
|
|
[
|
|
*Reliability*
|
|
- MQTT auto-restart via systemd
|
|
- `os._exit(1)` on disconnection
|
|
- Validated with 2 cases:
|
|
- Network disconnection
|
|
- Wrong MQTT credentials
|
|
]
|
|
)
|
|
]
|
|
|
|
== Gateway — Data Collection Flow
|
|
|
|
#slide[
|
|
#align(center)[
|
|
#figure(
|
|
image("/resources/img/gateway_overview.svg", height: 40%),
|
|
caption: [Gateway communication chain — from @ble:short advertising to database storage]
|
|
)
|
|
]
|
|
] |