Diagnose before changing settings
Find the failed layer, run the check, then retry only the affected step.
python: command not found
Activate the venv in WSL; use python3 for base Python.
source ~/psut-wsl/activate.sh
which pythonExpected result for each action (2)
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.which pythonThe interpreter path ends in /psut-wsl/.venv/bin/python when the toolkit is active.
ModuleNotFoundError
Use the toolkit venv, not Windows Python. Reinstall requirements if needed.
source ~/psut-wsl/activate.sh
python -m pip install -r ~/psut-wsl/requirements.txtExpected result for each action (2)
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.python -m pip install -r ~/psut-wsl/requirements.txtInstallation completes or reports requirements already satisfied; verify imports in the selected interpreter.
No module named labs
Practical commands must be run from the pi-practical parent folder.
cd ~/psut-wsl/labs/pi-practical
ls labsExpected result for each action (2)
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.ls labsThe requested files/directories are listed; compare names and permissions with the guide. An empty directory can produce no output.
SyntaxError from shell commands
Bash commands go in the WSL terminal; Python statements go in a .py file or Python REPL. Type exit() to leave >>>.
GPIO pin factory error
Activate fakepi; never use sudo python (loses PYTHONPATH).
source ~/psut-wsl/activate.sh
python -c "import RPi.GPIO; print(RPi.GPIO.__file__)"Expected result for each action (2)
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.python -c "import RPi.GPIO; print(RPi.GPIO.__file__)"The printed module path should point to the toolkit fakepi implementation in WSL, not a physical GPIO driver.
MQTT connection refused
Start and inspect local broker. Confirm Windows forwarding for Wokwi.
sudo systemctl start mosquitto
systemctl is-active mosquitto
ss -ltn | grep 1884Expected result for each action (3)
sudo systemctl start mosquittoNormally no output on success. Run systemctl is-active for the named service and confirm active; inspect logs if it fails.systemctl is-active mosquittoAn 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.
Database access denied / user exists
Run repeatable setup then source the generated environment file.
bash ~/psut-wsl/tools/setup_db.sh
source ~/.config/psut-wsl/db.envExpected result for each action (2)
bash ~/psut-wsl/tools/setup_db.shDatabase and limited-privilege user preparation completes. No password should appear in shared output; verify authorized queries.source ~/.config/psut-wsl/db.envDatabase environment variables load without displaying credentials. The next authorized database query must succeed.
ThingSpeak entry ID 0
Check Write API key, channel fields and update interval; wait at least 20 seconds. Never print the key.
test -n "$THINGSPEAK_WRITE_KEY" && echo "Key set"InfluxDB unauthorized
Set the token in every new terminal; check bucket access.
source ~/.config/psut-wsl/influx.env
curl -fsS http://localhost:8086/healthExpected result for each action (2)
source ~/.config/psut-wsl/influx.envThe token becomes available to child processes without being printed. Check only whether it is set, then test authorized access.curl -fsS http://localhost:8086/healthInfluxDB health JSON includes status pass when the service is healthy; this does not verify bucket permissions or stored data.
No Telegraf data
Check subscriber topic and Telegraf logs; publish from Python first.
mosquitto_sub -h 127.0.0.1 -p 1884 -t "psut/iot/lab-local/greenhouse/+/telemetry" -vPort already in use
Stop only your own old server with Ctrl+C; use ss to identify sockets.
ss -ltnp
ss -lunpExpected result for each action (2)
ss -ltnpSocket table appears; check the required protocol, port and connection state. Empty results may be normal without active connections.ss -lunpSocket table appears; check the required protocol, port and connection state. Empty results may be normal without active connections.
Wokwi firmware missing
Open individual project root, PlatformIO Build first. Confirm firmware paths from wokwi.toml. Install required libraries through PlatformIO.
Wokwi serial timeout
Keep simulator visible, use one serial client; Windows PowerShell checks port 4000. If WSL cannot reach Windows use fallback from Lab 35/36.
Dashboard empty
Choose correct time range and node, confirm InfluxDB points. For Node-RED check Debug and Dashboard 2.0 installation.
curl -fsS http://localhost:3000/api/healthOLED image blank
Use corrected fakepi; run non-console OLED example; open last nonblank PNG.
Browser Copy button unavailable
Select the code manually and copy using Ctrl+C. Browser permissions may block clipboard on file://.
Dual-broker diagnostics
First verify the selected profile. Never test a local broker using port 1883.
source ~/.config/psut-wsl/mqtt-local.env
printf "%s:%s\n%s\n" "$MQTT_HOST" "$MQTT_PORT" "$MQTT_TOPIC"
sudo systemctl status mosquitto --no-pager
sudo journalctl -u mosquitto -n 30 --no-pager
ss -ltn | grep :1884Expected result for each action (5)
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.printf "%s:%s\n%s\n" "$MQTT_HOST" "$MQTT_PORT" "$MQTT_TOPIC"The selected broker address, port and topic are printed. They must match the chosen profile, without revealing credentials.sudo systemctl status mosquitto --no-pagerThe service status and recent log lines appear. Look for Active: active (running) for a running service.sudo journalctl -u mosquitto -n 30 --no-pagerRecent service log entries appear. Check errors and timestamps; redact credentials before sharing.ss -ltn | grep :1884A listening TCP socket for port 1884 should appear if the local MQTT broker is running.
For HiveMQ switch to mqtt-hive.env; verify internet and exact session, not local systemctl. Dashboard empty? Check MQTT node connection and Rejected telemetry debug output. Old duplicate path? Delete old imported flow and unused UI config nodes before reimport. Full dashboard guide.