Closed una801 closed 2 years ago
Hi @una801,
Transport packets != MQTT packets. TCP fragmentation occurs at the transport layer, while MQTT is an application layer protocol. The coreMQTT library has no knowledge of any packets in the transport layer; your network stack is responsible for assembling them and passing their data to the coreMQTT library through the library's transport interface. The network buffer is the buffer to hold MQTT packets that are received from or sent to the network via the transport interface. For coreMQTT, it needs to be at least as large as the largest MQTT packet you plan to receive. Your error is that you are trying to receive a 1057 byte MQTT packet into a 1024 byte buffer, so you need to increase the network buffer's size.
@muneebahmed10 Thank you for your answer. When we say that we need to increase the network buffer, do you mean that we can modify the definition item inside the sdk? If you change the network buffer part of the definition, there will be an error, so I would like to ask if there is anything additional to modify.
#define NETWORK_BUFFER_SIZE ( 1024U )
->Define item in mqtt_mutual_auth part
That define is in a file named demo_config.h
. It's part of the demo code and not in coreMQTT or any other library in the SDK. You can do whatever you want with the demo code.
I am closing this issue. Feel free to open a new issue if you have more questions.
Hi,
I'm going to send hundreds of flying data to IoT Core every second. He is using an LTE modem, and in the process of transmitting data using mqtt, the connection is being disconnected due to an error related to network buffer. In the case of TCP, I understand that the maximum transport network packet is 8 kb, so can we increase this to more than 1024 on sdk?
The current error is as follows.
Data flies so fast that it is possible to monitor only when you turn as many circles as possible and transmit a large amount of data. I ask if it is necessary to modify network packets inside LTE modem or if the maximum number of transport packets can be increased through sdk internal definition.