 
   unsigned long start = millis();
   while (WiFi.status() != WL_CONNECTED && (millis() - start < 5000)) {
-    tock();
     delay(100);
   };
 
   if (WiFi.status() != WL_CONNECTED) {
     Log.print("Connection to <"); Log.print(ssid); Log.println("> failed! Rebooting...");
     for (int i = 0; i < 50; i++) {
+      setRedLED(LED_PANIC);
       delay(100);
-      tock();
     }
     ESP.restart();
   }

#endif

  handleMachineState();
  tock();

  // Keepting time is a bit messy; the millis() wrap around and
  // the SPI access to the reader seems to mess with the millis().

  client.setCallback(mqtt_callback);

  machinestate = WAITINGFORCARD;
  setRedLED(LED_ON);
}

const char * state2str(int state) {
