Closed mh-ba-dg closed 3 years ago
Hi @Daniel-Gruber
Again here, could you please attach a snippet showing the wolfMQTT API used to reproduce this error?
Thanks, Eric Blankenhorn wolfSSL Support
Same snippet as in #142 I did some more testing and could reproduce the "hangup" when the size of the data to send (topic name + payload [+ some control bytes?]) is near the buffer size NUI16_IO_BUFFER_SIZE_TX .
I believe this was fixed in #164
This was fixed by #164. Please feel free to reopen if there are other comments.
For some constellations of buffer size and payload size, the MQTT client seems not to send all the data. This leads to infinite loops if QoS1 is used, since the client thinks it has sent all the data, but the server is not sending the ACK. If QoS0 is set, the MQTT Client thinks it has sent the data, but the server is running into a timeout and it seems it did not reveive all data.
Example: TX-Buffer size: 512 The buf_len of MqttSocket_WriteDo() is set to 512. MqttSocket_WriteDo() is called only once, but a few bytes (34 Bytes) are still missing. The state machine is not sending anymore, but is waiting for the Server ACK (since QoS is 1)
This might be related to #142
Environment: Microchip Harmony v2.6 OS: FreeRTOS Defines:
define WOLFSSL_BASE64_ENCODE
define WOLFMQTT_CUSTOM_MALLOC
define WOLFMQTT_MALLOC(s) pvPortMalloc((s))
define WOLFMQTT_FREE(p) vPortFree((p))
define ENABLE_MQTT_TLS
define WOLFMQTT_NONBLOCK
define MICROCHIP_MPLAB_HARMONY
define MICROCHIP_TCPIP
define MICROCHIP_PIC32
define MICROCHIP_PIC32_RNG