Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

MQTT Message Buffer Not Long Enough #2

Open
asymworks opened this issue Feb 11, 2022 · 7 comments
Open

MQTT Message Buffer Not Long Enough #2

asymworks opened this issue Feb 11, 2022 · 7 comments

Comments

@asymworks
Copy link
Owner

asymworks commented Feb 11, 2022

The Adafruit MQTT library by default seems to cut off published messages at 150 characters, without an obvious way to increase that without patching the library. This is not long enough for HA Auto-Registration messages, or for the sensor JSON data in most cases.

Tracked upstream at adafruit/Adafruit_MQTT_Library#200

@asymworks
Copy link
Owner Author

Branched from #1

@asymworks
Copy link
Owner Author

Short-term fix is to patch Adafruit_MQTT.h and change MAXBUFFERSIZE to a higher number (e.g. 300), but this will be overwritten when the Adafruit MQTT library is updated.

@mfjonesy
Copy link

After patching the Adafruit library I'm now receiving the full message but it's still not showing up in Home Assistant. Here's what the messages look like.

mqtt2

It looks like the actual data from the sensor isn't coming in?

@mfjonesy
Copy link

mfjonesy commented Feb 11, 2022

My mistake, I can see the sensors in Home Assistant, but the sensor data isn't coming in. It didn't show up under the devices for the MQTT integration so that's why I didn't see it at first.

mqtt2

Any idea why the sensor data isn't coming through?

@asymworks
Copy link
Owner Author

That is odd... you were seeing sensor data come across before, right (at least the partial messages, not necessarily valid JSON)? I'm not sure why changing the buffer length would have had any effect on the sensor data itself. Maybe try a full clean and recompile in case maybe something got weird in the build process?

@mfjonesy
Copy link

mfjonesy commented Feb 12, 2022

Well I restarted the device and it seems like it's working now!

mqtt2

Thank you so much for all your hard work helping getting this running!

@asymworks
Copy link
Owner Author

Great, glad that was all it took. Hope it continues to work well for you!

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
None yet
Projects
None yet
Development

No branches or pull requests

2 participants