Wi-Fi (Client & Access Point Mode)

Wi-Fi is the same wireless technology your phone or laptop uses to get on the internet — and it lets your microcontroller do the same thing.

Connectivity10 blocksMicroPythonC++

Wi-Fi is the same wireless technology your phone or laptop uses to get on the internet — and it lets your microcontroller do the same thing. Once connected, your board can fetch data from the internet, send data to a website, or even become its own tiny website that other devices can visit. In Open Maker Studio, Wi-Fi blocks handle network connection with retry logic, HTTP GET/POST REST queries, JSON parsing, and a background web server / WebSocket server on port 80.


1. Real-World Uses

Wi-Fi is the go-to choice whenever a project needs to reach the wider internet, not just talk to nearby devices:

  • Weather stations that upload temperature/humidity readings to a website or app every few minutes.
  • Smart home gadgets — a Wi-Fi-connected relay that you can switch on/off from a phone app anywhere in the world (not just in the same room, unlike Bluetooth).
  • IFTTT/webhook automations — e.g. a doorbell button press posts a JSON message that triggers an email, a Slack notification, or a smart light turning on.
  • A project's own web page — hosting a small control panel (like a slider or button page) directly from the microcontroller, so any phone/laptop on the same network can open a browser and control it, no app install needed.

Trade-off worth knowing: Wi-Fi uses noticeably more power than Bluetooth or ESP-NOW (Sections 7.2/7.3), so it's a better fit for projects plugged into a wall outlet than for small battery-powered gadgets.


2. Hardware Specifications & Board Support

  • Compatible Boards: ESP32 (all variants), ESP8266, Raspberry Pi Pico W, Pico 2 W.
  • Frequency Band: 2.4 GHz IEEE 802.11 b/g/n.
  • Security Modes: WPA/WPA2 Personal, Open networks.

3. How it Works (Connection Retry & Web/WebSocket Server)

  • Connection Retry — same ~15-second timeout on both languages:
    • MicroPython: retries up to 15 times at a fixed 1-second interval (not exponential backoff — each retry waits the same 1 second, not a growing delay), printing a . per attempt. Gives up and returns False after ~15 seconds if it never connects. If the very first connect() call raises an OSError, it also tries one full radio reset (off → wait → on) before retrying.
    • C++ (Arduino-core): retries up to 30 times at a fixed 500ms interval (also ~15 seconds total), printing a . per attempt, then reports success or failure via Serial.println either way instead of hanging forever.
  • Web Server — real threading only on the MicroPython side, and only for WebSocket clients: the accept loop itself runs in one background thread; plain HTTP GET requests are handled one at a time inside that same loop. Each WebSocket client that connects gets its own dedicated thread. On C++, the Arduino WebServer library is not threaded at all — it's a single-threaded, polling design that only processes a request when server.handleClient() is called from the main loop().

4. Supported Blockly Blocks (10 Blocks)

Drawing the blocks…

5. Simulator Behavior

[!IMPORTANT] Wi-Fi does not actually function in the browser-based Circuit Simulator — this is a real, deliberate gap, not a documentation simplification. The MicroPython path's network.WLAN is a stub: connect() is a no-op, isconnected() always returns False, and ifconfig() always returns ("0.0.0.0", "0.0.0.0", "0.0.0.0", "0.0.0.0"). Concretely, when simulating:

  • Connect to Wi-Fi always exhausts all 15 retries and reports failure, every time, regardless of the SSID/password you enter.
  • Is Wi-Fi Connected? always returns false.
  • Get IP Address always returns "0.0.0.0".
  • HTTP GET/POST blocks never fire a real network request — they always take the "not connected" fallback path.

All of these blocks generate fully correct, real code for actual hardware — this limitation is specific to previewing them in-browser. There's no real network stack (or radio) to connect through inside a browser tab, so this is a sensible simplification, not a bug — but it means Wi-Fi projects can only be meaningfully tested on real, uploaded hardware, not through the Simulate button.

  • Board gating is real: on a board with no wireless chip (e.g. Arduino Uno/Nano), import network genuinely raises ImportError in the simulator, matching what real MicroPython firmware for that board would do — the Wi-Fi extension's blocks simply aren't available for those boards in the toolbox at all.
Wi-Fi (Client & Access Point Mode) — OMS Parts