Class diagram shows Gateway structure with attributes, constants and methods, and its dependencies on BleakScanner and MQTTClient. Sequence diagram shows the full data flow from BLE advertising to MQTT publication, including startup, data collection and node failure scenarios. Assisted-by: Claude:claude-sonnet-4-6 — PlantUML syntax
31 lines
884 B
Plaintext
31 lines
884 B
Plaintext
@startuml
|
|
skinparam sequenceMessageAlign center
|
|
|
|
participant "Thingy:52" as thingy
|
|
participant "Gateway\n(Raspberry Pi)" as gw
|
|
participant "MQTT Broker\n(RabbitMQ)" as broker
|
|
participant "Database\n(InfluxDB)" as db
|
|
|
|
== Startup ==
|
|
gw -> gw : load config.json
|
|
gw -> broker : connect (MQTTS, TLS, auth)
|
|
broker --> gw : connected
|
|
gw -> gw : start BLE scan
|
|
|
|
== Data collection ==
|
|
loop every 2 min to 6 hours
|
|
thingy -> thingy : read sensors
|
|
thingy -> gw : BLE advertising packet\n(key/value payload)
|
|
gw -> gw : filter on UUID ef680100
|
|
gw -> gw : decode_payload()\n0x02 humidity\n0x03 temperature\n0x04 CO2
|
|
gw -> gw : add UTC timestamp
|
|
gw -> broker : publish JSON\n{gateway_id}/{mac}/update
|
|
broker -> db : store measurement
|
|
end
|
|
|
|
== Node failure ==
|
|
thingy ->x gw : no advertising for > 6h
|
|
gw -> broker : node considered dead\n(missing from next publish)
|
|
|
|
@enduml
|