 	// send to web app -- CIAO IS SO DAMN SLOW
 	String request = URI + String(scannedID);
 	CiaoData data = Ciao.write(CONNECTOR, ADDRESS, request);
+}
+
+void serialEvent() {
+	int i = 0;
+	unsigned long existingTime = 0;
+
+	while (Serial.available()) {
+		if (i > 2) {
+			if (characterRead[0] == COMMAND_REGISTER) {
+				id = Serial.parseInt();
+			}
+		}
+		else {
+			characterRead[i] = Serial.read();
+		}
+		i++;
+	}
 
 	if (characterRead[0] == COMMAND_GET_TIME) {
 		characterRead[0] = 0;

void loop() {
	// Scan for RFID tags
	int scannedID = 0;
	bool isValidResponse = false;
	unsigned long existingTime = 0;

	while (!isValidResponse) {
		sendCommand(CMD_GET_SNR, blockID, machineID);
		delay(waitforSerialResponse);

		Serial.write(END_CHAR);

	}
}

void getStringFromMem(int index) {
