MQTT Publish Error

Dear All,

when I try to publish 500 Bytes of data to the MQTT Server at every 400ms, the AT+QMTPUB command gives error at alternates interval like below.

I think it is delay problem, like when I publish data after 500ms the command gives OK. But when I publish data at less then 500ms interval it gives ERROR.

I can’t understand why it is happening. According to hardware manual the UL has 5 Mbps speed and I am sending only 500 Bytes of data.

Please anybody have solution then please tell me.

If you have any questions then please ask me.

[2023-09-23_13:08:51:995]
[2023-09-23_13:08:51:995]>
[2023-09-23_13:08:52:042]OK
[2023-09-23_13:08:52:493]
[2023-09-23_13:08:52:493]>
[2023-09-23_13:08:52:540]ERROR
[2023-09-23_13:08:52:784]
[2023-09-23_13:08:52:784]+QMTPUB: 0,1,0
[2023-09-23_13:08:52:987]
[2023-09-23_13:08:52:987]>
[2023-09-23_13:08:53:050]OK
[2023-09-23_13:08:53:489]
[2023-09-23_13:08:53:489]>
[2023-09-23_13:08:53:549]ERROR
[2023-09-23_13:08:53:745]
[2023-09-23_13:08:53:745]+QMTPUB: 0,1,0
[2023-09-23_13:08:53:989]
[2023-09-23_13:08:53:989]>
[2023-09-23_13:08:54:037]OK
[2023-09-23_13:08:54:501]
[2023-09-23_13:08:54:501]>
[2023-09-23_13:08:54:501]ERROR
[2023-09-23_13:08:54:742]
[2023-09-23_13:08:54:742]+QMTPUB: 0,1,0
[2023-09-23_13:08:54:922]
[2023-09-23_13:08:54:922]>
[2023-09-23_13:08:54:922]OK
[2023-09-23_13:08:55:362]
[2023-09-23_13:08:55:362]>
[2023-09-23_13:08:55:408]ERROR
[2023-09-23_13:08:55:456]
[2023-09-23_13:08:55:456]>
[2023-09-23_13:08:55:502]OK
[2023-09-23_13:08:55:549]
[2023-09-23_13:08:55:549]>
[2023-09-23_13:08:55:627]ERROR
[2023-09-23_13:08:55:627]+QMTPUB: 0,1,0
[2023-09-23_13:08:55:986]
[2023-09-23_13:08:55:986]>
[2023-09-23_13:08:56:049]ERROR
[2023-09-23_13:08:56:221]
[2023-09-23_13:08:56:221]+QMTPUB: 0,1,0
[2023-09-23_13:08:56:487]
[2023-09-23_13:08:56:487]>
[2023-09-23_13:08:56:549]OK
[2023-09-23_13:08:56:982]
[2023-09-23_13:08:56:982]>
[2023-09-23_13:08:57:046]ERROR
[2023-09-23_13:08:57:301]
[2023-09-23_13:08:57:301]+QMTPUB: 0,1,0
[2023-09-23_13:08:57:489]
[2023-09-23_13:08:57:489]>
[2023-09-23_13:08:57:535]OK
[2023-09-23_13:08:57:989]
[2023-09-23_13:08:57:989]>
[2023-09-23_13:08:58:035]ERROR
[2023-09-23_13:08:58:270]
[2023-09-23_13:08:58:270]+QMTPUB: 0,1,0
[2023-09-23_13:08:58:489]
[2023-09-23_13:08:58:489]>
[2023-09-23_13:08:58:535]OK
[2023-09-23_13:08:58:996]
[2023-09-23_13:08:58:996]>
[2023-09-23_13:08:59:043]ERROR
[2023-09-23_13:08:59:261]
[2023-09-23_13:08:59:261]+QMTPUB: 0,1,0
[2023-09-23_13:08:59:496]
[2023-09-23_13:08:59:496]>
[2023-09-23_13:08:59:496]OK

Thanks

Please find below my AT Commands sequence.

ATE0
AT+CSQ
AT+QICSGP=1,1,“APN”,“”,“”,1
AT+QMTOPEN=0,“mqtt-dashboard.com”,1883
AT+QMTCONN=0,“ClientID”,“”,“”

below process repeats every 400ms
{
AT+QMTPUB=0,1,1,0,“helloWorld/Topic1”
500 Byte data
}

Please increase the delay such as 1s and try again

Dear Herbert,

Thanks for reply.

If I increase the delay then I can’t send my data at 400ms time interval. So can you suggest another solution?

Thanks

Since the underlying protocol of MQTT is TCP, the acknowledgement frame ack needs to be received after sending data, so the network delay may affect the receiving of ack. I recommend that you use the UDP protocol for testing