things4u / ESP-1ch-Gateway-v5.0--OLD

Version 5 of Single Channel LoRa Gateway
MIT License
311 stars 162 forks source link

save WiFi password #9

Closed mogyoros closed 6 years ago

mogyoros commented 6 years ago

Hi Maarten!

In order to save the WiFi password in _loraFiles.ino, writeGwayCfg() you should use gwayConfig.pass = WiFi.psk(); // XXX We should find a way to store the password too Of course in readConfig() you need to uncomment this part to read back the stored password when booting.

    //if (id == "PASS") {                               // WiFi Password
    //  Serial.print(F("PASS=")); Serial.println(val); 
    //  (*c).pass = val;
    //}

Since I wanted to avoid harcoding WiFi SSIDs and PSKs into the code, i had to figure out how to use the config file variables. With this change there is no further need to add SSIDs and PSKs into the code anymore (if we don't want to connect to multiple SSIDs, which is the case for most people) Cheers, mogyi

platenspeler commented 6 years ago

Thanks, included in latest version of the software.