 /*
+ * on bootup attempt to read configuration from SPIFFS and connect
+ * 
  * When config button is pressed start accesspoint and interact with user to provide the 
  * required access point  credentials and other parameters
+ * save configuration to SPIFFS
  * Connect to the required access point and stop the server
  * 
  * In normal mode, collect data and send to the data store
  * 
- *
- * configuration needs to set the configuration in non-volatile store
- *  * 
  */
  
 #include <ESP8266WiFi.h>
 #include <WiFiClient.h> 
+#include <FS.h>
 
 //temporary access point credentials
 

  ssid = getParam(req,"ssid");
  if (ssid != "") {
      password = getParam(req,"password");
      stream_id = getParam(req,"stream-id");
      stream_pk = getParam(req,"stream-pk");
      String doConnect = getParam(req,"connect");
      
      if (doConnect =="Yes" && ssid != "")  {
      wifi_connected = connectWifi();
      if (wifi_connected) {
          response = String("<h1>Connecting to access point Bye Bye</h1>");
  

   response += "<form action='?'><table>";
   response += "<tr><td>SSID</td><td><input type='text' name='ssid' value='" + ssid +"'/></td></tr>";
   response += "<tr><td>PW</td><td><input type='text' name='password' value='" + password + "'/></td></tr>";
   response += "<tr><td>stream id</td><td><input type='text' name='stream_id' value='" + stream_id + "'/></td></tr>";
   response += "<tr><td>stream pk</td><td><input type='text' name='stream_pk' value='" + stream_pk + "'/></td></tr>";
   response += "<tr><td>Connect</td><td><select name='connect'><option>No</option><option>Yes</option></select></td></tr>";
   response += "</table>";
   response += "<input type='submit' name='submit' />";
