 #define USUARIO_MQTT "mdzjtvif"
 #define SENHA_MQTT "snX5gG5TJs8P"
 
-void callback(char* topic, byte* payload, unsigned int length) {}
+void callback(char* topic, byte* payload, unsigned int length);
 
 PubSubClient client(server, PORTA_MQTT, callback, ethClient);
 



// Métodos auxiliares

void conectar_mosquitto() {
//  client.setServer(server, PORTA_MQTT);

  while (!client.connected()) {
    Serial.print("Conectando com mosquitto broker...");
    if (client.connect("casa", "mdzjtvif", "snX5gG5TJs8P")) {
//    if (client.connect("casa")) {
      Serial.println(" conectado!");
    } else {
      Serial.print("falha, rc=");
      Serial.println(client.state());
    }
    delay(TEMPO_NOVA_TENTATIVA);
  }
}


  {
    conectar_mosquitto();
  }
  client.loop();
  ler_temperatura();
  Narcoleptic.delay(5000);
}

void callback(char* topic, byte* payload, unsigned int length) {
  Serial.print("Message arrived [");
  Serial.print(topic);
  Serial.print("] ");
  for (int i=0;i<length;i++) {
    Serial.print((char)payload[i]);
  }
  Serial.println();
}


