 
   // if not rebooting due to catastrophic error, restore pattern data from eeprom
   struct  rst_info  *rstInfo = system_get_rst_info();
-  Serial.print("rstInfo->reason:"); Serial.println(rstInfo->reason);
+  //Serial.print("rstInfo->reason:"); Serial.println(rstInfo->reason);
   if (rstInfo->reason !=  REASON_EXCEPTION_RST) { // not reason 2
     restoreFromEEPROM();
   }


#if ARDUINOJSON_VERSION_MAJOR == 5
//#pragma message("Compiling for ArduinoJson v5")
bool json2patterns(const char* json) {
  DynamicJsonBuffer jsonBuffer(2000);
  JsonObject& deviceJson = jsonBuffer.parseObject(json);
  if (deviceJson.success()) {


#if ARDUINOJSON_VERSION_MAJOR == 6
//#pragma message("Compiling for ArduinoJson v6")
bool json2patterns(String &json) {
  // in ArduinoJson v6 a DynamicJsonDocument does not expand as needed
  // like it did in ArduinoJson v5. So rather then try to compute the
  // optimum heap size, we'll just allocated a bunch of space on the
  // heap and hope it's enough.
  int freeHeap = ESP.getFreeHeap();
  DynamicJsonDocument doc(freeHeap - 3096); // allocate all of the available heap except 3kB
  DeserializationError error = deserializeJson(doc, json);
  if (!error) {
    JsonObject deviceJson = doc.as<JsonObject>();
