mirror of
https://github.com/emsesp/EMS-ESP32.git
synced 2025-12-07 16:29:51 +03:00
lower Wifi tx strength to see if it helps with connectivity
This commit is contained in:
@@ -201,10 +201,6 @@ uint32_t MyESP::_getInitialFreeHeap() {
|
||||
// called when WiFi is connected, and used to start OTA, MQTT
|
||||
void MyESP::_wifiCallback(justwifi_messages_t code, char * parameter) {
|
||||
if (code == MESSAGE_CONNECTED) {
|
||||
#if defined(ESP8266)
|
||||
WiFi.setSleepMode(WIFI_NONE_SLEEP); // added to possibly fix wifi dropouts in arduino core 2.5.0
|
||||
#endif
|
||||
|
||||
_wifi_connected = true;
|
||||
|
||||
jw.enableAPFallback(false); // Disable AP mode after initial connect was successful - test for https://github.com/proddy/EMS-ESP/issues/187
|
||||
@@ -514,10 +510,19 @@ void MyESP::_mqtt_setup() {
|
||||
// WiFI setup
|
||||
void MyESP::_wifi_setup() {
|
||||
jw.setHostname(_general_hostname); // Set WIFI hostname
|
||||
jw.subscribe([this](justwifi_messages_t code, char * parameter) { _wifiCallback(code, parameter); });
|
||||
jw.setConnectTimeout(MYESP_WIFI_CONNECT_TIMEOUT);
|
||||
jw.setReconnectTimeout(MYESP_WIFI_RECONNECT_INTERVAL);
|
||||
|
||||
#if defined(ESP8266)
|
||||
WiFi.setSleepMode(WIFI_NONE_SLEEP); // added to possibly fix wifi dropouts in arduino core 2.5.0
|
||||
// ref: https://github.com/esp8266/Arduino/issues/6471
|
||||
// ref: https://github.com/esp8266/Arduino/issues/6366
|
||||
// high tx power causing weird behavior, slighly lowering from 20.5 to 20.0 may help stability
|
||||
WiFi.setOutputPower(20.0); // in DBM
|
||||
#endif
|
||||
|
||||
jw.subscribe([this](justwifi_messages_t code, char * parameter) { _wifiCallback(code, parameter); });
|
||||
|
||||
/// wmode 1 is AP, 0 is client
|
||||
if (_network_wmode == 1) {
|
||||
jw.enableAP(true);
|
||||
|
||||
Reference in New Issue
Block a user