Wi-Fi/Finding and joining/Station, access point, or both
Lesson 6 of 13 · in 3D and VR

Station, access point, or both

An ESP32 can join a network as a station, run its own as an access point, or do both on one radio and one channel. Its own network is local, with no way to the internet unless it is told to forward.

Lonely BinaryUpdated 2026-10-095 min readNo board required

View it in VR

Lesson 6 of the Wi-Fi course opens in a VR headset, on a table in front of you, and a voice starts three seconds after you arrive. Type this short address into the browser on a headset such as Meta Quest or Apple Vision Pro, and press Enter VR. No headset? Press Start the lesson: the same lesson, full screen.

learn.lonelybinary.com/vr/wifi/6

Joining a network, or being one

A station joins a network someone else runs. It finds the network, asks to join, and gets its address from that network's DHCP server. A phone on the home router is a station, and so is an ESP32 after WiFi.mode(WIFI_STA) and WiFi.begin().

An access point is the network. It sends the beacons, admits the stations and, on an ESP32, hands out the addresses too. Arduino's WiFi.softAP() starts one on the board's default interface: the board is 192.168.4.1, the mask is 255.255.255.0, and a DHCP server gives each phone that joins an address on that network. Join the board's network, then open 192.168.4.1: the page comes from the board, with no router anywhere.

There are four Arduino modes, WIFI_OFF, WIFI_STA, WIFI_AP and WIFI_AP_STA, and they are ESP-IDF's WIFI_MODE_NULL, _STA, _AP and _APSTA. Arduino lets four clients in unless you ask for more; recent ESP-IDF allows up to 15, fewer with encrypted ESP-NOW peers, so check your version. The code is in access point mode.

A network is not a route

The board's network is an island. A phone on it reaches the board and anything else on that network, and nothing beyond, and the phone may complain that the network has no internet: that is true. Tell it to stay connected, or it may wander off to mobile data in the middle of your setup page.

Forwarding takes three things at once: both modes, the station side connected to a router, and NAPT switched on (WiFi.AP.enableNAPT(true) in Arduino 3.x, esp_netif_napt_enable() in ESP-IDF). Miss one and the phone has an address and nowhere to go.

Both, on one channel

In WIFI_AP_STA the board is a station on the router and an access point for the phone at once. There is one radio, so both sides use one channel, and the router's wins: when the station side joins, the board's access point moves to the router's channel. A phone already on the board may drop and have to join again. The two sides can never sit on different channels. See dual mode.

Not modes

ESP-NOW sends between boards by MAC address, with no access point and no IP address, but both must be on the same channel. Sniffer mode watches frames and joins nothing. Mesh is a layout built on the modes. Handing a board its home network's name and password without writing them into the sketch is provisioning.

Common mistakes

  • Expecting the board's access point to give the phone internet. It does not, unless the board is in both modes, its station side is connected, and NAPT is on.
  • Setting the access point's channel in both modes and expecting it to stay. The router's channel wins, and phones on the board may drop when it moves.
  • Calling ESP-NOW, sniffing or mesh a fourth mode. They use the same radio. ESP-NOW still needs both boards on one channel.

Edit this page — content/fundamentals/wifi/station-access-point-or-both.mdx

Discuss this article

Ask about this page. The answer stays here, on the page it belongs to, for whoever hits the same wall next.

Browse Fundamentals on the forum →