B4R Tutorial MQTT

Discussion in 'B4R Tutorials' started by Erel, Apr 11, 2016.

  1. soltypio

    soltypio Member Licensed User

    is it possible to acces state property of the mqqt client which (as described in PubSubClient docs) contains the error code returned after running connect method?
    This would allow to track the nature of connection failures .
     
  2. Erel

    Erel Administrator Staff Member Licensed User

    It is currently not exposed. Practically there could be two errors: the broker is not available (network issue or the broker is offline) or the credentials are incorrect.
     
  3. gazaduk

    gazaduk New Member Licensed User

    Hi Erel,

    Is there any way to change the ping request time?

    Thanks,
    Gary
     
  4. Erel

    Erel Administrator Staff Member Licensed User

    You can change the KEEPALIVE contsant in PubSubClient.h:
    Code:
    // MQTT_KEEPALIVE : keepAlive interval in Seconds
    #ifndef MQTT_KEEPALIVE
    #define MQTT_KEEPALIVE 15
    #endif
     
  5. gazaduk

    gazaduk New Member Licensed User

    Thanks Erel, works great!
     
Loading...
  1. This site uses cookies to help personalise content, tailor your experience and to keep you logged in if you register.
    By continuing to use this site, you are consenting to our use of cookies.
    Dismiss Notice