 #endif
 
 typedef enum {
-  OUTOFORDER, SWERROR,      // some error - machine disabled.
+  SWERROR, OUTOFORDER,     // some error - machine disabled.
   OVERLOAD,                 // current overload protection has tripped. Machine disabled.
   WRONGFRONTSWITCHSETTING,   // The switch on the front is in the 'on' setting; this blocks the operation of the on/off switch.
   DENIED,                    // we got a denied from the master -- flash an LED and then return to WAITINGFORCARD
   CHECKING,                  // we are are waiting for the master to respond -- flash an LED and then return to WAITINGFORCARD
   WAITINGFORCARD,            // waiting for card.
   ENERGIZED,                 // Got the OK; go to RUNNING once the green button at the back is pressed & operator switch is on.
-  RUNNING,                   // Running - go to VACUUM once the front switch is set to 'off' or to WAITINGFORCARD if red is pressed.
-  VACUUM                     // Letting dust control do its thing; then drop back to ENERGIZED.
+  RUNNING,                   // Running - go to DUSTEXTRACT once the front switch is set to 'off' or to WAITINGFORCARD if red is pressed.
+  DUSTEXTRACT                     // Letting dust control do its thing; then drop back to ENERGIZED.
 } machinestates_t;
+
+#ifdef DEBUG
+// 229,884
+char machinestateNames = {
+  "Software Error", "Out of order",
+  "Current overload tripped",
+  "Operator switch in wrong position",
+  "Tag Denied",
+  "Checking tag",
+  "Waiting for card to be presented",
+  "Energized",
+  "Running",
+  "Postrun Dust extraction"
+};
+#endif
 
 static machinestates_t laststate;
 unsigned long laststatechange = 0;

  }
#endif

  if (machinestate == WAITINGFORCARD && millis()-laststatechange > 500)
    if (checkTagReader())
      machinestate = CHECKING;
}

  }
  last_wifi_ok = millis();

#ifdef OTA
  ArduinoOTA.handle();
#endif
  if ((!client.connected()) && (millis() - last_mqtt_connect_try > 5000))
    reconnectMQTT();

