   setupRFID(rfidss, rfidgain);
   const char * l_hostname = json["hostnm"];
 
-  if (our_hostname != 0)
-    free(our_hostname);
-  our_hostname = (char*) malloc(sizeof(l_hostname));
-  strcpy(our_hostname, l_hostname);
+  autoRestartIntervalSeconds = json["auto_restart_interval_seconds"].as<int>();
+  wifiTimeout = json["disable_wifi_after_seconds"].as<int>();
+
+  if (deviceHostname != 0)
+    free(deviceHostname);
+  deviceHostname = (char*) malloc(sizeof(l_hostname));
+  strcpy(deviceHostname, l_hostname);
 
   const char * bssidmac = json["bssid"];
   byte bssid[6];
   parseBytes(bssidmac, ':', bssid, 6, 16);
 
   // Set Hostname.
-  WiFi.hostname(our_hostname);
+  WiFi.hostname(deviceHostname);
 
   // Start mDNS service so we can connect to http://esp-rfid.local (if Bonjour installed on Windows or Avahi on Linux)
-  if (!MDNS.begin(our_hostname)) {
+  if (!MDNS.begin(deviceHostname)) {
     Serial.println("Error setting up MDNS responder!");
   }
   // Add Web Server service to mDNS

  inAPMode = true;
  WiFi.mode(WIFI_AP);
  Serial.print(F("[ INFO ] Configuring access point... "));
  Serial.println(WiFi.softAP(our_hostname) ? "Ready" : "Failed!");
  // Access Point IP
  IPAddress myIP = WiFi.softAPIP();
  Serial.print(F("[ INFO ] AP IP address: "));

    doEnableWifi = false;
    if (!isWifiConnected)
    {
      wiFiUptimeMillis = 0;
      enableWifi();
    } 
  }
