A Andrej Meszaros Member Licensed User Longtime User Sep 25, 2017 #1 Hi, is there a limit for sending Payload in MQTT library ? I can send small packet .. cca 30 bytes, but packet with 255 bytes doesnt to send. Andrej
Hi, is there a limit for sending Payload in MQTT library ? I can send small packet .. cca 30 bytes, but packet with 255 bytes doesnt to send. Andrej
I inakigarm Well-Known Member Licensed User Longtime User Sep 25, 2017 #2 As B4R MQTT library is based on https://github.com/knolleary/pubsubclient , it seems that MQTT_MAX_PACKET_SIZE is hardcoded to 128 bytes in PubSubClient.h (in B4R Libraries/rMQTT Folder) I suppose that changing to 255 will do the job (NOT Tested !!) Code: Copy // MQTT_MAX_PACKET_SIZE : Maximum packet size #ifndef MQTT_MAX_PACKET_SIZE #define MQTT_MAX_PACKET_SIZE 255 #endif Upvote 0
As B4R MQTT library is based on https://github.com/knolleary/pubsubclient , it seems that MQTT_MAX_PACKET_SIZE is hardcoded to 128 bytes in PubSubClient.h (in B4R Libraries/rMQTT Folder) I suppose that changing to 255 will do the job (NOT Tested !!) Code: Copy // MQTT_MAX_PACKET_SIZE : Maximum packet size #ifndef MQTT_MAX_PACKET_SIZE #define MQTT_MAX_PACKET_SIZE 255 #endif
A Andrej Meszaros Member Licensed User Longtime User Sep 25, 2017 #3 Thank You. I will test it. Upvote 0
A Andrej Meszaros Member Licensed User Longtime User Sep 26, 2017 #4 In B4R there is no possibility to use this. // MQTT_MAX_PACKET_SIZE : Maximum packet size #ifndef MQTT_MAX_PACKET_SIZE#define MQTT_MAX_PACKET_SIZE 255#endif Upvote 0
In B4R there is no possibility to use this. // MQTT_MAX_PACKET_SIZE : Maximum packet size #ifndef MQTT_MAX_PACKET_SIZE#define MQTT_MAX_PACKET_SIZE 255#endif
I inakigarm Well-Known Member Licensed User Longtime User Sep 26, 2017 #5 Andrej Meszaros said: In B4R there is no possibility to use this. // MQTT_MAX_PACKET_SIZE : Maximum packet size #ifndef MQTT_MAX_PACKET_SIZE#define MQTT_MAX_PACKET_SIZE 255#endif Click to expand... Maybe I didn't explain correctly; this option is not in B4R IDE;you'll have to find PubSubClient.h file in B4R Libraries/rMQTT folder (search for it in your HD), and edit this field (actual value 128 and modify to 255 ) Upvote 0
Andrej Meszaros said: In B4R there is no possibility to use this. // MQTT_MAX_PACKET_SIZE : Maximum packet size #ifndef MQTT_MAX_PACKET_SIZE#define MQTT_MAX_PACKET_SIZE 255#endif Click to expand... Maybe I didn't explain correctly; this option is not in B4R IDE;you'll have to find PubSubClient.h file in B4R Libraries/rMQTT folder (search for it in your HD), and edit this field (actual value 128 and modify to 255 )
A Andrej Meszaros Member Licensed User Longtime User Sep 29, 2017 #6 Thank You for detail explain. I found the file, edit to 255 but not working. After change the buffer size to 300 I can send 256 byte packet. Upvote 0
Thank You for detail explain. I found the file, edit to 255 but not working. After change the buffer size to 300 I can send 256 byte packet.
Erel B4X founder Staff member Licensed User Longtime User Oct 1, 2017 #7 Andrej Meszaros said: After change the buffer size to 300 Click to expand... If you are using ESP8266 then you can set it to 1000 or more. Upvote 0
Andrej Meszaros said: After change the buffer size to 300 Click to expand... If you are using ESP8266 then you can set it to 1000 or more.