Log the TX power the old C firmware gets, and retitle the beacon notes

main.c (the pre-port firmware, kept on disk but no longer compiled) reads
back and logs the TX power the driver actually set instead of trusting
the request. obu-cam-transmistter/NOTES.md drops its stale "Phase 2, in
progress" title.
This commit is contained in:
Ashin Walpola
2026-10-28 16:49:08 +01:00
parent 8cbe3c337c
commit 6dce3977d7
2 changed files with 17 additions and 3 deletions
+16 -2
View File
@@ -360,8 +360,22 @@ void app_main(void)
ESP_LOGW(TAG, "esp_wifi_set_country(MANUAL) failed: %d (continuing)", ctry_err);
}
// Ensure the PA runs at full configured power (not a reduced regulatory
// default). Units are 0.25 dBm; 80 = 20 dBm.
esp_wifi_set_max_tx_power(80);
// default). Units are 0.25 dBm; 80 = 20 dBm, which is also the build's own
// ceiling (CONFIG_ESP_PHY_MAX_TX_POWER=20).
//
// Read back and logged, because the request is a ceiling and not a promise: the driver clamps
// it to its own calibrated power table, and our 5900 MHz is above the frequency range this
// chip is rated for (see docs/04-transmit-setup.md), so the table in use there is the one for
// channel 177. What the request alone tells you about radiated power is therefore nothing;
// this at least records what the driver admits to.
esp_err_t pw_err = esp_wifi_set_max_tx_power(80);
int8_t tx_power_q = 0;
if (pw_err != ESP_OK || esp_wifi_get_max_tx_power(&tx_power_q) != ESP_OK) {
ESP_LOGW(TAG, "tx power: set/read back failed (set returned %d), level unknown", pw_err);
} else {
ESP_LOGI(TAG, "tx power: %d quarter-dBm = %d.%02d dBm (20.00 requested)",
tx_power_q, tx_power_q / 4, (tx_power_q % 4) * 25);
}
// -------------------------------------------------------------------------
// Force the dual-band C5 onto its 5 GHz PHY. This MUST be called after