bruhautomation / ESP-MQTT-JSON-Multisensor

(OBSOLETE) ESP MQTT JSON Multisensor for Home Assistant. Supported sensors include the TEMT6000 light, AM312 PIR, DHT22 temperature/humidity sensors. RGB led supports flash, fade, and transition. Over-The-Air (OTA) uploading, too!
https://youtu.be/jpjfVc-9IrQ
Apache License 2.0
340 stars 152 forks source link

MQTT_MAX_PACKET_SIZE not being recognized #7

Closed Terr4 closed 7 years ago

Terr4 commented 7 years ago

Hi there,

I have build your multisensor and have now spend quite some hours figuring out why my MQTT broker did not receive any JSON messages from it, even though it was successfully authenticated and registered and the ESP could send MQTT test messages.

It seems the parameter MQTT_MAX_PACKET_SIZE does not get applied in my case and no JSON message was sent therefore as they are longer than 128 bytes. For my testing I used your code 1:1, except for the credentials and broker server ip.

The only solution was to change the MQTT_MAX_PACKET_SIZE parameter in the library file "PubSubClient.h" itself.

I see that 8 days ago they made some changes in that area to actually make the size configurable in an INO script, however so far the mentioned "setBufferSize()" method is not available in my library version: https://github.com/knolleary/pubsubclient/pull/282/commits/5b23a97fb00f73c8f8bd4a0bcee9576ae62c8d5c

br Stefan

tomdee commented 7 years ago

@Terr4 thanks for raising this. I spent a good few hours trying to work out why I wasn't getting any MQTT messages as this turned out to be the problem

bruhautomation commented 7 years ago

Interesting. That's very strange. Sorry about the issue. I'll add a comment to the code and check into this and see if there is anything I can do. Thanks much for catching it!