Hi everyone,

I am using XDK-Workbench application "SendDataOverMQTT". The code works perfectly fine for 128 publishes only. Previously, the community suggested that this is a public broker limmitaion, therefore, i created a private mosquitto broker on windows. However, i am still facing the very same problem.I have also used authentication for this broker (i.e., username and password) but it made no difference.

I get the following error:

INFO | XDK DEVICE 1: AppIncomingMsgCount :128 
 INFO | XDK DEVICE 1: MqttEventHandler : Event - 17
 INFO | XDK DEVICE 1: MqttEventHandler : Event - 4
 INFO | XDK DEVICE 1: AppControllerFire : MQTT publish failed 
 INFO | XDK DEVICE 1: Error in XDK110 Application package.
 INFO | XDK DEVICE 1: Error in XDK110 Application package.
 INFO | XDK DEVICE 1: 	Package ID: 153
 INFO | XDK DEVICE 1: 	Package ID: 153
 INFO | XDK DEVICE 1: 	Module ID: 39
 INFO | XDK DEVICE 1: 	Module ID: 39
 INFO | XDK DEVICE 1: 	Severity code: 2
 INFO | XDK DEVICE 1: 	Severity code: 2
 INFO | XDK DEVICE 1: 	Error code: 123
 INFO | XDK DEVICE 1: 	Error code: 130

 

On windows command prompt (while running Mosquitto broker in verbose) i get following error:

Socket error on client XDK_MQTT_EXAMPLE, disconnecting.

 

Can anyone help me in this regard? Thanks

0 (0 Votes)
RE: SendDataOverMQTT (mosquitto broker) publishes data for 128 samples only
Answer
8/21/19 6:49 AM as a reply to Muhammad Salman Shaukat.

Hi Muhammad

Please increase the buffer size APP_MQTT_DATA_BUFFER_SIZE in AppController.c

Thanks

Priyashi

0 (0 Votes)
RE: SendDataOverMQTT (mosquitto broker) publishes data for 128 samples only
Answer
8/21/19 11:15 AM as a reply to Priyashi Yadav.

Hi Priyashi,

Thanks for your reply. I Increased the buffer size from 256 to 512 and 1950 but it made no difference at all. Also, I think that increasing the buffer size is not the solution here because the "AppIncomingMsgTopicBuffer" and "AppIncomingMsgPayloadBuffer" are reset at each subscribe event. For instance,

 

static void AppMQTTSubscribeCB(MQTT_SubscribeCBParam_T param)
{
	AppIncomingMsgCount++;
    memset(AppIncomingMsgTopicBuffer, 0, sizeof(AppIncomingMsgTopicBuffer));
    memset(AppIncomingMsgPayloadBuffer, 0, sizeof(AppIncomingMsgPayloadBuffer));

    if (param.PayloadLength < sizeof(AppIncomingMsgPayloadBuffer))
    {
        strncpy(AppIncomingMsgPayloadBuffer, (const char *) param.Payload, param.PayloadLength);
    }
    else
    {
        strncpy(AppIncomingMsgPayloadBuffer, (const char *) param.Payload, (sizeof(AppIncomingMsgPayloadBuffer) - 1U));
    }
    if (param.TopicLength < (int) sizeof(AppIncomingMsgTopicBuffer))
    {
        strncpy(AppIncomingMsgTopicBuffer, param.Topic, param.TopicLength);
    }
    else
    {
        strncpy(AppIncomingMsgTopicBuffer, param.Topic, (sizeof(AppIncomingMsgTopicBuffer) - 1U));
    }

}

Best regards,

Salman

0 (0 Votes)
RE: SendDataOverMQTT (mosquitto broker) publishes data for 128 samples only
Answer
8/23/19 8:34 AM as a reply to Muhammad Salman Shaukat.

Hi Muhammad

I will check and get back to you

+1 (1 Vote)
RE: SendDataOverMQTT (mosquitto broker) publishes data for 128 samples only
Answer
9/11/19 9:54 PM as a reply to Priyashi Yadav.

Any update? I seem to get the same issue.

thanks,

Philippe

+1 (1 Vote)
RE: SendDataOverMQTT (mosquitto broker) publishes data for 128 samples only
Answer
9/18/19 1:43 PM as a reply to philippe haussy.

Hi Philippe,

I resolved this issue by changing QoS to 0 from 1. However, I still do not know the reason behind this.

 

LG

Salman

0 (0 Votes)