title: mqtt error void callback/subscribed on arduino
body: <p>I'm testing with my arduino and MQTT cloud.
  For the publish everything goes well, the arduino publishes "hello world"</p>
  
  <p>But with the void callback function nothing happens.
  With my MQTT.fx client, I'm subscribed to the topics "status" and "commando".
  At the "status" I see that the arduino is a live.</p>
  
  <p>When I publish with my MQTT.fx client to the topic "commando".
  I can see it arrived in my client, but not in the serial monitor of the arduino.</p>
  
  <p>Why is the void callback function not used?</p>
  
  <p><div class="snippet" data-lang="js" data-hide="false">
  <div class="snippet-code">
  <pre class="snippet-code-html lang-html prettyprint-override"><code>#include &lt;SPI.h&gt;
  #include &lt;PubSubClient.h&gt;
  #include &lt;Ethernet.h&gt;
  
  #define server "m20.cloudmqtt.com"
  int port = 13365;
  
  // Update these with values suitable for your network.
  byte mac[]    = {  0xDE, 0xED, 0xBA, 0xFE, 0xFE, 0xED };
  byte ip[]     = { 192, 168, 0, 120 };
  
  unsigned long time;
  char message_buff[100];
  
  EthernetClient ethClient;
  PubSubClient client(server, port, callback, ethClient);
  
  void setup()
  { 
    // init serial link for debugging
    Serial.begin(115200);
    
    Ethernet.begin(mac, ip);
    if (client.connect("arduino-MQTT","test","test")) {
      client.publish("/arduino/status/","hello world");
      client.subscribe("/arduino/commando/");
      Serial.println("Connected");
    }
    
    if (Ethernet.begin(mac) == 0)
    {
        Serial.println("Failed to configure Ethernet using DHCP");
        return;
    }
  }
  
  void loop()
  {
    // MQTT client loop processing
    client.loop();
  }
  
  
  void callback(char* topic, byte* payload, unsigned int length) {
   
    if (strcmp(topic, "/arduino/commando/") == 0) {
      String msg = toString(payload, length);
      Serial.println(msg);
    }else{
      Serial.println("arduino topic not found");
    }  
  }
  
  //
  // toString function
  //
  String toString(byte* payload, unsigned int length) {
    int i = 0;
    char buff[length + 1];
    for (i = 0; i &lt; length; i++) {
      buff[i] = payload[i];
    }
    buff[i] = '\0';
    String msg = String(buff);
    return msg;
  }</code></pre>
  </div>
  </div>
  </p>