     }
     else
     {
-      String s = Serial2.readString();
+      String s = Serial.readString();
       String lastAccessCmd = getValue(s, ':', 0);
       String lastAccessValue = getValue(s, ':', 1);
 

    }
  }

  Serial2.print("{\"counter\":");
  Serial2.print(hallStateCounter);
  Serial2.print(",\"lastAccess\":\"");
  Serial2.print(lastAccess);
  Serial2.print("\"");
  Serial2.println("}");

  checkSerial();
}

void checkSerial()
{
  if(Serial2.available() > 0)
  {
    byte dataInLength = Serial2.available();
    if(dataInLength <= 2)
    {
      byte dataIn = Serial2.read();
      if(dataIn == 'r' /* reset counter */)
      {
        hallStateCounter = 0x00;

{
  pinMode(ledPin, OUTPUT);      
  pinMode(hallPin, INPUT);     
  pinMode(irPin, INPUT);
  Serial.begin(9600);
  //Serial2.begin(9600);
  EepromUtil::eeprom_read_int(eepromAddressCounter, &hallStateCounter);
  EepromUtil::eeprom_read_int(eepromAddressCounter2, &irStateCounter);
  EepromUtil::eeprom_read_string(eepromAddressLastAccess, lastAccess, MAX_LENGTH);
}

