Skip to content

Running a demo

The simulator plays every room computer of a small ward: 5 residents in rooms 11 to 14, room 13 with two beds, 29 sensors. The backend cannot tell it from real hardware.

Terminal window
cd edge/simulator
uv run simulator_gui.py # buttons: a card per resident, a panel per room, the devices table
uv run simulator.py # or the terminal; Tab completes commands

Only one simulator can run against a broker at a time; a second one is refused.

Scenario Window Terminal What you should see
Stops breathing Apnea on a resident card apnea 1 No breathing after ~10 s, escalated after 30 s more
Low oxygen Low SpO2 lowspo2 4 Low oxygen
One odd signal Noisy noisy 2 Nothing: one sign is not enough
A fall Fall fall 1 Possible fall for that resident only
Call bell Bell bell 5 A critical bell alert
Crying in a room Cry on a room panel cry 3 One soft Check every bed for the room
A sensor dies Crash in the devices table crash radar-002 Sensor offline, never No breathing
A new sensor Plug in plug radar 14 A pending radar in the control room

In the terminal, the number is the resident (1 to 5), not the room. After a scenario, Back to normal (normal 1) and wait about 20 seconds before running it again.

Let the ward run three minutes before the first scenario: the personal baselines need history.

Terminal window
cd edge/micsensor && uv run mic_sensor.py --room room12

Stay quiet for the first three seconds while it learns the room. Approve mic-laptop in the control room; a loud clap or call raises Check every bed for room 12. It measures loudness, not words.

  1. Stop every simulator and the server; reset the broker: docker compose rm -sfv mosquitto && docker compose up -d mosquitto.
  2. Start the server, then exactly one simulator; approve all sensors, then room 13’s by hand (two beds).
  3. Wait three minutes; check the station shows All clear and Live.
  4. Keep the laptop lid open and the charger in: a sleeping laptop makes every sensor look offline.