AEFeinstein / Super-2024-Swadge-FW

Firmware for the Super Magfest 2024 Swadge
https://adam.feinste.in/Super-2024-Swadge-FW/
MIT License
11 stars 9 forks source link

FUTURE: Increase sensitivity and/or power #200

Open cnlohr opened 8 months ago

cnlohr commented 8 months ago

Just a TINY bit, like ONE notch. It's just toooooo restrictive it seems.

This is a note for @cnlohr for the future.

AEFeinstein commented 8 months ago

Do you mean like lighter touches should be registered?

cnlohr commented 8 months ago

No, this is for wifi. Just adjusting the power and IGI muting.

AEFeinstein commented 2 months ago

Will revisit when there are hotdog prototypes

cnlohr commented 2 months ago

As a note for the future, the lines that matter are:

https://github.com/AEFeinstein/Super-2024-Swadge-FW/blob/main/components/hdw-esp-now/hdw-esp-now.c#L315-L318

    // Appears to set gain "offset" like what it reports as gain?  Does not actually impact real gain.
    // But when paired with the second write command, it seems to have the intended impact.
    // This number is in ~1/2dB.  So 20 accounts for a 10dB muting; 25, 12.5dB; 30, 15dB
    const int igi_reduction = 20;

and

https://github.com/AEFeinstein/Super-2024-Swadge-FW/blob/main/components/hdw-esp-now/hdw-esp-now.c#L200

    wifi_country_t usa = {.cc = "USA", .schan = 1, .nchan = 11, .max_tx_power = 84, .policy = WIFI_COUNTRY_POLICY_AUTO};

My current feeling is we should keep IGI reduction the same, but increase power by a smidgen, but we need to understand the units of max_tx_power since I didn't document it, and the official documentation is inscrutable. https://docs.espressif.com/projects/esp-idf/en/stable/esp32/api-reference/network/esp_wifi.html#_CPPv425esp_wifi_set_max_tx_power6int8_t

cnlohr commented 2 months ago

Wait, it looks like we are commanding max power??? I thought we were muting. I wonder if there is muting code elsewhere I am unaware of. Our comments mention wifi_set_user_fixed_rate - perhaps it was a previous version?

AEFeinstein commented 2 months ago

I lost the tread on wifi a while ago, but I did try to turn the power up all the way when doing the initial IDF setup.

cnlohr commented 2 months ago

aaahh https://github.com/AEFeinstein/Super-2024-Swadge-FW/blob/main/sdkconfig#L826-L828

CONFIG_ESP_PHY_MAX_WIFI_TX_POWER=20
CONFIG_ESP_PHY_MAX_TX_POWER=20
CONFIG_ESP_PHY_REDUCE_TX_POWER=y
CONFIG_ESP_PHY_RF_CAL_PARTIAL=y

Ok, we will have to investigate.