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

#include <EEPROM.h>
#include "EepromUtil.h"

const int hallPin = A0;     
const int ledPin =  13;     

const long eepromAddressCounter = 0;
const long eepromAddressLastAccess = 0x0A;

#define MAX_LENGTH 18
char lastAccess[MAX_LENGTH] = {'\0'};
int hallStateCounter = 0;
int hallState = 0;
bool hallStateChanged = false;

    }
  }

  // ir stuff
  int irRead = analogRead(irPin);

  // send via bluetooth
  Serial.print("{\"counter\":");
  Serial.print(hallStateCounter);
  Serial.print(",\"ir\":");
  Serial.print(irRead);
  Serial.print(",\"lastAccess\":\"");
  Serial.print(lastAccess);
  Serial.print("\"");
  Serial.println("}");
  
  checkSerial();
}

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