Important changes to forums and questions
All forums and questions are now archived. To start a new conversation or read the latest updates go to forums.mbed.com.
9 years, 3 months ago.
MQTT lib not supporting payload > 50 byte
I am using the MQTT lib. But unable to post Data more than 50 byte in payload. How to increase that limit of the payload? I have to send More than 200 byte as a payload.
Question relating to:
1 Answer
8 years, 10 months ago.
If you look into MQTTClient.h you can see that the default API of the client is:
template<class Network, class Timer, int MAX_MQTT_PACKET_SIZE = 100, int MAX_MESSAGE_HANDLERS = 5>
So in order to increase the packet size limit (lets say 500 byte) you could initiate the client in the HelloMQTT example with:
MQTT::Client<MQTTEthernet, Countdown, 500> client = MQTT::Client<MQTTEthernet, Countdown, 500>(lipstick);
Now you can handle messages up to 500 byte.