Connect your Wokwi simulated IoT Devices (e.g. ESP32) to you local network!
For installation and usage instructions, check out the Wokwi ESP32 WiFi Guide
Run wokwigw
and configure Wokwi to use the Private IoT Server:
wokwi.toml
file:[net]
gateway="ws://localhost:9011"
The wokwigw
tool can forward ports from your local machine to the simulated device. For example, if you have a web server running on port 80 on your simulated device, you can forward port 8080 on your local machine to port 80 on the simulated device:
wokwigw --forward 8080:10.13.37.2:80
To forward a UDP port, add the udp:
prefix. For instance, the following command will forward UDP port 8888 on your local machine to UDP port 1234 on the simulated device:
wokwigw --forward udp:8888:10.13.37.2:1234
You can repeat the --forward
flag multiple times to forward multiple ports.
To connect from the simulation to your local machine (that is the machine running wokwigw), use the host host.wokwi.internal
. For example, if you are running an HTTP server on port 1234 on your computer, you can connect to it from within the simulator using the URL http://host.wokwi.internal:1234/.
make
The compiled binaries go into the bin
directory, as follows:
make test
Gitpod allows you to edit the code, build the project in the cloud, and then download the compiled binary. Here are the instructions:
make
to compile the project (you can also type make test
to run the tests).You can download the compiled binaries from the bin
directory by locating them in the file explorer, right-clicking the binary you want to download, and selecting "Download...".