B4R Question max limite of payload with mqtt_messagearrived?

candide

Active Member
Licensed User
hi
i am playing with esp8266 and mqtt client and it is running well, except when i receive message by mqtt_messagereceived with payload size > 104 bytes.
with less i receive the message without problem,
with more i receive nothing, no crash, no memory lost, nothing, just message is ignored...

i did similar application on android side with B4A and we don't have this limitation

i cannot change size of message on sender side, can we change payload max size for mqtt_messagereceived on ESP8266 side ?

thanks for your help.
 

thetahsk

Active Member
Licensed User
Longtime User
You can try to change the MQTT_MAX_PACKET_SIZE size in PubSubClient.h located in your internal lib folder, and don't forget to check the #StackBufferSize.

B4X:
//#define MQTT_VERSION MQTT_VERSION_3_1
#ifndef MQTT_VERSION
#define MQTT_VERSION MQTT_VERSION_3_1_1
#endif

// MQTT_MAX_PACKET_SIZE : Maximum packet size
#ifndef MQTT_MAX_PACKET_SIZE
#define MQTT_MAX_PACKET_SIZE 128
#endif

// MQTT_KEEPALIVE : keepAlive interval in Seconds
#ifndef MQTT_KEEPALIVE
#define MQTT_KEEPALIVE 15
#endif

// MQTT_SOCKET_TIMEOUT: socket timeout interval in Seconds
#ifndef MQTT_SOCKET_TIMEOUT
#define MQTT_SOCKET_TIMEOUT 15
#endif
 
Upvote 0
Top