Skip to content
PSUT / IoTEngineering learning studio
WORKSPACE
Offline-first portalDr. Mohammad Alja’afreh
Cyber Defense StudioIoT Security and PrivacyExperimentsWorkspaces
ENGINEERING WORKSPACE
Home/WSL Laboratories/Deployment wizard
PSUT IoT Engineering StudioPrincess Sumaya University for Technology · Dr. Mohammad Alja’afreh
Deployment / guided setup
Supporting engineering workspace

Install once. Verify every step.

Follow one action at a time. Existing installations can be checked off after verification. No commands run automatically.

View complete setup reference
01

Install Ubuntu 24.04

Open Start, search for PowerShell, right-click and choose Run as administrator. First check the distributions. If Ubuntu-24.04 is already listed, skip the install command. Otherwise run the second command. Restart Windows if asked.

Windows PowerShell
wsl -l -v
✓ Expected: A table of installed distributions, STATE and VERSION appears. Verify the intended distribution is listed with VERSION 2.
Windows PowerShell · administrator (only if missing)
wsl --install -d Ubuntu-24.04
✓ Expected: Installation completes or Windows requests a restart. On first launch create your Linux username and password; the prompt resembles username@PC:~$. Verify the distribution with wsl -l -v (VERSION 2). WSL is a Linux environment, not a physical Raspberry Pi.
Checkpoint Ubuntu-24.04 appears in wsl -l -v with VERSION 2.
02

Open Ubuntu and create your Linux account

Run this in Windows PowerShell. On the first launch, choose a Linux username and password. Password characters are invisible while typing. The Linux password is used by sudo.

Windows PowerShell
wsl -d Ubuntu-24.04
✓ Expected: The selected Linux shell opens; on first launch complete account creation. The prompt ends in $. No physical board is connected by this command.
Checkpoint Ubuntu opens; prompt resembles username@computer:~$.
03

Check systemd

In Ubuntu, run the following command. If it prints systemd, proceed directly to the next step. If it does not, use the separate recovery box under Troubleshooting at the bottom.

Ubuntu WSL · Bash
ps -p 1 -o comm=
✓ Expected: systemd should be printed for the service-based workflow.
Checkpoint Output: systemd.
04

Install Visual Studio Code

On Windows, open the VS Code download page. Download the Windows User Installer, run it, accept the defaults and select Add to PATH if offered. Open VS Code. If it is already installed, skip installation.

Checkpoint VS Code opens on Windows.
05

Install the Windows VS Code extensions

In VS Code press Ctrl+Shift+X. Search for each extension by its exact name: WSL (Microsoft), PlatformIO IDE (PlatformIO), and Wokwi Simulator (Wokwi). Click Install for each. Keep this window local (not connected to WSL). Wokwi requires license activation; see Part E. Python is installed in the remote WSL window in Part D.

Checkpoint All three Windows extensions appear as installed.
06

Locate the extracted website folder

In Windows File Explorer, right-click the downloaded complete website ZIP and select Extract All. Open the extracted folder. You will see index.html, START_WEBSITE.cmd, assets, labs and a folder named psut-wsl. Select only the psut-wsl folder and press Ctrl+C.

Checkpoint The psut-wsl folder contains setup_wsl.sh, requirements.txt, fakepi, labs, tools and wokwi.
07

Open the Linux home folder in File Explorer

Return to the Ubuntu terminal. Run the two commands below. Windows File Explorer opens your Linux home directory. If psut-wsl already exists there, do not paste over it: use the optional upgrade instructions below, or keep your existing working Version 4–6 toolkit and skip the paste operation in the next step.

Ubuntu WSL · Bash
cd ~
explorer.exe .
✓ Expected: Windows File Explorer opens the current Linux folder; no terminal output is normally required.
Expected result for each action (2)
  1. cd ~Normally no output. pwd should show the requested directory. A missing path produces an error; do not continue until corrected.
  2. explorer.exe .Windows File Explorer opens the current Linux folder; no terminal output is normally required.
Checkpoint Explorer opens the Ubuntu home folder, not the Windows Downloads folder.
08

Paste and verify the toolkit

