Network - WiFi AP

.

Network details

Type: Network

Name: WiFi AP

Status ESP32: NORMAL

Status ESP8266: NORMAL

GitHub: _NW002_WiFi_AP.cpp

Maintainer: TD-er

Network Settings

Route Priority

(ESP32 only)

When using multiple network interfaces, like WiFi, Ethernet or PPP LTE Modem, it must be made clear which interface should be used for new connections initiated from ESPEasy to some other host.

The connected network interface with the highest Route Priority is considered to be the default route.

Default Route Priority values are:

  • WiFi STA = 100

  • Ethernet = 50

  • PPP (LTE modem) = 20

  • WiFi AP = 10

Fallback Interface

(ESP32 only)

Note

The concept of a Fallback Interface is available on ESP8266, but only for WiFi AP. This is a special case, which is discussed here: Network - WiFi AP .

A network interface can be marked as “Fallback Interface”.

A fallback interface will only be scheduled to start when:

  • A non-fallback interface failed to connect.

  • Route Priority changed to a value which is less than the set priority for the fallback interface.

The scheduled delay to start the fallback interface is set as “Delay Startup” (see below).

A fallback interface will be stopped when there is a default route with a route priority higher than the set Route Priority of the fallback interface.

It is possible to set multiple interfaces as Fallback Interface. The fallback order can be tweaked using the Delay Startup and Route Priority.

N.B. Network interfaces which should be started at boot, should not be marked as Fallback Interface.

Example use cases

  • Disable fallback on the WiFi AP and have it active continuously, allowing other nodes/devices to use the ESP node to act as a router/gateway using “NAPT”.

  • Have WiFi STA set as fallback for Ethernet (or PPP for a LTE modem). When there is no connection via Ethernet (or PPP) you can try using WiFi STA as backup.

  • Have PPP (for connection via LTE) as fallback, so it will only be used if any of the other interfaces failed to get a connection.

  • Have Ethernet set to lowest startup delay, WiFi STA as fallback with longer startup delay and PPP as fallback with the longest startup delay. This way the preferred interface is Ethernet, WiFi the second and as last resort the LTE modem.

Delay Startup

For various reasons, it can be useful to not immediately start a network interface at boot. For example to reduce the power consumption as most network interfaces may draw significant more power for a short time when starting.

Another use case can be to check some sensor value before deciding to either start the network interface or enter deep sleep again.

The set value (in msec) is the delay from boot before starting the network interface.

Delay Startup for Fallback Interface

A Fallback Interface is not started at boot. The set Delay Startup is then used as delay to schedule starting the network interface. See “Fallback Interface” for more information.

Append Name to Hostname

(ESP32 only)

When multiple network interfaces may connect to the same network (e.g. WiFi STA and Ethernet), it can be useful to set different hostnames per network interface.

With this option checked, the network interface name as listed on the “Network” tab overview page will be appended to the hostname as used for that network interface.

For example on an ESPEasy node called “ESPEasy”, the WiFi STA interface will then use “ESPEasy-WiFi” as hostname.

This will be used in for example DHCP requests and when using mDNS.

Default setting is to have it disabled for WiFi STA and enabled for all other network interfaces.

Block Web Access

When checked, the ESPEasy web interface cannot be accessed via the IP-range of the network interface.

Note

The PPP Network Interface (ESP32-only) will have this checked by default, since you typically can’t access devices from the network of the mobile provider. If this is possible for some odd reason, you very likely would never want to allow this.

Enable IPv6

(ESP32 only)

Checking this checkbox, will allow the network device to use IPv6.

Collect Network Stats

(ESP32 only, not included in all builds)

Checking this checkbox, will allow to collect network statistics like:

  • Connected Station Count (AP only)

  • RSSI (WiFi, PPP)

  • TX Power (WiFi STA)

  • BER (Bit Error Rate, only on PPP)

  • TX Bytes

  • RX Bytes

Wifi AP Settings

WPA AP Mode Key

The WPA key to use for the WiFi AP mode.

Default key is configesp

Note

WPA Key must be at least 8 characters long

Wifi AP channel

Suggested channel to use for AP mode.

Note

This will only be used when running in AP-only mode. When running in AP+STA mode, the AP will use the same channel as STA to make sure the ESP will not continously switch between channels for AP and STA.

Enable NAPT

(ESP32-only)

NAPT is like NAT which is known from any consumer internet router.

When checked, the ESP may act as a gateway to another network, when also connected via another network interface.

For example when the ESP is connected via WiFi STA, Ethernet or PPP, any WiFi client device connected via the ESP’s AP can also reach the network via the other connected interface. Like a single ESP board with a PPP modem and AP active. With NAPT checked, the connected WiFi clients can access the internet via the PPP modem.

Note

This will only work when force /setup is not enabled.

Wifi AP Fallback

Force /setup in AP-Mode

This is also known as “Captive Portal” mode, like what can be seen on some “free WiFi” networks where you get redirected to some welcome screen where you may need to agree to terms and conditions first before you can continue.

It does reply to any DNS request with the IP of the ESP’s WiFi AP network interface and redirect the client to the /setup page for WiFi setup.

Note

Since this feature does actively reply to any DNS request with the ESP’s own IP, this cannot be used along with the “NAPT” feature.

Start AP on No Credentials

When checked, the AP interface will be started when there are no WiFi credentials set.

Start AP on Connect Fail

When checked, the AP interface will be started when there the ESP may fail to connect to any configured WiFi access point.

Max. Uptime to Start AP

Limit the window in which the AP is allowed to start. The set value refers to the number of minutes since the ESP booted.

When set to 0, the AP is allowed to start regardless the uptime of the ESP board.

AP Minimal ‘on’ Time

Minimal time in seconds, the AP should remain turned ‘on’, waiting for a user to connect.

Change log

Changed in version 2.0:

added Major overhaul for 2.0 release.

Added in version 1.0:

added Initial release version.