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:
@@ -1,4 +1,4 @@
|
|||||||
# OBU transmit firmware - Phase 2 (in progress: HLN-SV DENM beacon)
|
# OBU transmit firmware
|
||||||
|
|
||||||
Build and flash steps are under "Build and flash" below. (`docs/04-transmit-setup.md`,
|
Build and flash steps are under "Build and flash" below. (`docs/04-transmit-setup.md`,
|
||||||
referenced here and in the sources, is not in the repo.)
|
referenced here and in the sources, is not in the repo.)
|
||||||
|
|||||||
@@ -360,8 +360,22 @@ void app_main(void)
|
|||||||
ESP_LOGW(TAG, "esp_wifi_set_country(MANUAL) failed: %d (continuing)", ctry_err);
|
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
|
// Ensure the PA runs at full configured power (not a reduced regulatory
|
||||||
// default). Units are 0.25 dBm; 80 = 20 dBm.
|
// default). Units are 0.25 dBm; 80 = 20 dBm, which is also the build's own
|
||||||
esp_wifi_set_max_tx_power(80);
|
// 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
|
// Force the dual-band C5 onto its 5 GHz PHY. This MUST be called after
|
||||||
|
|||||||
Reference in New Issue
Block a user