For a new installation, in the Linux home Explorer window, press Ctrl+V to paste the folder copied in the first step. If you are keeping an existing working toolkit, skip the paste and just run the verification command. Return to Ubuntu and list its contents. Do not copy the whole website into the toolkit folder.

Ubuntu WSL · Bash
ls ~/psut-wsl
✓ Expected: The toolkit directory listing includes setup_wsl.sh, labs, tools and wokwi.
Checkpoint The output includes setup_wsl.sh, requirements.txt, fakepi, labs, tools and wokwi.
09

Run the complete installer

Run the following command in Ubuntu. It installs the base packages, creates the Python virtual environment, installs the required Python libraries and configures the IoT services. Enter your Linux password when sudo asks; wait until the shell prompt returns. If Node-RED installer requests confirmation, read the prompt. Do not close the terminal during installation.

Ubuntu WSL · Bash
bash ~/psut-wsl/setup_wsl.sh --all
✓ Expected: The installer completes and returns to the prompt. Verify the selected services and run the toolkit self-test; package logs may vary.
Checkpoint Final line begins Done. If an error appears, stop and use the first error to diagnose; do not treat a partial installation as success.
10

Activate Python

Run the following in Ubuntu. Repeat the source command in every new terminal, including the VS Code terminal. This selects the venv and enables the fake Raspberry Pi.

Ubuntu WSL · Bash
source ~/psut-wsl/activate.sh
which python
python --version
python -m pip check
✓ Expected: No broken requirements found. Resolve any reported conflicts before continuing.
Expected result for each action (4)
  1. 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.
  2. which pythonThe interpreter path ends in /psut-wsl/.venv/bin/python when the toolkit is active.
  3. python --versionThe installed version is printed. For this toolkit InfluxDB must be 2.x; version numbers otherwise depend on installation.
  4. python -m pip checkNo broken requirements found. Resolve any reported conflicts before continuing.
Checkpoint Prompt starts with (.venv); which python ends in /psut-wsl/.venv/bin/python.
11

Run the toolkit self-test

This tests Python imports, simulated GPIO, DHT22, local MQTT on port 1884, MariaDB and optional service reachability. It may ask for your sudo password.

Ubuntu WSL · Bash
bash ~/psut-wsl/tools/selftest.sh
✓ Expected: The toolkit reports checks for the installed components. Review any FAIL or unavailable optional service before continuing.
Checkpoint Core failures: 0; optional InfluxDB, Grafana and Node-RED reachable after a complete installation.
12

Check each installed service

These commands check installed tool versions and service status. Telegraf is deliberately not started as a system service; Lab P43 starts its own instance.

Ubuntu WSL · Bash
systemctl is-active mosquitto mariadb nodered influxdb grafana-server
ss -ltn | grep :1884
✓ Expected: A listening TCP socket for port 1884 should appear if the local MQTT broker is running.
Expected result for each action (2)
  1. systemctl is-active mosquitto mariadb nodered influxdb grafana-serverAn active line is expected for each required running service; inactive/failed requires investigation.
  2. ss -ltn | grep :1884A listening TCP socket for port 1884 should appear if the local MQTT broker is running.
Ubuntu WSL · Bash
node --version
influxd version
telegraf version
✓ Expected: The installed version is printed. For this toolkit InfluxDB must be 2.x; version numbers otherwise depend on installation.
Expected result for each action (3)
  1. node --versionThe installed version is printed. For this toolkit InfluxDB must be 2.x; version numbers otherwise depend on installation.
  2. influxd versionThe installed version is printed. For this toolkit InfluxDB must be 2.x; version numbers otherwise depend on installation.
  3. telegraf versionThe installed version is printed. For this toolkit InfluxDB must be 2.x; version numbers otherwise depend on installation.
Checkpoint Mosquitto, MariaDB, Node-RED, InfluxDB and Grafana each report active; port 1884 is listening; each version command returns a version.
13

Open the WSL Python workspace

Run these commands in Ubuntu. VS Code opens a remote window. If prompted, allow VS Code Server installation. In that window press Ctrl+Shift+X, search Python (Microsoft), and click Install in WSL: Ubuntu-24.04. Press Ctrl+Shift+P → Python: Select Interpreter and select the .venv interpreter inside your opened folder (use Enter interpreter path and browse to .venv/bin/python if necessary).

