Preventing Wi-Fi from disconnecting

This commit is contained in:
2021-03-21 13:14:19 +01:00
parent 2eac93dd03
commit 4ac795dfe7
3 changed files with 23 additions and 19 deletions

View File

@@ -153,7 +153,7 @@ void Frame_FactoryTest::drawPassCount(m5epd_update_mode_t mode) {
void Frame_FactoryTest::scan(String *ssid, int32_t *rssi) { void Frame_FactoryTest::scan(String *ssid, int32_t *rssi) {
WiFi.mode(WIFI_STA); WiFi.mode(WIFI_STA);
WiFi.disconnect(); // WiFi.disconnect();
WiFi.scanNetworks(true); WiFi.scanNetworks(true);
int wifi_num; int wifi_num;

View File

@@ -210,6 +210,7 @@ void Frame_Main::StatusBar(m5epd_update_mode_t mode) {
_bar->drawString("M5Paper", 10, 27); _bar->drawString("M5Paper", 10, 27);
// Wi-Fi // Wi-Fi
if (isWiFiConfiged()) {
const uint8_t *kIMGWifiLevel[4] = { const uint8_t *kIMGWifiLevel[4] = {
NULL, NULL,
ImageResource_item_icon_wifi_1_32x32, ImageResource_item_icon_wifi_1_32x32,
@@ -227,6 +228,9 @@ void Frame_Main::StatusBar(m5epd_update_mode_t mode) {
level = 1; level = 1;
} }
_bar->pushImage(134, 8, 32, 32, kIMGWifiLevel[level]); _bar->pushImage(134, 8, 32, 32, kIMGWifiLevel[level]);
} /* else {
WiFi.begin(GetWifiSSID(), GetWifiPassword())
} */
} }
// Battery // Battery

View File

@@ -127,7 +127,7 @@ int Frame_Settings_Wifi::scan() {
} }
} }
if (connect_wifi_idx == -1) { if (connect_wifi_idx == -1) {
WiFi.disconnect(); // WiFi.disconnect();
_key_wifi[0]->SetEnable(true); _key_wifi[0]->SetEnable(true);
_connected = 0; _connected = 0;
for (int i = 1; i < MAX_BTN_NUM; i++) { for (int i = 1; i < MAX_BTN_NUM; i++) {