Compare commits

...

3 commits

Author SHA1 Message Date
brentru
c0a404e699 check and enable 2021-11-19 15:14:46 -05:00
brentru
a1c3f10e51 parse deep sleep config 2021-11-19 14:43:26 -05:00
brentru
df2972816d add enable_deepsleep setting into JSON secrets file, conforms to JSON validator 2021-11-19 14:38:15 -05:00
2 changed files with 13 additions and 2 deletions

View file

@ -287,8 +287,15 @@ void Wippersnapper_FS::createConfigFileSkel() {
secretsFile.println("!!! ERROR: undefined board !!!");
#endif
secretsFile.flush();
secretsFile.print(
"HERE\",\n\t\t\"network_password\":\"YOUR_WIFI_PASS_HERE\"\n\t}\n}");
// Optional ESP32 Deep Sleep Mode
#if defined(ARDUINO_MAGTAG29_ESP32S2) || defined(ARDUINO_METRO_ESP32S2) || \
defined(ARDUINO_FUNHOUSE_ESP32S2) || defined(ARDUINO_ADAFRUIT_FEATHER_ESP32S2)
secretsFile.print("HERE\",\n\t\t\"network_password\":\"YOUR_WIFI_PASS_HERE\"\n\t},");
secretsFile.flush();
secretsFile.print("\n\t\"enable_deep_sleep\":false\n}");
#else
secretsFile.print("HERE\",\n\t\t\"network_password\":\"YOUR_WIFI_PASS_HERE\"\n\t}\n}");
#endif
secretsFile.flush();
secretsFile.close();
writeErrorToBootOut(
@ -433,6 +440,9 @@ void Wippersnapper_FS::parseSecrets() {
fsHalt();
}
// Check for deep sleep mode
enable_deep_sleep = doc["enable_deep_sleep"];
// clear the document and release all memory from the memory pool
doc.clear();

View file

@ -61,6 +61,7 @@ public:
const char *io_username =
NULL; /*!< Adafruit IO username, from config json. */
const char *io_key = NULL; /*!< Adafruit IO password, from config json. */
bool enable_deep_sleep = false; /*!< Option to enable ESP32/S2 deep sleep mode, from config json. */
bool setNetwork; /*!< True if a network interface type was set up, False
otherwise. */