Skip to content

Add WiFi TX power slider to web UI (8.5–20 dBm)#232

Open
W-Floyd wants to merge 4 commits into
CarlosDerSeher:developfrom
W-Floyd:feat/wifi-tx-power
Open

Add WiFi TX power slider to web UI (8.5–20 dBm)#232
W-Floyd wants to merge 4 commits into
CarlosDerSeher:developfrom
W-Floyd:feat/wifi-tx-power

Conversation

@W-Floyd

@W-Floyd W-Floyd commented Jun 6, 2026

Copy link
Copy Markdown

For some boards the default TX power is too high and can cause self-interference. I find greater stability with a slightly reduced TX power (<18dB) using an ESP32-S3 Supermini.


Adds a WiFi TX power control to the General Settings page. The value is persisted to NVS and applied at both boot time and immediately on change.

The default (raw 80 = 20 dBm) matches ESP-IDF's default behaviour, so existing devices are unaffected until the slider is moved.

W-Floyd and others added 3 commits June 5, 2026 20:36
Adds a slider in the web UI to control WiFi TX power, persisted to NVS
and applied via esp_wifi_set_max_tx_power(). Range is 34–80 (raw units),
mapping to 8.5–20 dBm.

Co-Authored-By: Claude Sonnet 4.6 <noreply@anthropic.com>
…onfig

All TX power logic (NVS save/load, boot-time apply, HTTP handler, web UI
slider) is now compiled out unless SNAPCLIENT_WIFI_TX_POWER_CONTROL=y.
The web UI slider is additionally hidden at runtime when the capability is
absent from the settings JSON, so mixed firmware/UI scenarios are handled.

Co-Authored-By: Claude Sonnet 4.6 <noreply@anthropic.com>
capabilities was a local variable scoped to loadSettings() but
referenced in renderUI(). Introduce a module-level hasTxPowerControl
flag set during load and use it in renderUI() instead.

Co-Authored-By: Claude Sonnet 4.6 <noreply@anthropic.com>
@CarlosDerSeher

Copy link
Copy Markdown
Owner

Could you provide a Screenshot?

@W-Floyd

W-Floyd commented Jun 7, 2026

Copy link
Copy Markdown
Author
image

@CarlosDerSeher

CarlosDerSeher commented Jun 7, 2026

Copy link
Copy Markdown
Owner

This looks OK to me but there is a PR #225 in the pipe and we should probably merge that one first.

@CarlosDerSeher

Copy link
Copy Markdown
Owner

Oh and I l'd prefer to remove the dependency to settings manager here too. Could you add API to control this from main()/http_task() ?

@W-Floyd

W-Floyd commented Jun 7, 2026

Copy link
Copy Markdown
Author

Sure I'll take a look.

Also, I want to think a little more on how to even characterize the improvements this might make other than "it seems to play more reliably for me". I'd rather use boards that didn't even need this 😅

NVS key comment and function parameter names incorrectly said "dBm"
when the stored value is in ESP-IDF quarter-dBm units (0.25 dBm each).

Co-Authored-By: Claude Sonnet 4.6 <noreply@anthropic.com>
@W-Floyd

W-Floyd commented Jun 8, 2026

Copy link
Copy Markdown
Author

Hmm, I've fine-tuned my sdkconfig settings and don't seem to have connectivity issues now. Nevertheless, it is sometimes reported to be helpful. Do with that what you will lol

@luar123

luar123 commented Jun 8, 2026

Copy link
Copy Markdown
Contributor

Hmm, I've fine-tuned my sdkconfig settings and don't seem to have connectivity issues now. Nevertheless, it is sometimes reported to be helpful. Do with that what you will lol

If you found some good improvements please share them, maybe in #222

@W-Floyd

W-Floyd commented Jun 8, 2026

Copy link
Copy Markdown
Author

If I get the time I'll try seeing which of these made the difference, but my sdkconfig overlay is here. So sdkconfig.defaults -> sdkconfig.defaults.esp32s3 -> Mine

@anabolyc

Copy link
Copy Markdown
Contributor

I'll test these changes on the S3 board I have. The key difference I see is that you use octal mode for PSRAM, and a few memory optimisations related to that. I think for 8MB PSRAM boards, this is totally valid, but 2MB boards should stay with quad. @CarlosDerSeher @luar123 do you think the defaults for esp32s3 should assume safe quad mode? Should octal mode then become an override in board-specific config (assuming that will improve performance)?

@W-Floyd

W-Floyd commented Jun 11, 2026

Copy link
Copy Markdown
Author

I am using quad, upstream uses octal

@anabolyc

Copy link
Copy Markdown
Contributor

I am using quad, upstream uses octal

Ah, you're right, it is the other way around. I will search for other changes that can improve s3 builds.

@luar123

luar123 commented Jun 11, 2026

Copy link
Copy Markdown
Contributor

Only 2MB variants uses quad, so I would stay with octal as default as it gives twice the bandwidth.

@W-Floyd

W-Floyd commented Jun 11, 2026

Copy link
Copy Markdown
Author

Yup, I just happen to be using a 2MB variant.

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment

Labels

None yet

Projects

None yet

Development

Successfully merging this pull request may close these issues.

4 participants