The network buffer gets initialized/allocated to the MQTTContext_t during the MQTT_Init call. For example, in the case of MQTT_Mutual_Auth demo it’s done here.
In this case, the network buffer is statically allocated here.
If I wanted to increase the MQTT messages that are received on the micrcontroller end, about 2GB would I have to increase this buffer and ipconfigTCP_RX_BUFFER_LENGTH to 2G?
The ipconfigTCP_RX_BUFFER_LENGTH sets the size of the circular stream buffer for the TCP data reception used by the FreeRTOS+TCP stack. Its value can be set depending on how much RAM you have on your device; its default value, if not overridden in FreeRTOSIPConfig.h, is ( 4 * ipconfigTCP_MSS ).
Theoretically this should be the maximum size you could expect to receive from the FreeRTOS_recv. If you are increasing ipconfigTCP_RX_BUFFER_LENGTH please make sure to increase the size of the network buffer thats given to the MQTT_Init, democonfigNETWORK_BUFFER_SIZE in the example referred above.
Are you trying to send or receive messages? Your question says you are trying to send but the snippets are referring to receiving messages?
If you are receiving the packet I would suggest you set a breakpoint here where the packet is incoming, and then step through and see where it is failing. With that much data you are probably ending up timing out somewhere and not running out of space.
This line should be asking for 2GB of data, and as you can see before this you would have generated an error here if you asked for more data than the length of the network buffer (if buffer was too small in other words).
The actual reading of the data happens on this line, so in your debugger you should be able to follow it from here.
@cobusve I am trying to receive messages. If you could point out where I’m referencing sending messages I’m happy to edit it to make it clearer.
The links that you send me refer to the function receivePacket, however the path that this message come via the receiveSingleIteration. I’m essentially using the plaintext demo code is this where I might be going wrong? should I replace it with receivePacket?
I’ve stepped through the code, and all the variables are as expected but the data is just short. I can’t see any errors being flagged anywhere. Thanks for the previous help and I’ll appreciate anymore suggestions.