Replies: 4 comments 3 replies
-
I am using the latest paho mqtt 1.2.12 version of the library, which runs in a windows environment |
Beta Was this translation helpful? Give feedback.
-
That looks like an old error message to me - what version did you actually mean (1.2.12 doesn't exist). You don't show the beginning of the trace which makes it harder to see what is going on. But it looks like you might be trying to send more data than your connection can handle, or at least very close to the limit. I would try sending the message less frequently or reduce the size of the payload and see if that makes any difference, to start with. |
Beta Was this translation helpful? Give feedback.
-
No. In the MQTTClient API, the only call that can be made in a callback is MQTTClient_connect in the connection lost callback. If you want to do this, you have to use the MQTTAsync API. |
Beta Was this translation helpful? Give feedback.
-
If you change the QoS of the message to 1, then the library won't need to send any pings, because it will be receiving ACK messages back from the broker. That won't help if you are still trying to send more data than the TCP connection can handle however. You can also turn off keepalive (sending PINGs) by setting the keepalive interval to 0. |
Beta Was this translation helpful? Give feedback.
-
Data is being sent every second and can be subscribed to, but the mqtt connection will suddenly disconnect periodically. I don't know what caused it. My understanding is that the data can always be sent successfully and even if the PINGREQ fails, the connection should not be disconnected.
20231013 143302.527 346492 BoxPlugIn5200023062019300033 -> PUBLISH qos: 0 retained: 0 rc: -22 payload len(54209): {"deviceLogData":[{"
20231013 143302.527 Storing unsent QoS 0 message
20231013 143303.044 Return code 0 from read select
20231013 143303.044 Return code 0 from write select
20231013 143303.044 Return code 0 from read select
20231013 143303.044 Return code 0 from write select
20231013 143303.044 Return code 1 from read select
20231013 143303.044 ContinueWrite: partial write now complete for socket 346492
20231013 143303.044 Return code 0 from write select
20231013 143303.044 Partial write: 0 bytes of 54291 actually written on socket 346492
20231013 143303.044 346492 BoxPlugIn5200023062019300033 -> PUBLISH qos: 0 retained: 0 rc: -22 payload len(54248): {"deviceLogData":[{"
20231013 143303.044 Storing unsent QoS 0 message
20231013 143303.044 Return code 1 from read select
20231013 143303.044 ContinueWrite: partial write now complete for socket 346492
20231013 143303.044 Return code 0 from write select
20231013 143303.044 Partial write: 0 bytes of 54291 actually written on socket 346492
20231013 143303.044 346492 BoxPlugIn5200023062019300033 -> PUBLISH qos: 0 retained: 0 rc: -22 payload len(54248): {"deviceLogData":[{"
20231013 143303.044 Storing unsent QoS 0 message
20231013 143303.044 Return code 0 from read select
20231013 143303.044 Return code 0 from write select
20231013 143303.044 Return code 1 from read select
20231013 143303.044 ContinueWrite: partial write now complete for socket 346492
20231013 143303.538 Return code 0 from write select
20231013 143303.538 Partial write: 0 bytes of 54291 actually written on socket 346492
20231013 143303.538 346492 BoxPlugIn5200023062019300033 -> PUBLISH qos: 0 retained: 0 rc: -22 payload len(54248): {"deviceLogData":[{"
20231013 143303.538 Storing unsent QoS 0 message
20231013 143303.538 Return code 0 from read select
20231013 143303.538 Return code 0 from write select
20231013 143303.538 Return code 1 from read select
20231013 143303.538 ContinueWrite: partial write now complete for socket 346492
20231013 143303.538 Return code 0 from write select
20231013 143303.538 Partial write: 0 bytes of 54291 actually written on socket 346492
20231013 143303.538 346492 BoxPlugIn5200023062019300033 -> PUBLISH qos: 0 retained: 0 rc: -22 payload len(54248): {"deviceLogData":[{"
20231013 143303.538 Storing unsent QoS 0 message
20231013 143303.538 Return code 0 from read select
20231013 143303.538 Return code 0 from write select
20231013 143303.538 Return code 1 from read select
20231013 143303.538 ContinueWrite: partial write now complete for socket 346492
20231013 143303.538 Return code 0 from write select
20231013 143303.538 Partial write: 0 bytes of 2 actually written on socket 346492
20231013 143303.538 346492 BoxPlugIn5200023062019300033 -> PINGREQ (-22)
20231013 143303.538 Error sending PINGREQ for client BoxPlugIn5200023062019300033 on socket 346492, disconnecting
20231013 143303.915 Trying to write to socket 346492 for which there is already pending output
20231013 143303.915 346492 BoxPlugIn5200023062019300033 -> DISCONNECT (-1)
20231013 143303.915 Cleaning in abortWrite for socket 346492
20231013 143303.915 Removed socket 346492
20231013 143303.915 Reset max fdp1 to 1
20231013 143303.915 Conn_count is 0
Beta Was this translation helpful? Give feedback.
All reactions