Wi-Fi soft-AP and TX power limits
How many stations an ESP32 soft-AP accepts, what WiFi.softAP() sets when you pass nothing, how long the SSID and password may be, and what the numbers in setTxPower() mean. Values from the ESP-IDF v5.5.5 headers, Kconfig and Wi-Fi guide and the arduino-esp32 3.3.12 WiFi library.
In short
- A soft-AP accepts up to 15 stations (ESP32-C2: 4).
WiFi.softAP()asks for 4 unless you passmax_connection.1 - Soft-AP stations and encrypted ESP-NOW peers share the encryption hardware keys (17; ESP32-C2: 4). The limit depends on the build setting
CONFIG_ESP_WIFI_ESPNOW_MAX_ENCRYPT_NUM, not on how many peers are in use: above 2 the soft-AP allows 17 minus that setting (10 with the default 7); on ESP32-C2 it allows 4 minus the setting (2 with its default 2).2 - SSID: 32 bytes. Password field: 64 bytes;
WiFi.softAP()rejects a password of 1…7 characters, and an empty one makes an open network.3 - TX power is set in units of 0.25 dBm:
esp_wifi_set_max_tx_power()takes 8…84, documented as 2…20 dBm, and rounds the value down to a fixed step. WIFI_POWER_19_5dBm is 78, which becomes 72.4
Soft-AP and credentials
| Limit | Value | Notes |
|---|---|---|
| Stations on a soft-AP | 15 (ESP32-C2: 4) | ESP_WIFI_MAX_CONN_NUM12 |
| Stations with encrypted ESP-NOW peers | 17 − N if N > 2 (ESP32-C2: 4 − N if N > 0) | N = CONFIG_ESP_WIFI_ESPNOW_MAX_ENCRYPT_NUM, a build setting, not the number of peers in use. ESP-IDF default 7 → 10; ESP32-C2 default 2 → 2. From the ESP32-S3 and ESP32-C2 Wi-Fi guides.2 |
| SSID | 32 bytes | Zero-terminated unless ssid_len is set; ssid_len above 32 is cut to 32.3 |
| Password field | 64 bytes | wifi_ap_config_t and wifi_sta_config_t; ignored with WIFI_AUTH_OPEN.3 |
Password, WiFi.softAP() | empty or ≥ 8 characters | 1…7 characters: returns false and logs "passphrase too short!".5 |
| Hidden SSID | ssid_hidden = 1 | Default 0: the SSID is broadcast.32 |
| Beacon interval | 100…60000 TU | Default 100. WiFi.softAP() sets 100.3 |
| Channels, default country | 1…11 | ESP-IDF default country info: cc "01", schan 1, nchan 11.2 |
WiFi.softAP() defaults (arduino-esp32 3.3.12)
TX power
Units and range
esp_wifi_set_max_tx_power() takes the power in 0.25 dBm units, range 8…84, documented as 2…20 dBm. It can only be called after the Wi-Fi is started; an out-of-range value returns ESP_ERR_INVALID_ARG.4
The set value is rounded down to a step
esp_wifi.h lists which actual value each range of set values gives, for example 72…79 → 72 and 80…84 → 80.4
WiFi.setTxPower() passes the value through
In arduino-esp32 3.3.12 setTxPower() returns false if neither STA nor AP is started, otherwise it calls esp_wifi_set_max_tx_power() with the enum value. getTxPower() returns WIFI_POWER_19_5dBm when Wi-Fi is not started or the call fails.7
Arduino wifi_power_t values
| Enum | Value (0.25 dBm) | Comment in WiFiGeneric.h | Notes (esp_wifi.h v5.5.5) |
|---|---|---|---|
| WIFI_POWER_21dBm | 84 | 21 dBm | Rounded down to 80.8 |
| WIFI_POWER_20_5dBm | 82 | 20.5 dBm | Rounded down to 80.8 |
| WIFI_POWER_20dBm | 80 | 20 dBm | A step: used as is.8 |
| WIFI_POWER_19_5dBm | 78 | 19.5 dBm | Rounded down to 72.8 |
| WIFI_POWER_19dBm | 76 | 19 dBm | Rounded down to 72.8 |
| WIFI_POWER_18_5dBm | 74 | 18.5 dBm | Rounded down to 72.8 |
| WIFI_POWER_17dBm | 68 | 17 dBm | Rounded down to 66.8 |
| WIFI_POWER_15dBm | 60 | 15 dBm | A step: used as is.8 |
| WIFI_POWER_13dBm | 52 | 13 dBm | A step: used as is.8 |
| WIFI_POWER_11dBm | 44 | 11 dBm | A step: used as is.8 |
| WIFI_POWER_8_5dBm | 34 | 8.5 dBm | A step: used as is.8 |
| WIFI_POWER_7dBm | 28 | 7 dBm | A step: used as is.8 |
| WIFI_POWER_5dBm | 20 | 5 dBm | A step: used as is.8 |
| WIFI_POWER_2dBm | 8 | 2 dBm | A step: used as is.8 |
| WIFI_POWER_MINUS_1dBm | -4 | −1 dBm | Outside the 8…84 range documented in esp_wifi.h.8 |
esp_wifi.h (v5.5.5) documents 8…84 as 2…20 dBm and rounds a set value down to one of 8, 20, 28, 34, 44, 52, 56, 60, 66, 72, 80. So 68 becomes 66; 74, 76 and 78 become 72; 82 and 84 become 80; −4 is outside the range. For these seven names the value the driver uses does not match the name. This page does not state the radiated output power.
Pitfalls
Soft-AP follows the station's channel
The radio has one channel. In station + soft-AP mode the soft-AP moves to the channel of the router the station connects to, and its clients have to follow.4
Wi-Fi config is stored in NVS by default
With the default storage type WIFI_STORAGE_FLASH, esp_wifi_set_config() stores the station and soft-AP configuration in NVS. In arduino-esp32 3.3.12 persistent is true by default; WiFi.persistent(false) before Wi-Fi is first started makes the library switch to WIFI_STORAGE_RAM.4
Where the sources disagree
- wifi_power_t values above 80 and below 8. arduino-esp32 3.3.12 WiFiGeneric.h names its wifi_power_t values in dBm (e.g. 84 as 21 dBm, 78 as 19.5 dBm, −4 as −1 dBm). ESP-IDF v5.5.5 esp_wifi.h documents 8…84 as 2…20 dBm and rounds set values down to fixed steps: 68 → 66, 74/76/78 → 72, 82/84 → 80, and −4 is out of range. The page lists the enum names and values as written, gives the step for each, and does not state the resulting output power.88844
See also
- Lost your ESP32? You just gave away your Wi-Fi password
- ESP-NOW limits
- BLE limits
- NVS and Preferences limits
- Arduino API pitfalls on ESP32
Sources
Each number links here; open “What it confirms” for the exact quotes. Checked 2026-11-28.
- ESP-IDF v5.5.5: components/esp_wifi/include/local/esp_wifi_types_native.h primary
What it confirms (2)
- Wi-Fi soft-AP and TX power limits: in short “#define ESP_WIFI_MAX_CONN_NUM (4) /**< max number of stations which can connect to ESP32C2 soft-AP */ … #define ESP_WIFI_MAX_CONN_NUM (15) … int channel = 1, int ssid_hidden = 0, int max_connection = 4”
- Wi-Fi soft-AP and TX power limits: Stations on a soft-AP “#if CONFIG_IDF_TARGET_ESP32C2 … #define ESP_WIFI_MAX_CONN_NUM (4) /**< max number of stations which can connect to ESP32C2 soft-AP */ … #define ESP_WIFI_MAX_CONN_NUM (15)”
- ESP-IDF v5.5.5 docs (ESP32-S3): wifi primary
What it confirms (6)
- Wi-Fi soft-AP and TX power limits: in short “The total number of encryption hardware keys is 17, if CONFIG_ESP_WIFI_ESPNOW_MAX_ENCRYPT_NUM <= 2, the max_connection can be set up to 15, otherwise the max_connection can be set up to (17 - CONFIG_ESP_WIFI_ESPNOW_MAX_ENCRYPT_NUM). … The total number of encryption hardware keys is 4, if CONFIG_ESP_WIFI_ESPNOW_MAX_ENCRYPT_NUM <= 0, the max_connection can be set up to 4, otherwise the max_connection can be set up to (4 - CONFIG_ESP_WIFI_ESPNOW_MAX_ENCRYPT_NUM). … default 7 if (!IDF_TARGET_ESP32C2) … default 2 if IDF_TARGET_ESP32C2”
- Wi-Fi soft-AP and TX power limits: Stations on a soft-AP “ESP32-S3 supports up to 15 (ESP_WIFI_MAX_CONN_NUM) Wi-Fi connections.”
- Wi-Fi soft-AP and TX power limits: Stations with encrypted ESP-NOW peers “The total number of encryption hardware keys is 17, if CONFIG_ESP_WIFI_ESPNOW_MAX_ENCRYPT_NUM <= 2, the max_connection can be set up to 15, otherwise the max_connection can be set up to (17 - CONFIG_ESP_WIFI_ESPNOW_MAX_ENCRYPT_NUM). … The total number of encryption hardware keys is 4, if CONFIG_ESP_WIFI_ESPNOW_MAX_ENCRYPT_NUM <= 0, the max_connection can be set up to 4, otherwise the max_connection can be set up to (4 - CONFIG_ESP_WIFI_ESPNOW_MAX_ENCRYPT_NUM). … default 7 if (!IDF_TARGET_ESP32C2) … default 2 if IDF_TARGET_ESP32C2”
- Wi-Fi soft-AP and TX power limits: Hidden SSID “If ssid_hidden is 1, AP does not broadcast the SSID; otherwise, it does broadcast the SSID.”
- Wi-Fi soft-AP and TX power limits: Channels, default country “The default country info is: wifi_country_t config = { .cc = "01", .schan = 1, .nchan = 11,”
- Wi-Fi soft-AP and TX power limits: pitfall: Hidden SSID and passive scan channels “Use active scan from 1 to 11 and use passive scan from 12 to 14. … if an AP with hidden SSID and station is set to a passive scan channel, the passive scan will not find it.”
- ESP-IDF v5.5.5: components/esp_wifi/include/esp_wifi_types_generic.h primary
What it confirms (5)
- Wi-Fi soft-AP and TX power limits: in short “uint8_t ssid[32]; /**< SSID of soft-AP. … uint8_t password[64]; /**< Password of soft-AP. */ … if (passphrase && (strlen(passphrase) > 0 && strlen(passphrase) < 8)) { … if (passphrase != NULL && passphrase[0] != 0) { … memset(&conf, 0, sizeof(wifi_config_t)); … WIFI_AUTH_OPEN = 0,”
- Wi-Fi soft-AP and TX power limits: SSID “uint8_t ssid[32]; /**< SSID of soft-AP. If ssid_len field is 0, this must be a Null terminated string. Otherwise, length is set according to ssid_len. */ … If ssid_len > 32, change it to 32”
- Wi-Fi soft-AP and TX power limits: Password field “uint8_t password[64]; /**< Password of soft-AP. */ … uint8_t password[64]; /**< Password of target AP. */ … Password of AP; if the auth mode is WIFI_AUTH_OPEN, this field will be ignored.”
- Wi-Fi soft-AP and TX power limits: Hidden SSID “uint8_t ssid_hidden; /**< Broadcast SSID or not, default 0, broadcast the SSID */”
- Wi-Fi soft-AP and TX power limits: Beacon interval “Range: 100 ~ 60000. Default value: 100 */ … conf.ap.beacon_interval = 100;”
- ESP-IDF v5.5.5: components/esp_wifi/include/esp_wifi.h primary
What it confirms (7)
- Wi-Fi soft-AP and TX power limits: in short “Param power unit is 0.25dBm, range is [8, 84] corresponding to 2dBm - 20dBm. … {set value range, actual value} = {{[8, 19],8}, {[20, 27],20}, {[28, 33],28}, {[34, 43],34}, {[44, 51],44}, {[52, 55],52}, {[56, 59],56}, {[60, 65],60}, {[66, 71],66}, {[72, 79],72}, {[80, 84],80}}. … WIFI_POWER_19_5dBm = 78, // 19.5dBm”
- Wi-Fi soft-AP and TX power limits: Units and range “Param power unit is 0.25dBm, range is [8, 84] corresponding to 2dBm - 20dBm. … ESP_ERR_WIFI_NOT_STARTED: WiFi is not started by esp_wifi_start … ESP_ERR_INVALID_ARG: invalid argument, e.g. parameter is out of range”
- Wi-Fi soft-AP and TX power limits: The set value is rounded down to a step “{set value range, actual value} = {{[8, 19],8}, {[20, 27],20}, {[28, 33],28}, {[34, 43],34}, {[44, 51],44}, {[52, 55],52}, {[56, 59],56}, {[60, 65],60}, {[66, 71],66}, {[72, 79],72}, {[80, 84],80}}.”
- Wi-Fi soft-AP and TX power limits: pitfall: Soft-AP follows the station's channel “ESP devices are limited to only one channel, so when in the soft-AP+station mode, the soft-AP will adjust its channel automatically to be the same as … In station/AP-coexistence mode, the home channel of AP and station must be the same”
- Wi-Fi soft-AP and TX power limits: pitfall: Wi-Fi config is stored in NVS by default “The configuration will be stored in NVS for station and soft-AP … The default value is WIFI_STORAGE_FLASH … bool WiFiGenericClass::_persistent = true; … if (!wifiLowLevelInit(_persistent)) { … if (!lowLevelInitDone) { … lowLevelInitDone = esp_wifi_set_storage(WIFI_STORAGE_RAM) == ESP_OK;”
- Wi-Fi soft-AP and TX power limits: discrepancy (wifi_power_t values above 80 and below 8) “Param power unit is 0.25dBm, range is [8, 84] corresponding to 2dBm - 20dBm.”
- Wi-Fi soft-AP and TX power limits: discrepancy (wifi_power_t values above 80 and below 8) “{set value range, actual value} = {{[8, 19],8}, {[20, 27],20}, {[28, 33],28}, {[34, 43],34}, {[44, 51],44}, {[52, 55],52}, {[56, 59],56}, {[60, 65],60}, {[66, 71],66}, {[72, 79],72}, {[80, 84],80}}.”
- arduino-esp32 3.3.12: libraries/WiFi/src/AP.cpp primary
What it confirms (1)
- Wi-Fi soft-AP and TX power limits: Password, WiFi.softAP() “if (passphrase && (strlen(passphrase) > 0 && strlen(passphrase) < 8)) { … log_e("passphrase too short!"); … return false;”
- arduino-esp32 3.3.12: libraries/WiFi/src/WiFiAP.h primary
What it confirms (5)
- Wi-Fi soft-AP and TX power limits: channel “const char *ssid, const char *passphrase = NULL, int channel = 1, int ssid_hidden = 0, int max_connection = 4, bool ftm_responder = false,”
- Wi-Fi soft-AP and TX power limits: ssid_hidden “int ssid_hidden = 0”
- Wi-Fi soft-AP and TX power limits: max_connection “int max_connection = 4”
- Wi-Fi soft-AP and TX power limits: auth_mode “#define WIFI_AP_DEFAULT_AUTH_MODE WIFI_AUTH_WPA2_PSK … conf.ap.authmode = auth_mode;”
- Wi-Fi soft-AP and TX power limits: cipher “#define WIFI_AP_DEFAULT_CIPHER WIFI_CIPHER_TYPE_CCMP // Disable by default enabled insecure TKIP and use just CCMP.”
- arduino-esp32 3.3.12: libraries/WiFi/src/WiFiGeneric.cpp primary
What it confirms (1)
- Wi-Fi soft-AP and TX power limits: WiFi.setTxPower() passes the value through “log_w("Neither AP or STA has been started"); … esp_err_t err = esp_wifi_set_max_tx_power(power); … return WIFI_POWER_19_5dBm;”
- arduino-esp32 3.3.12: libraries/WiFi/src/WiFiGeneric.h primary
What it confirms (18)
- Wi-Fi soft-AP and TX power limits: WIFI_POWER_21dBm “WIFI_POWER_21dBm = 84, // 21dBm … {set value range, actual value} = {{[8, 19],8}, {[20, 27],20}, {[28, 33],28}, {[34, 43],34}, {[44, 51],44}, {[52, 55],52}, {[56, 59],56}, {[60, 65],60}, {[66, 71],66}, {[72, 79],72}, {[80, 84],80}}.”
- Wi-Fi soft-AP and TX power limits: WIFI_POWER_20_5dBm “WIFI_POWER_20_5dBm = 82, // 20.5dBm … {set value range, actual value} = {{[8, 19],8}, {[20, 27],20}, {[28, 33],28}, {[34, 43],34}, {[44, 51],44}, {[52, 55],52}, {[56, 59],56}, {[60, 65],60}, {[66, 71],66}, {[72, 79],72}, {[80, 84],80}}.”
- Wi-Fi soft-AP and TX power limits: WIFI_POWER_20dBm “WIFI_POWER_20dBm = 80, // 20dBm … {set value range, actual value} = {{[8, 19],8}, {[20, 27],20}, {[28, 33],28}, {[34, 43],34}, {[44, 51],44}, {[52, 55],52}, {[56, 59],56}, {[60, 65],60}, {[66, 71],66}, {[72, 79],72}, {[80, 84],80}}.”
- Wi-Fi soft-AP and TX power limits: WIFI_POWER_19_5dBm “WIFI_POWER_19_5dBm = 78, // 19.5dBm … {set value range, actual value} = {{[8, 19],8}, {[20, 27],20}, {[28, 33],28}, {[34, 43],34}, {[44, 51],44}, {[52, 55],52}, {[56, 59],56}, {[60, 65],60}, {[66, 71],66}, {[72, 79],72}, {[80, 84],80}}.”
- Wi-Fi soft-AP and TX power limits: WIFI_POWER_19dBm “WIFI_POWER_19dBm = 76, // 19dBm … {set value range, actual value} = {{[8, 19],8}, {[20, 27],20}, {[28, 33],28}, {[34, 43],34}, {[44, 51],44}, {[52, 55],52}, {[56, 59],56}, {[60, 65],60}, {[66, 71],66}, {[72, 79],72}, {[80, 84],80}}.”
- Wi-Fi soft-AP and TX power limits: WIFI_POWER_18_5dBm “WIFI_POWER_18_5dBm = 74, // 18.5dBm … {set value range, actual value} = {{[8, 19],8}, {[20, 27],20}, {[28, 33],28}, {[34, 43],34}, {[44, 51],44}, {[52, 55],52}, {[56, 59],56}, {[60, 65],60}, {[66, 71],66}, {[72, 79],72}, {[80, 84],80}}.”
- Wi-Fi soft-AP and TX power limits: WIFI_POWER_17dBm “WIFI_POWER_17dBm = 68, // 17dBm … {set value range, actual value} = {{[8, 19],8}, {[20, 27],20}, {[28, 33],28}, {[34, 43],34}, {[44, 51],44}, {[52, 55],52}, {[56, 59],56}, {[60, 65],60}, {[66, 71],66}, {[72, 79],72}, {[80, 84],80}}.”
- Wi-Fi soft-AP and TX power limits: WIFI_POWER_15dBm “WIFI_POWER_15dBm = 60, // 15dBm … {set value range, actual value} = {{[8, 19],8}, {[20, 27],20}, {[28, 33],28}, {[34, 43],34}, {[44, 51],44}, {[52, 55],52}, {[56, 59],56}, {[60, 65],60}, {[66, 71],66}, {[72, 79],72}, {[80, 84],80}}.”
- Wi-Fi soft-AP and TX power limits: WIFI_POWER_13dBm “WIFI_POWER_13dBm = 52, // 13dBm … {set value range, actual value} = {{[8, 19],8}, {[20, 27],20}, {[28, 33],28}, {[34, 43],34}, {[44, 51],44}, {[52, 55],52}, {[56, 59],56}, {[60, 65],60}, {[66, 71],66}, {[72, 79],72}, {[80, 84],80}}.”
- Wi-Fi soft-AP and TX power limits: WIFI_POWER_11dBm “WIFI_POWER_11dBm = 44, // 11dBm … {set value range, actual value} = {{[8, 19],8}, {[20, 27],20}, {[28, 33],28}, {[34, 43],34}, {[44, 51],44}, {[52, 55],52}, {[56, 59],56}, {[60, 65],60}, {[66, 71],66}, {[72, 79],72}, {[80, 84],80}}.”
- Wi-Fi soft-AP and TX power limits: WIFI_POWER_8_5dBm “WIFI_POWER_8_5dBm = 34, // 8.5dBm … {set value range, actual value} = {{[8, 19],8}, {[20, 27],20}, {[28, 33],28}, {[34, 43],34}, {[44, 51],44}, {[52, 55],52}, {[56, 59],56}, {[60, 65],60}, {[66, 71],66}, {[72, 79],72}, {[80, 84],80}}.”
- Wi-Fi soft-AP and TX power limits: WIFI_POWER_7dBm “WIFI_POWER_7dBm = 28, // 7dBm … {set value range, actual value} = {{[8, 19],8}, {[20, 27],20}, {[28, 33],28}, {[34, 43],34}, {[44, 51],44}, {[52, 55],52}, {[56, 59],56}, {[60, 65],60}, {[66, 71],66}, {[72, 79],72}, {[80, 84],80}}.”
- Wi-Fi soft-AP and TX power limits: WIFI_POWER_5dBm “WIFI_POWER_5dBm = 20, // 5dBm … {set value range, actual value} = {{[8, 19],8}, {[20, 27],20}, {[28, 33],28}, {[34, 43],34}, {[44, 51],44}, {[52, 55],52}, {[56, 59],56}, {[60, 65],60}, {[66, 71],66}, {[72, 79],72}, {[80, 84],80}}.”
- Wi-Fi soft-AP and TX power limits: WIFI_POWER_2dBm “WIFI_POWER_2dBm = 8, // 2dBm … {set value range, actual value} = {{[8, 19],8}, {[20, 27],20}, {[28, 33],28}, {[34, 43],34}, {[44, 51],44}, {[52, 55],52}, {[56, 59],56}, {[60, 65],60}, {[66, 71],66}, {[72, 79],72}, {[80, 84],80}}.”
- Wi-Fi soft-AP and TX power limits: WIFI_POWER_MINUS_1dBm “WIFI_POWER_MINUS_1dBm = -4 // -1dBm … Param power unit is 0.25dBm, range is [8, 84] corresponding to 2dBm - 20dBm.”
- Wi-Fi soft-AP and TX power limits: discrepancy (wifi_power_t values above 80 and below 8) “WIFI_POWER_21dBm = 84, // 21dBm”
- Wi-Fi soft-AP and TX power limits: discrepancy (wifi_power_t values above 80 and below 8) “WIFI_POWER_19_5dBm = 78, // 19.5dBm”
- Wi-Fi soft-AP and TX power limits: discrepancy (wifi_power_t values above 80 and below 8) “WIFI_POWER_MINUS_1dBm = -4 // -1dBm”