         if (numPatterns >= MAX_NUM_PATTERNS) break;
       }
     } else {
-      Serial.println("JSON contains no pattern data");
+      Serial.println(F("JSON contains no pattern data"));
+      return false;
     }
   } else {
-    Serial.println("Could not parse JSON payload");
-  }
+    Serial.println(F("Could not parse JSON payload"));
+    return false;
+  }
+  return true;
 }
 #endif
 
 #if ARDUINOJSON_VERSION_MAJOR == 6
 //#pragma message("Compiling for ArduinoJson v6")
-void json2patterns(const char* json) {
-  DynamicJsonDocument doc;
+bool json2patterns(const char* json) {
+  DynamicJsonDocument doc(2000);
   DeserializationError error = deserializeJson(doc, json);
   if (!error) {
     JsonObject deviceJson = doc.as<JsonObject>();

        if (numPatterns >= MAX_NUM_PATTERNS)  break;
      }
    } else {
      Serial.println("JSON contains no pattern data");
    }
  } else {
    Serial.println("Could not parse JSON payload");
  }
}
#endif

#include <EEPROM.h>
#include <ArduinoOTA.h>

#define VERSION "2.0.8"

uint8_t  dataPin = D1; // default digital pin used to drive the LED strip
uint16_t numLeds = 30; // default number of LEDs on the strip
