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 size too short for full binary update #3

Open
Pakue95 opened this issue Sep 26, 2018 · 5 comments
Open

MQTT message size too short for full binary update #3

Pakue95 opened this issue Sep 26, 2018 · 5 comments

Comments

@Pakue95
Copy link
Member

Pakue95 commented Sep 26, 2018

Right now the MQTT doesn't like to send/receive more than 103 bytes. Longer messages get ignores.

@NitramLegov
Copy link
Member

The problem is within the adafruit library:
https://github.com/adafruit/Adafruit_MQTT_Library/blob/master/Adafruit_MQTT.h

It defines the maximum message length :
// how much data we save in a subscription object
// and how many subscriptions we want to be able to track.
#if defined (AVR_ATmega32U4) || defined(AVR_ATmega328P)
#define MAXSUBSCRIPTIONS 5
#define SUBSCRIPTIONDATALEN 20
#else
#define MAXSUBSCRIPTIONS 15
#define SUBSCRIPTIONDATALEN 100
#endif

Unfortunately it is a define and not a variable. Thus, as far as I know we would have to fork the library in order to change the value.

@Pakue95
Copy link
Member Author

Pakue95 commented Sep 27, 2018

I tried increasing this value, but the limit still is present. Maybe another hard-coded max value somewhere?

@Pakue95
Copy link
Member Author

Pakue95 commented Sep 27, 2018

Someone else also has that problem. Should be fixed however...

adafruit/Adafruit_MQTT_Library#17

@NitramLegov
Copy link
Member

NitramLegov commented Oct 13, 2018

I think in order to fix this problem, we should switch to another implementation of MQTT on our microcontrollers.
There is a embedded-c version made by the eclipse paho project here. I am not sure if it will run on the ESP though.
There seems to be a port by "tuanpmt" here
Another MQTT implementation is available by espressif here, which seems to be based on the above mentioned port by tuanmpt.
Then there is pubsubclient, which is capable of changing the maximum package size by adjusting the header file. It is limited regarding QoS, but that shouldn´t be critical in our case.

I would say we should try the clients in order to see which one fits best. right now, i would prefer the one from eclipse or espressif

@Pakue95
Copy link
Member Author

Pakue95 commented Oct 14, 2018

Might be an opportunity to change the development environment from Arduino to Espressif.

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