           digitalWrite(controlledPin, LOW);
           Serial.print("p");
         }
-        else if (strcmp(p.data, "v_up") == 0) {
+        else if (strcmp(cmd, "v_up") == 0) {
           // digitalWrite(controlledPin, LOW);
           Serial.print("u");
         }
-        else if (strcmp(p.data, "v_dn") == 0) {
+        else if (strcmp(cmd, "v_dn") == 0) {
           // digitalWrite(controlledPin, LOW);
           Serial.print("d");
         }

      
      if (atoi(p.id) == atoi(deviceId) && p.type[0] == 'i') {
        // all sorts of instructions
        DEBUG_PRINTLN("[CONNECTED] command issued");
        if (strcmp(p.data, "0001") == 0) {
          digitalToggle(controlledPin);
          Serial.print("p");
        }

#include <IRremote.h>
#include <string.h>

#define DEBUG
#include "utils.h"

// Trying to elucidate the way communication works first
