IoTPSUT IoT Engineering StudioPrincess Sumaya University for Technology · Dr. Mohammad Alja’afreh
Integration center · real services
Supporting engineering workspace
MQTT & Node-RED
Two broker routes, one telemetry schema. Start with Python, then connect Wokwi. Dashboard preview below is a browser model; the actual Node-RED pages use received MQTT messages.
WOKWI / WSL INTEGRATION
Connect to actual MQTT telemetry
Run the supplied ESP32 greenhouse firmware and inspect received messages, live sensor readings and per-device history. No browser-generated readings are inserted into the live view.
Already installed everything in Setup? Skip the installer command for services that are installed and running; continue with their version/status checks and configuration. One-time installation guide →
Time-series deployment center
Follow the complete 16-stage walkthrough: install, configure tokens, test direct writes, start Telegraf, test MQTT, query stored data and provision Grafana.
broker.hivemq.com:1883 · Internet required. No authentication or confidentiality. Demo data only, random session label; never send credentials, personal IDs or real sensor data.
Run in Ubuntu WSL, not Windows PowerShell. If the base setup was previously completed, this is safe to repeat. Node-RED Dashboard 2.0 is installed under your Linux user.
✓ Expected: HTTP request succeeds (no output when redirected to /dev/null). Open the Node-RED editor separately.Expected result for each action (5)
bash ~/psut-wsl/setup_wsl.sh --noderedThe installer completes and returns to the prompt. Verify the selected services and run the toolkit self-test; package logs may vary.
source ~/psut-wsl/activate.shThe toolkit virtual environment is selected in this terminal, usually with (.venv) in the prompt. Verify which python points into ~/psut-wsl/.venv.
systemctl is-active mosquitto noderedAn active line is expected for each required running service; inactive/failed requires investigation.
ss-ltn|grep :1884A listening TCP socket for port 1884 should appear if the local MQTT broker is running.
curl-fsS http://127.0.0.1:1880/ >/dev/nullHTTP request succeeds (no output when redirected to /dev/null). Open the Node-RED editor separately.
Checkpoint Both services active; port 1884; HTTP success.
02
Generate profiles
Run either or both commands. Local uses fixed lab names; HiveMQ generates a random session once and reuses it. These files live in your WSL home, not in the Windows website folder.
✓ Expected: The requested broker profile and matching Node-RED flow are generated under ~/.config/psut-wsl; use the same profile/session in all terminals.Expected result for each action (2)
python3 ~/psut-wsl/tools/mqtt_profile.py localThe requested broker profile and matching Node-RED flow are generated under ~/.config/psut-wsl; use the same profile/session in all terminals.
python3 ~/psut-wsl/tools/mqtt_profile.py hiveThe requested broker profile and matching Node-RED flow are generated under ~/.config/psut-wsl; use the same profile/session in all terminals.
In the SAME WSL terminal, open the configuration folder with Windows Explorer. Copy the desired flow JSON to Windows Downloads if needed.
WSL · Bash
cd ~/.config/psut-wsl
explorer.exe .
✓ Expected: Windows File Explorer opens the current Linux folder; no terminal output is normally required.Expected result for each action (2)
cd ~/.config/psut-wslNormally no output. pwd should show the requested directory. A missing path produces an error; do not continue until corrected.
explorer.exe .Windows File Explorer opens the current Linux folder; no terminal output is normally required.
Checkpoint flow-local.json and flow-hive.json appear.
04
Import and deploy once per broker
In Windows open Node-RED editor. Menu ☰ → Import → select flow-local.json or flow-hive.json → Import → Deploy. You may install both: unique base paths /psut-local and /psut-hive. Do not import a second copy. For an update, delete the prior PSUT Studio flow and its unused ui-base/page/group/theme and MQTT config nodes in Configuration nodes, then import the replacement and Deploy. Remove the old Lab 13 tab if no longer used.
Checkpoint MQTT input node shows connected. Dashboard 2 palette has ui-template. No duplicate dashboard paths.
05
Verify installation
Run the offline checks and then local MQTT round-trip self-test.
✓ Expected: The toolkit reports checks for the installed components. Review any FAIL or unavailable optional service before continuing.Expected result for each action (4)
source ~/psut-wsl/activate.shThe toolkit virtual environment is selected in this terminal, usually with (.venv) in the prompt. Verify which python points into ~/psut-wsl/.venv.
python3 ~/psut-wsl/tools/test_static.pyThe corresponding test program reports its checks and returns; investigate any failed assertion or error.
node ~/psut-wsl/tools/test_telemetry.jsThe corresponding test program reports its checks and returns; investigate any failed assertion or error.
bash ~/psut-wsl/tools/selftest.shThe toolkit reports checks for the installed components. Review any FAIL or unavailable optional service before continuing.
Checkpoint Tests pass; Core failures: 0. Optional services may be unavailable.
Live visualization — publish and verify
01
Terminal A — view traffic
Choose the same broker as the imported flow. Leave running.
✓ Expected: The subscriber remains open. Once a matching publisher sends data, topic and JSON payload appear; an initially blank screen is normal.Expected result for each action (3)
source ~/psut-wsl/activate.shThe toolkit virtual environment is selected in this terminal, usually with (.venv) in the prompt. Verify which python points into ~/psut-wsl/.venv.
source ~/.config/psut-wsl/mqtt-local.envThe local MQTT profile is loaded silently. Verify host 127.0.0.1, port 1884 and the matching topic in this shell.
mosquitto_sub-h"$MQTT_HOST"-p"$MQTT_PORT"-t"$MQTT_TOPIC"-q1-vThe subscriber remains open. Once a matching publisher sends data, topic and JSON payload appear; an initially blank screen is normal.
✓ Expected: The subscriber remains open. Once a matching publisher sends data, topic and JSON payload appear; an initially blank screen is normal.Expected result for each action (3)
source ~/psut-wsl/activate.shThe toolkit virtual environment is selected in this terminal, usually with (.venv) in the prompt. Verify which python points into ~/psut-wsl/.venv.
source ~/.config/psut-wsl/mqtt-hive.envThe public demo profile is loaded silently. Verify broker.hivemq.com:1883 and the generated demo session topic; use fictional data only.
mosquitto_sub-h"$MQTT_HOST"-p"$MQTT_PORT"-t"$MQTT_TOPIC"-q1-vThe subscriber remains open. Once a matching publisher sends data, topic and JSON payload appear; an initially blank screen is normal.
Checkpoint Waiting for messages.
02
Terminal B — publish from Python
Use five labelled mock DHT22 samples.
WSL · Bash
source ~/psut-wsl/activate.sh
source ~/.config/psut-wsl/mqtt-local.env
cd ~/psut-wsl/labs/pi-practical
python-m labs.exp12.publisher --mock--count5--interval2
✓ Expected: Five acknowledged publications are expected with --count 5; verify unique received records separately.Expected result for each action (4)
source ~/psut-wsl/activate.shThe toolkit virtual environment is selected in this terminal, usually with (.venv) in the prompt. Verify which python points into ~/psut-wsl/.venv.
source ~/.config/psut-wsl/mqtt-local.envThe local MQTT profile is loaded silently. Verify host 127.0.0.1, port 1884 and the matching topic in this shell.
cd ~/psut-wsl/labs/pi-practicalNormally no output. pwd should show the requested directory. A missing path produces an error; do not continue until corrected.
python-m labs.exp12.publisher --mock--count5--interval2Five acknowledged publications are expected with --count 5; verify unique received records separately.
WSL · Bash
source ~/psut-wsl/activate.sh
source ~/.config/psut-wsl/mqtt-hive.env
cd ~/psut-wsl/labs/pi-practical
python-m labs.exp12.publisher --mock--count5--interval2
✓ Expected: Five acknowledged publications are expected with --count 5; verify unique received records separately.Expected result for each action (4)
source ~/psut-wsl/activate.shThe toolkit virtual environment is selected in this terminal, usually with (.venv) in the prompt. Verify which python points into ~/psut-wsl/.venv.
source ~/.config/psut-wsl/mqtt-hive.envThe public demo profile is loaded silently. Verify broker.hivemq.com:1883 and the generated demo session topic; use fictional data only.
cd ~/psut-wsl/labs/pi-practicalNormally no output. pwd should show the requested directory. A missing path produces an error; do not continue until corrected.
python-m labs.exp12.publisher --mock--count5--interval2Five acknowledged publications are expected with --count 5; verify unique received records separately.
Checkpoint Five messages acknowledged and visible in subscriber.
03
View actual Node-RED dashboard
Open local or HiveMQ. Select the device from the dropdown. Source is self-reported; chart history is in memory.
Checkpoint Temperature and humidity tiles, trend chart, latest 10 rows. No soil for DHT22.
04
Terminal C — greenhouse fields
Same profile; use 5 samples before Wokwi.
WSL · Bash
source ~/psut-wsl/activate.sh
source ~/.config/psut-wsl/mqtt-local.env
cd ~/psut-wsl/labs/python/lab43
MESSAGES=5PERIOD=2python device_simulator.py
✓ Expected: Five telemetry messages are published at the configured interval. Confirm their reception in the matching subscriber and dashboard.Expected result for each action (4)
source ~/psut-wsl/activate.shThe toolkit virtual environment is selected in this terminal, usually with (.venv) in the prompt. Verify which python points into ~/psut-wsl/.venv.
source ~/.config/psut-wsl/mqtt-local.envThe local MQTT profile is loaded silently. Verify host 127.0.0.1, port 1884 and the matching topic in this shell.
cd ~/psut-wsl/labs/python/lab43Normally no output. pwd should show the requested directory. A missing path produces an error; do not continue until corrected.
MESSAGES=5PERIOD=2python device_simulator.pyFive telemetry messages are published at the configured interval. Confirm their reception in the matching subscriber and dashboard.
WSL · Bash
source ~/psut-wsl/activate.sh
source ~/.config/psut-wsl/mqtt-hive.env
cd ~/psut-wsl/labs/python/lab43
MESSAGES=5PERIOD=2python device_simulator.py
✓ Expected: Five telemetry messages are published at the configured interval. Confirm their reception in the matching subscriber and dashboard.Expected result for each action (4)
source ~/psut-wsl/activate.shThe toolkit virtual environment is selected in this terminal, usually with (.venv) in the prompt. Verify which python points into ~/psut-wsl/.venv.
source ~/.config/psut-wsl/mqtt-hive.envThe public demo profile is loaded silently. Verify broker.hivemq.com:1883 and the generated demo session topic; use fictional data only.
cd ~/psut-wsl/labs/python/lab43Normally no output. pwd should show the requested directory. A missing path produces an error; do not continue until corrected.
MESSAGES=5PERIOD=2python device_simulator.pyFive telemetry messages are published at the configured interval. Confirm their reception in the matching subscriber and dashboard.
Checkpoint Select python-sim in dashboard, see soil moisture too.
05
Wokwi integration
Proceed to Python Lab 43. It describes exact VS Code firmware settings, Windows forwarding, build and sensor controls. Optionally use Telegraf/InfluxDB and Grafana in parallel.
Checkpoint ESP32 readings appear under esp32-01. Node-RED works without InfluxDB.
HiveMQ browser client: open the linked WebSocket client, use its public broker settings (host broker.hivemq.com, secure WebSocket port 8884, path /mqtt if configurable), connect using a random client ID, subscribe to the exact MQTT_TOPIC printed by the profile. This is separate from the TCP port 1883 used by Python and Wokwi. Do not enter private credentials.
Node-RED has no editor login by default. Keep the editor on your own workstation. If this is a shared machine, configure adminAuth and dashboard access before use; do not expose port 1880 to untrusted networks. For a local-only listener, edit ~/.node-red/settings.js, set the existing uiHost property to "127.0.0.1", then restart Node-RED. Do not add a duplicate property.
ThingSpeak integration center
Use the dedicated setup, upload, readback and Node-RED walkthrough.
Load psut-stack-evidence.json from the notebook or inspect packaged local test evidence. Playback displays previously recorded software observations, not a live broker or physical measurement.