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 heatpump_topic limited to 17 characters #53

Closed
Moxified opened this issue Jun 8, 2017 · 1 comment
Closed

MQTT heatpump_topic limited to 17 characters #53

Moxified opened this issue Jun 8, 2017 · 1 comment

Comments

@Moxified
Copy link
Contributor

Moxified commented Jun 8, 2017

I have run into an odd issue. If I put more than 17 characters into heatpump_topic, it fails to publish and instead dumps the failed to publish warning. I tried tons of combinations until I realized it seems to be limited to any 17 or less characters including any "/" topic separators.

It only happens to the hpsettingschanged publish void. I replaced the json "buffer" variable with "test" and then I could put whatever topic I wanted. The other voids for status and timers are happy with nice and long topics.

I see in #37 that @kayno uses "home/living-area/heatpump" (which I also tried) This is over 17 so I don't understand why mine won't accept it. I'm using the mqtt_esp8266 example code. Only thing changed is the ssid, password, and topics in the .h file.

Using a huzzah.

@Moxified
Copy link
Contributor Author

Moxified commented Jun 9, 2017

Nevermind... I figured it out.

The pubsubclient library defaults to 128 max packet size. I increased MQTT_MAX_PACKET_SIZE to 256 in pubsubclient.h and now it works with larger topics. Kinda surprised others haven't seen this issue though. Hopefully it will help somebody save time in the future.

http://pubsubclient.knolleary.net/api.html#configoptions

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

1 participant