       return "Unknown MQTT error";
   }
 #else
-  static char buff[5]; snprintf(buff,sizeof(buff),"%d", state);
+  static char buff[5]; snprintf(buff, sizeof(buff), "%d", state);
 #endif
 }
 

}

int checkTagReader() {
  MFRC522::Uid uid = { 0, 0, 0 };

#if 0
  static unsigned long test = 0;
  if (millis() - test > 15000) {
    uid = { 4, { 1, 2, 3, 4}, 0 };
    test = millis();
  }
#endif

  // Look for new cards
  if ( ! mfrc522.PICC_IsNewCardPresent()) {
    return 0;
  }

  // Select one of the cards
  if ( ! mfrc522.PICC_ReadCardSerial()) {
    return 0;
  }

  uid = mfrc522.uid;
  // Dump debug info about the card; PICC_HaltA() is automatically called
  // mfrc522.PICC_DumpToSerial(&(mfrc522.uid));

  if (uid.size) {
    lasttag[0] = 0;
    for (int i = 0; i < uid.size; i++) {
      char buff[5];
      snprintf(buff, sizeof(buff), "%s%d", i ? "-" : "", uid.uidByte[i]);
      strcat(lasttag, buff);
    }
    lasttagbeat = beatCounter;

    char beatAsString[ MAX_BEAT ];
    snprintf(beatAsString, sizeof(beatAsString), BEATFORMAT, beatCounter);
    Sha256.initHmac((const uint8_t*)passwd, strlen(passwd));
    Sha256.print(beatAsString);
    Sha256.write(uid.uidByte, uid.size);
    const char * tag_encoded = hmacToHex(Sha256.resultHmac());

    char buff[250];
    snprintf(buff, sizeof(buff), "energize % s % s % s", moi, machine, tag_encoded);
    send(buff);

    return 1;
  }
}

void loop() {

  return NULL;
}

void reconnectMQTT() {

  Debug.print("Attempting MQTT connection (State : ");
  Debug.print(state2str(client.state()));
