SOTAmat / SOTAcat

CAT control for Elecraft KX radios and SOTAMAT
https://sotamat.com
Other
9 stars 2 forks source link

K5EM: reduce WiFi transmit power #16

Closed brianmathews closed 4 months ago

brianmathews commented 4 months ago

Justin K5EM says that the default WiFi power is much higher than required. Lower power reduces WiFi noise into the KX radio, slightly lengthens battery life span.

From Justin:

Note that with the (much) lower wifi power I was still able to maintain a connection over 50ft away through 2 walls. Anything lower than 44 didn't work at all though :shrug: the AP didn't show up.

The default power is 20dBm, reducing to 44 brings it down to around 11dBm, so 9dB output power reduction. The wifi range at full power was longer than I wanted to walk down my street. The other benefit of reducing the power is that it all but eliminates the "wifi buzz and pops" that I hear on the KX3. I heard them at home with no antenna connected, but with my home antenna connected they're in the noise. However they were very noticeable in the field with a real antenna. I suspect they're showing up from the fast current pulses from the WiFi transmissions

Average current draw is ~85mA. Around 100mA with both LEDs on. Peaks over 200mA with the default code (I don't have a fast current probe, but the meter is switching scales at 200mA on wifi TX events). I reduced the TX power from 80 to 44 in my code and it drops the peaks substantially (long term average power only goes down about 2% since the wifi is so short duration on average).

poynting commented 4 months ago
    // 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}}. 
    const uint8_t MAX_TX_PWR = 44; // set to first arg in table above for the desired dBm (second arg)

    // Not required, but we read the starting power just for informative purposes
    int8_t default_wifi_power = 0;
    ESP_ERROR_CHECK(esp_wifi_get_max_tx_power(&default_wifi_power));
    ESP_LOGI(TAG, "Default max tx power: %d", default_wifi_power);

    ESP_LOGI(TAG, "Setting wifi max power to %d", MAX_TX_PWR);
    ESP_ERROR_CHECK(esp_wifi_set_max_tx_power(MAX_TX_PWR));