Ubuntu WSL · Bash
cd ~/psut-wsl
code .
✓ Expected: VS Code opens the current directory; confirm the WSL remote indicator for Linux projects.
Expected result for each action (2)
  1. cd ~/psut-wslNormally no output. pwd should show the requested directory. A missing path produces an error; do not continue until corrected.
  2. code .VS Code opens the current directory; confirm the WSL remote indicator for Linux projects.
Checkpoint Bottom-left shows WSL: Ubuntu-24.04; Python interpreter is the toolkit venv.
14

Run your first Python experiment

In the remote VS Code window select Terminal → New Terminal. Run these commands in that terminal. Stop the blinking program with Ctrl+C.

Ubuntu WSL · Bash
source ~/psut-wsl/activate.sh
cd ~/psut-wsl/labs/python/lab29
python blink_gpiozero.py
✓ Expected: The fake GPIO17 output alternates HIGH/LOW every 0.5 seconds. Press Ctrl+C to stop.
Expected result for each action (3)
  1. 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.
  2. cd ~/psut-wsl/labs/python/lab29Normally no output. pwd should show the requested directory. A missing path produces an error; do not continue until corrected.
  3. python blink_gpiozero.pyThe fake GPIO17 output alternates HIGH/LOW every 0.5 seconds. Press Ctrl+C to stop.
Checkpoint The terminal reports GPIO17 changing between HIGH and LOW; the fake Pi is working.
15

Activate Wokwi

Open a separate, local VS Code window using File → New Window. Press Ctrl+Shift+P, search Wokwi: Request a new License and follow the browser instructions. Availability and license terms depend on the Wokwi account. See Wokwi’s activation guide.

Checkpoint Wokwi reports a valid license in VS Code.
16

Build the first Wokwi project

In the local Windows VS Code window use File → Open Folder. Browse to the extracted website folder → psut-wsl → wokwi → uno-blink. Trust the workspace if you trust the supplied source. Wait for PlatformIO to initialize; click its Build checkmark in the bottom status bar (or Ctrl+Shift+P → PlatformIO: Build).

Checkpoint Build succeeds; .pio/build/uno/firmware.hex is created.
17

Start the simulator

Open diagram.json. Press Ctrl+Shift+P → Wokwi: Start Simulator. The project already contains its wiring, firmware code and wokwi.toml.

Checkpoint The Arduino LED blinks in Wokwi. This is actual firmware simulation, separate from the website models.
18

Verify the local MQTT route before using ESP32

Keep Ubuntu running. In Windows PowerShell check port 1884. If the result is False, do not change random network settings: use the troubleshooting section below. Then follow the MQTT center for matching broker configuration and Lab P43 for the ESP32 project.

Windows PowerShell
Test-NetConnection localhost -Port 1884
✓ Expected: Look for TcpTestSucceeded : True for the specified port. This proves TCP reachability only.
Checkpoint TcpTestSucceeded : True. This tests Windows reachability, not MQTT message delivery or Wokwi’s gateway.
19

Configure MQTT and Node-RED

Generate the matching broker profile, import its FlowFuse Dashboard 2.0 flow, deploy, and test Python telemetry before Wokwi. Use Mosquitto port 1884 or public HiveMQ port 1883; never send personal data to the public broker.

Open detailed service guide ↗

Checkpoint A subscriber receives the expected topic and valid readings appear on the selected Node-RED dashboard.
20

Configure Telegraf, InfluxDB and Grafana

Follow the time-series studio in order. Create the organization, bucket and scoped tokens; test direct writes, MQTT ingestion, and the Grafana data source.

Open detailed service guide ↗

Checkpoint InfluxDB contains timestamped points and Grafana displays a query of those points.
21

Configure ThingSpeak

Create a private channel and fields, enter API keys privately, run the upload and readback tests.

Open detailed service guide ↗

Checkpoint A positive entry ID is returned and the corresponding stored record is visible.
22

Configure MariaDB

Follow Practical Lab X11 to create the lab schema and account. Run the actual Python program and verify rows using the database client.

Open detailed service guide ↗

Checkpoint A query returns the expected inserted sensor records.

Installation troubleshooting · Linux & WSL commands