Required buffer sizes for MQTT authentication data

Hello everyone,

This is probably strange question, but i’d like to know if there is maximum allowed length of MQTT username, MQTT password and MQTT clientID for authentication purposes. I’m planning to read these informations from SD card and my plan is to use fixed buffer sizes for keeping authentication data after reading them from the SD card.

Thank you in advance for replies.

you can get the size of the MQTT credentials with

num1 = sizeof(username);
  num2 = sizeof(password);
  num3 = sizeof(clientID);

which are 37, 41, 37

2 Likes