Fix wifi to allow usage with unsecured networks

pull/808/head
Kevin Hester 2021-05-24 09:21:52 +08:00
rodzic 70b0a73572
commit 069b0d38be
3 zmienionych plików z 16 dodań i 11 usunięć

Wyświetl plik

@ -2,9 +2,11 @@
You probably don't care about this section - skip to the next one.
* investigate TCP on ESP32 https://github.com/meshtastic/Meshtastic-python/issues/90
* fix python tool problem with windows and the heartbeat
* router mode dropping messages? https://meshtastic.discourse.group/t/router-mode-missing-messages/3329/3
* fix ttgo eink screen
* list portduino on platformio
* DONE make native sim not touch hardware
* DONE reenable sim in CI builds
* figure our wss for mqtt.meshtastic - use cloudflare? 2052 ws, 2053 crypt

Wyświetl plik

@ -9,7 +9,7 @@
; https://docs.platformio.org/page/projectconf.html
[platformio]
;default_envs = tbeam
default_envs = tbeam
;default_envs = tbeam0.7
;default_envs = heltec-v2.0
;default_envs = tlora-v1
@ -18,7 +18,7 @@
;default_envs = lora-relay-v1 # nrf board
;default_envs = t-echo
;default_envs = nrf52840dk-geeksville
default_envs = native # lora-relay-v1 # nrf52840dk-geeksville # linux # or if you'd like to change the default to something like lora-relay-v1 put that here
;default_envs = native # lora-relay-v1 # nrf52840dk-geeksville # linux # or if you'd like to change the default to something like lora-relay-v1 put that here
;default_envs = rak4631
;default_envs = rak4630

Wyświetl plik

@ -36,7 +36,6 @@ bool isWifiAvailable()
}
const char *wifiName = radioConfig.preferences.wifi_ssid;
const char *wifiPsw = radioConfig.preferences.wifi_password;
// strcpy(radioConfig.preferences.wifi_ssid, "meshtastic");
// strcpy(radioConfig.preferences.wifi_password, "meshtastic!");
@ -47,7 +46,7 @@ bool isWifiAvailable()
// radioConfig.preferences.wifi_ap_mode = true;
// radioConfig.preferences.wifi_ap_mode = false;
if (*wifiName && *wifiPsw) {
if (*wifiName) {
return 1;
} else {
return 0;
@ -96,7 +95,10 @@ void initWifi(bool forceSoftAP)
const char *wifiName = radioConfig.preferences.wifi_ssid;
const char *wifiPsw = radioConfig.preferences.wifi_password;
if ((*wifiName && *wifiPsw) || forceSoftAP) {
if (!*wifiPsw) // Treat empty password as no password
wifiPsw = NULL;
if (*wifiName || forceSoftAP) {
if (forceSoftAP) {
DEBUG_MSG("Forcing SoftAP\n");
@ -178,8 +180,6 @@ void initWifi(bool forceSoftAP)
DEBUG_MSG("Not using WIFI\n");
}
// Called by the Espressif SDK to
static void WiFiEvent(WiFiEvent_t event)
{
@ -304,12 +304,15 @@ void handleDNSResponse()
void reconnectWiFi()
{
const char *wifiName = radioConfig.preferences.wifi_ssid;
const char *wifiPsw = radioConfig.preferences.wifi_password;
if (radioConfig.has_preferences) {
if (*wifiName && *wifiPsw) {
const char *wifiName = radioConfig.preferences.wifi_ssid;
const char *wifiPsw = radioConfig.preferences.wifi_password;
if (!*wifiPsw) // Treat empty password as no password
wifiPsw = NULL;
if (*wifiName) {
DEBUG_MSG("... Reconnecting to WiFi access point");