Skip to content

Wi-Fi Network

Infrastructure Wi-Fi, DHCP/DNS, optional Internet, and a browser's RF point of view in one pinless component

A Wi-Fi Network gives a graph both sides of the common embedded Wi-Fi workflow:

DirectionWhat happens
Firmware connects outwardThe network advertises its infrastructure SSID, associates the firmware station, supplies DHCP and DNS, and optionally routes policy-limited Internet traffic.
A user connects inwardThe network’s browser client joins a SoftAP hosted by firmware, then reaches the device through DHCP, ARP, TCP, and HTTP.

The component has no pins. Put it and each radio-capable board or module in the same RF Environment. The one component owns the infrastructure service and browser-client point of view.

import { Components, WifiNetworkTemplates } from "@sim86/sdk";
const room = graph.addComponent(Components.RF_ENVIRONMENT);
const c3 = graph.addComponent(Components.XIAO_ESP32C3);
const network = graph.addComponent(Components.WIFI_NETWORK, {
config: WifiNetworkTemplates.internetEnabled({ ssid: "myhome" }),
});
room.joinRfEnvironment(c3, network);

Firmware connecting to myhome sees 802.11 beacons, scans, authenticates, and associates over simulated air. By default DHCP assigns 192.168.4.2, with 192.168.4.1 as its gateway and DNS server. RF loss, interference, carrier sense, collisions, and retries apply throughout.

Choose one of the editor’s three templates, then change only the values your test cares about:

TemplateIntended use
Local development networkInfrastructure Wi-Fi, DHCP, DNS, and local services without public Internet
Internet-enabled networkThe same network with a request for policy-limited public egress
Device SoftAP testingBrowser defaults aimed at an ESP-style firmware setup AP

The usual settings are:

SettingDefaultMeaning
ssidSX Wi-FiInfrastructure network name advertised to firmware
securityopenNetwork security; open networks are the currently supported path
internetAccessfalseAsk the executor for controlled outbound Internet access
browserSsidSX-C3-APFirmware SoftAP selected by Browse
browserUrlhttp://192.168.4.1/Initial page opened on the firmware device

Channel, transmit power, beacon interval, hidden SSID, IP addresses, and browser session lifetime live under Advanced network settings. BSSID, network MAC, and browser-client MAC are stable values derived from the component ID; leave their overrides empty unless a test requires exact identities.

If firmware advertises ESP32-Setup, SDK requests and the editor’s Browse action scan and associate from the network’s browser client. They do not open a host-side socket to 192.168.4.1.

await c3.setFlash("./softap-web-server.bin");
const run = await graph.run({ duration: 60_000 });
const page = await network.fetch({
run,
ssid: "ESP32-Setup",
url: "http://192.168.4.1/status",
});
console.log(page.status, page.text());
const browser = await network.openBrowser({
run,
ssid: "ESP32-Setup",
url: "http://192.168.4.1/",
});
console.log(browser.url); // short-lived, one-use launch URL

Configure browserSsid and browserUrl on the component to make them the defaults for these calls.

Each browser session gets a unique origin. Its launch URL is one-use, exchanges for a host-only cookie, expires, and is bound to one run, network component, SSID, host, scheme, and port. Simulator86 authentication and forwarding headers are never sent to firmware.

internetAccess: true requests outbound DNS and TCP for firmware using its ordinary network stack. It does not grant a simulation container unrestricted host networking. The executor must supply a run-scoped egress capability; private, loopback, link-local, metadata, cluster, and deployment-denied ranges remain blocked, and server-side port and traffic limits still apply.

Live Internet responses are external input, so a run using them is not fully replayable even though its scheduler and RF decisions remain seeded.

  • Open networks and plain HTTP are functional.
  • WPA2 discovery is modeled, but EAPOL/CCMP data remains blocked until it is implemented end to end.
  • Browser/fetch access to a firmware-hosted HTTPS server and WebSocket upgrades are not available yet.