WiFi Access Point
A virtual component that provides a simulated wireless network for Wi-Fi capable microcontrollers (like the ESP32) to connect to.
Component Preview
Unlike physical components, the WiFi Access Point exists solely to emulate a network environment in the simulator. By adding this to your project, microcontrollers can scan for its SSID and connect to it, simulating real-world IoT behavior without requiring physical hardware.
Overview
Because this is a virtual networking element, it does not have physical pins. You configure its SSID and password in the diagram.json attributes. Once running, ESP32 or ESP8266 code can connect to it using standard Wi-Fi libraries.
Pin Reference
This component is virtual and does not have any physical pins.
Configurable Attributes
| Attribute | Type | Default | Description |
|---|---|---|---|
| ssid | string | "Wokwi-GUEST" | The network name broadcasted by the AP. |
| password | string | "" | The password required to connect (leave empty for open networks). |
| channel | number | 6 | The simulated Wi-Fi channel (1-14). |
| internet | boolean | true | If true, the simulated AP provides routed access to the public internet. |
Example ESP32 Code
This sketch demonstrates how to connect to the simulated access point.
#include <WiFi.h>
// Match these with the AP attributes in your diagram.json
const char* ssid = "Wokwi-GUEST";
const char* password = "";
void setup() {
Serial.begin(115200);
Serial.println("Connecting to WiFi...");
// Begin connection
WiFi.begin(ssid, password);
// Wait until connected
while (WiFi.status() != WL_CONNECTED) {
delay(500);
Serial.print(".");
}
Serial.println("");
Serial.println("WiFi connected!");
Serial.print("IP Address: ");
Serial.println(WiFi.localIP());
}
void loop() {
// Your internet-connected code here
delay(1000);
}Simulation Notes
- The OpenHW Simulator intercepts Wi-Fi requests from the ESP32 and routes them through the browser's networking stack, allowing you to fetch real data from external APIs via the simulated
internet: trueproperty. (Subject to CORS restrictions).
