Add WiFi TX power configuration option for MQTT. Update MQTTBridge to use build flag for TX power, defaulting to 11dBm. Document available power levels in MQTT_IMPLEMENTATION.md and update platformio.ini with example usage.
This commit is contained in:
1 parent
0b7c088899
commit
b82d7e43d1
3 files changed
+17
-2
No files matched your search
@@ -199,9 +199,14 @@ void MQTTBridge::begin() {
|
||||
MQTT_DEBUG_PRINTLN("Failed to enable WiFi power save mode: %d", ps_result);
|
||||
}
|
||||
|
||||
// Set WiFi TX power to reasonable level for MQTT connectivity
|
||||
// Set WiFi TX power - use build flag if defined, otherwise default to 11dBm
|
||||
#ifdef MQTT_WIFI_TX_POWER
|
||||
WiFi.setTxPower(MQTT_WIFI_TX_POWER);
|
||||
MQTT_DEBUG_PRINTLN("WiFi TX power set via build flag (MQTT_WIFI_TX_POWER)");
|
||||
#else
|
||||
WiFi.setTxPower(WIFI_POWER_11dBm);
|
||||
MQTT_DEBUG_PRINTLN("WiFi TX power set to 11dBm");
|
||||
MQTT_DEBUG_PRINTLN("WiFi TX power set to 11dBm (default)");
|
||||
#endif
|
||||
#endif
|
||||
|
||||
// Sync time with NTP
|
||||
|
||||
Reference in new issue
Block a user