arduino-esp32 icon indicating copy to clipboard operation
arduino-esp32 copied to clipboard

Can't set TX Power more than 15dBm

Open enjoyneering opened this issue 1 year ago • 2 comments

Board

ESP32 Dev Module

Device Description

plain module

Hardware Configuration

plain module

Version

latest master (checkout manually)

IDE Name

Arduino IDE

Operating System

Windows 10

Flash frequency

80MHz

PSRAM enabled

no

Upload speed

115200

Description

Can't set TX Power more than 15dBm. Arduino-esp32 v3.0.2

Sketch

WiFi.setTxPower(WIFI_POWER_17dBm);

WiFi.getTxPower(); //returns value not included in enun wifi_power_t


WiFi.setTxPower(WIFI_POWER_15dBm);

WiFi.getTxPower(); //returns WIFI_POWER_15dBm=60

Debug Message

n/a

Other Steps to Reproduce

No response

I have checked existing issues, online documentation and the Troubleshooting Guide

  • [X] I confirm I have checked existing issues, online documentation and Troubleshooting guide.

enjoyneering avatar Jun 28 '24 23:06 enjoyneering

Looks like the mappings have changed. The enum needs to be fixed.

Mapping Table {Power, max_tx_power} = {{8, 2}, {20, 5}, {28, 7}, {34, 8}, {44, 11}, {52, 13}, {56, 14}, {60, 15}, {66, 16}, {72, 18}, {80, 20}}

lbernstone avatar Jun 29 '24 02:06 lbernstone

Also keep in mind that there is also a limit per WiFi mode. Typically 802.11b has the highest TX power. So I wonder if you can actually set the TX power at such higher TX-power when connected using 802.11n (or 802.11ax on the ESP32C6)

TD-er avatar Jun 30 '24 19:06 TD-er

Hello @enjoyneering, is this issue still valid or comments above helped?

VojtechBartoska avatar Jul 08 '24 11:07 VojtechBartoska

Hi VojtechBartoska,

I haven't tried "esp_wifi_set_max_tx_power()". But transmit power more than 15dBm doesn't work in 3.0.2.

enjoyneering avatar Jul 08 '24 17:07 enjoyneering

And what WiFi mode are you using? 802.11n? 802.11g? 802.11b? Like I mentioned before, each mode has its own max. TX power and for 802.11n this is roughly 14 - 15 dBm.

TD-er avatar Jul 08 '24 20:07 TD-er

Hi TD-er

This is exactly what I use 802.11n. I'm not complaining, there's just no information about this in the help. Is it possible to add a small note to the documentation?

enjoyneering avatar Jul 08 '24 23:07 enjoyneering

Thh the ESP-IDF docs also do not mention this where one might expect it: https://docs.espressif.com/projects/esp-idf/en/latest/esp32/api-reference/network/esp_wifi.html#_CPPv425esp_wifi_set_max_tx_power6int8_t

Even the datasheet is a bit unclear about this: https://www.espressif.com/sites/default/files/documentation/esp32_datasheet_en.pdf Page 47 at the bottom does mention values I've also seen elsewhere when reading specs of the various ESP32's. Also the table on page 48/49 does mention more plausible values. However Page 32 at the top of the page mentions +18 dBm for 802.11n, which isn't correct as far as I know. (maybe allowed by some country regulations?)

N.B. since the function to set the TX power does this in steps, you may need to also call the get function to see what actually has been set.

TD-er avatar Jul 09 '24 07:07 TD-er

OK. Thank you.

enjoyneering avatar Jul 09 '24 10:07 enjoyneering