Developer Portal Community

    cancel
    Showing results for 
    Search instead for 
    Did you mean: 

    'SendDataOverMqtt' works for some time and then fails.

    Mishra
    Member

    'SendDataOverMqtt' works for some time and then fails.

    I simply imported the SendDataOverMqtt template and setup wifi and Mqtt structs. Along with this I just added accelerometer data to be published along with pressure, temperature and light data.

    XDK sends data for about 2-3 minutes and then errors out. 

    Error in XDK workbench: 

    Error in XDK110 Application package.
    Package ID: 153
    Module ID: 39
    Severity code: 2
    Error code: 130
    AppControllerFire : MQTT publish failed

    Error at Mosquitto broker console:

    Client XDK_FS disconnected due to protocol error.

    Code is too big to be attached, but I only edited the following sections.

    1)  MQTT and Wifi Setup struct

    2) enabled the accelerometer in sensor struct and added it's values to snprintf(which works).

    Please help me decode this error. 

     

    7 REPLIES 7
    Padmapriya
    Long-established Member

    Re: 'SendDataOverMqtt' works for some time and then fails.

    Hello,

    There is no limitation in the client (XDK and application) for publish message count. Hence it has to do with the broker.

    Which version of workbench application are you using ? In the latest version v3.6.0 workbench, MQTT reconnection logic is added. With this reconnection logic, upon MQTT disconnection ; XDK will reconnect with the broker again and publish.

    Mishra
    Member

    Re: 'SendDataOverMqtt' works for some time and then fails.

    Hi Padma,

    Thankyou for your reply. I am using XDK 3.6.0 with mosquitto broker, are you aware of any known issues with mosquitto.

    Could you please share where can I find this reconnection logic?

    And  Could you please translate this error code?

     

    Thanks again

    LlobetAtWork
    Long-established Member

    Re: 'SendDataOverMqtt' works for some time and then fails.

    Hi Mishra,

    the non-AWS MQTT implementation has issues with some versions of Eclipse Mosquitto.

    Currently versions above 1.5.7 will stop receiving publications after 256 messages. Please use version 1.5.7 or below as broker. Even in this case, it is common for the broker to drop the connection in around 30 minutes. Since in MQTT v3.1 there is no server-to-client DISCONNECT message, the client will notice the disconnection due to publishing send failure or publishing timeout.In this case the client shall disconnect, close the sockets and reconnect.

    Kind Regards,

    Francisco

    Mishra
    Member

    Re: 'SendDataOverMqtt' works for some time and then fails.

    Hello Francisco,

    Thanks a lot. I am having a hard time downgrading to mosquitto1.5.6 . Is there a workaround for avoiding this disconnection? May be by changing MQTT protocol version on XDK side or on the broker(if possible) ? Also, do you recommend any other broker I can use, which is known to work flawlessly with the example code?

    Icon--AD-black-48x48Icon--address-consumer-data-black-48x48Icon--appointment-black-48x48Icon--back-left-black-48x48Icon--calendar-black-48x48Icon--center-alignedIcon--Checkbox-checkIcon--clock-black-48x48Icon--close-black-48x48Icon--compare-black-48x48Icon--confirmation-black-48x48Icon--dealer-details-black-48x48Icon--delete-black-48x48Icon--delivery-black-48x48Icon--down-black-48x48Icon--download-black-48x48Ic-OverlayAlertIcon--externallink-black-48x48Icon-Filledforward-right_adjustedIcon--grid-view-black-48x48IC_gd_Check-Circle170821_Icons_Community170823_Bosch_Icons170823_Bosch_Icons170821_Icons_CommunityIC-logout170821_Icons_Community170825_Bosch_Icons170821_Icons_CommunityIC-shopping-cart2170821_Icons_CommunityIC-upIC_UserIcon--imageIcon--info-i-black-48x48Icon--left-alignedIcon--Less-minimize-black-48x48Icon-FilledIcon--List-Check-grennIcon--List-Check-blackIcon--List-Cross-blackIcon--list-view-mobile-black-48x48Icon--list-view-black-48x48Icon--More-Maximize-black-48x48Icon--my-product-black-48x48Icon--newsletter-black-48x48Icon--payment-black-48x48Icon--print-black-48x48Icon--promotion-black-48x48Icon--registration-black-48x48Icon--Reset-black-48x48Icon--right-alignedshare-circle1Icon--share-black-48x48Icon--shopping-bag-black-48x48Icon-shopping-cartIcon--start-play-black-48x48Icon--store-locator-black-48x48Ic-OverlayAlertIcon--summary-black-48x48tumblrIcon-FilledvineIc-OverlayAlertwhishlist