How paridhika/mqttws_parking works
MQTTWS_Parking models a parking lot with HiveMQ as the MQTT broker and Python Paho clients generating parking operations. The main workflow is client arrival, MQTT request or sensor status publication, broker-side parking-state handling, and service-time/throughput measurement. The README documents WebSocket transport and server-side handling; the sampled plugin excerpts confirm callback registration and some general broker callbacks, but not the parking-specific message logic. The graph therefore shows documented responsibilities without asserting unverified callback internals.
Main entry points: hivemq.jar HiveMQ broker · HelloWorldMainClass.java Plugin entry · parking_simulation.py Parking clients · client.py Paho client
Components 17
Parking simulation
- Parking clients
paho.mqtt.python/parking_simulation.py - Local slot model
paho.mqtt.python/parking_simulation.py - Service-time tool
paho.mqtt.python/calculateServiceTime.py
MQTT messaging
- Paho client
paho.mqtt.python/src/paho/mqtt/client.py - WebSocket MQTT
hivemq-3.1.5/conf/config.xml
Broker handling
- HiveMQ broker
hivemq-3.1.5/bin/hivemq.jar - Plugin entry
hivemq-3.1.5/plugins/hivemq-hello-world-plugin-master/src/main/java/com/acme/plugin/HelloWorldMainClass.java - Publish callback
hivemq-3.1.5/plugins/hivemq-hello-world-plugin-master/src/main/java/com/acme/callbacks/PublishReceived.java - Subscribe callback
hivemq-3.1.5/plugins/hivemq-hello-world-plugin-master/src/main/java/com/acme/callbacks/SubscribeReceived.java - Connection callbacks
hivemq-3.1.5/plugins/hivemq-hello-world-plugin-master/src/main/java/com/acme/callbacks/ClientConnect.java - Disconnect callback
hivemq-3.1.5/plugins/hivemq-hello-world-plugin-master/src/main/java/com/acme/callbacks/ClientDisconnect.java - Broker persistence
hivemq-3.1.5/data/persistence
Performance measurement
- Service metrics
paho.mqtt.python/parking_simulation.py - Operation metrics
paho.mqtt.python/calculateServiceTime.py - Simulation results
paho.mqtt.python/Results
Other components
- Arriving cars
- Slot sensors
Connections 21
- Arriving cars → Parking clients: initiate requests
- Slot sensors → Paho client: publish status
- Parking clients → Local slot model: updates slot state
- Parking clients → Paho client: creates clients
- Service-time tool → Paho client: creates clients
- Paho client → WebSocket MQTT: sends MQTT
- WebSocket MQTT → HiveMQ broker: carries messages
- HiveMQ broker → Plugin entry: starts plugin
- Plugin entry → Publish callback: registers callback
- Plugin entry → Subscribe callback: registers callback
- Plugin entry → Connection callbacks: registers callback
- Plugin entry → Disconnect callback: registers callback
- HiveMQ broker → Publish callback: dispatches publish
- HiveMQ broker → Subscribe callback: dispatches subscribe
- HiveMQ broker → Connection callbacks: dispatches connect
- HiveMQ broker → Disconnect callback: dispatches disconnect
- HiveMQ broker → Broker persistence: persists broker state
- Parking clients → Service metrics: records service times
- Service-time tool → Operation metrics: records service times
- Service metrics → Simulation results: writes results
- Operation metrics → Simulation results: writes results