-
Notifications
You must be signed in to change notification settings - Fork 3
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 Published BUG #4
Comments
Hello, Thanks for the report, is there a maximum length of the message that's been reached there ? Cheers |
Line 366 MQTT_MAX_PACKET_SIZE = 128 boolean PubSubClient::publish(const char* topic, const uint8_t* payload, unsigned int plength, boolean retained) {
if (connected()) {
here ---> if (MQTT_MAX_PACKET_SIZE < 5 + 2+strlen(topic) + plength) {
// Too long
return false;
}
// Leave room in the buffer for header and variable length field
uint16_t length = 5;
length = writeString(topic,buffer,length);
uint16_t i;
for (i=0;i<plength;i++) {
buffer[length++] = payload[i];
}
uint8_t header = MQTTPUBLISH;
if (retained) {
header |= 1;
}
return write(header,buffer,length-5);
}
return false;
} |
Ok perfect, if you want you can do a pull request so the commit is properly credited to you ? Otherwhise I can do the change. Nice catch ! |
Sign up for free
to join this conversation on GitHub.
Already have an account?
Sign in to comment
ha_mqtt_ledstrip.ino Line 178
if r = 255 g = 255 b = 255 can't send message
i fix Line 187
reduce the length of mqtt message
this can work!!
The text was updated successfully, but these errors were encountered: