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

Problem with long topic string #262

Closed
joehui opened this Issue Mar 28, 2017 · 2 comments

Comments

Projects
None yet
2 participants
@joehui

joehui commented Mar 28, 2017

Hi,

I am trying to use pubsubclient for an MQTT subscriber for devicehub.net using an ESP32 device.

I ran into a lot of problems with seemingly simple code. After many trial and error, I found that if the topic string is too long (longer 109 characters), the client will not work. By that, I meant the callbacks will not be called for new messages to that topic. With devicehub.net, it is quite easy to get such long string. For example,

"/a/75ae2ce1-af0f-44b0-8a2c-d39b9c4d7da7/p/12345/d/5f650aba-f1f0-4069-a590-d2bcc6fcacdb/actuator/myActuator/state"

I am not sure if the problem is specific to ESP32 or not. I hope the problem will get fixed soon.

Thanks,
Joseph

@knolleary

This comment has been minimized.

Show comment
Hide comment
@knolleary

knolleary Mar 28, 2017

Owner

Have you increased the max message size setting in PubSubClient.h? The default is 128 which won't leave you much room if your topic is 109 chars.

Owner

knolleary commented Mar 28, 2017

Have you increased the max message size setting in PubSubClient.h? The default is 128 which won't leave you much room if your topic is 109 chars.

@joehui

This comment has been minimized.

Show comment
Hide comment
@joehui

joehui Mar 28, 2017

Thanks for the quick response. Yes, that was the problem. Increasing it to 512 solves this and some other problems I have!

joehui commented Mar 28, 2017

Thanks for the quick response. Yes, that was the problem. Increasing it to 512 solves this and some other problems I have!

@joehui joehui closed this Mar 28, 2017

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment