 {
   Serial.begin(9600);
   Ethernet.begin(mac, ip);
+  suscribirse();
 }
 
 void loop()

  client.loop();
  Serial.println(client.connect("arduinoClient"));
    publicar();
    suscribir();
}
void publicar(){
  Serial.println("Publicando");
  client.publish("home/basement/temp","24");
  delay(1000);
  client.publish("home/living/temp","15");
    delay(1000);
  client.publish("home/front/door", "true");
    delay(1000);

byte server[] = { 192, 168, 2, 1 };
byte ip[]     = { 192, 168, 2, 20 };

// Callback function header
void callback(char* topic, byte* payload, unsigned int length);

//aca manejo lo que me envian
void callback(char* topic, byte* payload, unsigned int length) {
  // Allocate the correct amount of memory for the payload copy
  byte* p = (byte*)malloc(length);
  // Copy the payload to the new buffer
  memcpy(p,payload,length);
  Serial.println("tu vieja");
  // Free the memory
  free(p);
}


EthernetClient ethClient;
PubSubClient client(server, 1883, callback, ethClient);
