   Serial.println("Finding other player...");
   boolean notFound = true;
   while(notFound){
+    Serial.println("-Searching for other players...");
     String res = sendAndWait(MSG_FIND_GAME + SEP_CHAR_COMMANDS  + player_id + END_CHAR);
+    Serial.println("-reply: '" + res + "'");
     String command = getCommand(res);
 
     // if waiting_for_player -> delay 100
     // if not_registered -> register
     // if rival -> set start_turn, set rival_id, notFound = false
-    if (command == CMD_WAIT_FOR_RIVAL){
+    if (command.startsWith(CMD_WAITING_PLAYERS)){
       Serial.println("-Waiting for rivals...");
       delay(1000);
     } 
-    else if (command == CMD_NOT_REGISTERED){ // This shouldn't happen
+    else if (command.startsWith(CMD_NOT_REGISTERED)){ // This shouldn't happen
       Serial.println("-Not registered");
       registerPlayer();
     } 
-    else if (command == CMD_RIVAL){
+    else if (command.startsWith(CMD_RIVAL)){
       Serial.println("-Rival found");
       String parameters = getParameters(res);
       rival_id = getParameter(parameters, 1);
       start_turn = getParameter(parameters, 2);
       notFound = false;
+    } else{
+      Serial.println("Unknown command: '" + command + "'");
+    
     }
   }
 }

boolean greenVictory = false;

// hardware initialization
void setup() {  
  Serial.begin(9600);
  Serial.println("*****************");
  Serial.println("***** Setup *****");
  Serial.println("*****************");
  // 0 - Initialize board comm
  Serial.println("Initializing board comm...");
  Serial1.begin(9600);
  // 1 - Initialize the tictactoe board
  Serial.println("Initializing tictactoe squares...");
  for (int i = 0; i < 9; i++){


void initializeHardwarePeripherals(){
  Serial.println("Initializing hardware:");
  initializeBoard();
  initializeScreen();
  display.printText("Initializing...", 6, 1, GREEN);
  initializeRFID();
  initializeSoundPlayer();  
}

void initializeBoard(){
