Giter Site home page Giter Site logo

Comments (5)

gak avatar gak commented on July 30, 2024 2

Increasing MAXBUFFERSIZE does the trick. Not sure how stable this solution is but it works for me so far.

Edit: Still had issues. Went with https://github.com/plapointe6/EspMQTTClient which allows changing the max packet size and worked first go.

from adafruit_mqtt_library.

gak avatar gak commented on July 30, 2024

I'm having a similar issue, but it's only sending 89 chars. It's on an ESP32-S2. Using 2.4.2 installed via the Arduino IDE.

If I set QoS to 1 or 2, it fails to send at all.

char encoded[2000];

// Some JSON generation here.
// I've tried this with just creating a long string by hand, e.g.:
// char *encoded = "very long string";
// with exactly the same truncation.

Serial.println(motion_config_topic.c_str());
Serial.println(encoded);
Serial.println(strlen(encoded));

if (!messages->publish(motion_config_topic.c_str(), encoded, 0)) {
    Serial.println("Failed to send motion config.");
}

The related output:

16:50:01.893 -> homeassistant/binary_sensor/esp32s2-0edc60-motion/config
16:50:01.893 -> {"name":"esp32s2-0edc60","unique_id":"esp32s2-0edc60-motion","device_class":"motion","state_topic":"homeassistant/binary_sensor/esp32s2-0edc60-motion/state"}
16:50:01.893 -> 157

I've successfully sent a longer message using using another MQTT client. I've received the truncation using two separate clients (home assistant and a rust app). Here is the truncated message for completeness:

{"name":"esp32s2-0edc60","unique_id":"esp32s2-0edc60-motion","device_class":"motion","sta

from adafruit_mqtt_library.

SaberShip avatar SaberShip commented on July 30, 2024

I have this exact issue, seems to always send 88 characters for me before truncating my message. Seems like a pretty big issue.

from adafruit_mqtt_library.

MEHUL95 avatar MEHUL95 commented on July 30, 2024

Exactly same issue, I am facing. Now moving back to move to pubsub client lib again.

from adafruit_mqtt_library.

jsphuebner avatar jsphuebner commented on July 30, 2024

Increasing MAXBUFFERSIZE also "fixed" it for me. Should be configurable or larger in the first place, maybe depending on platform.

from adafruit_mqtt_library.

Related Issues (20)

Recommend Projects

  • React photo React

    A declarative, efficient, and flexible JavaScript library for building user interfaces.

  • Vue.js photo Vue.js

    🖖 Vue.js is a progressive, incrementally-adoptable JavaScript framework for building UI on the web.

  • Typescript photo Typescript

    TypeScript is a superset of JavaScript that compiles to clean JavaScript output.

  • TensorFlow photo TensorFlow

    An Open Source Machine Learning Framework for Everyone

  • Django photo Django

    The Web framework for perfectionists with deadlines.

  • D3 photo D3

    Bring data to life with SVG, Canvas and HTML. 📊📈🎉

Recommend Topics

  • javascript

    JavaScript (JS) is a lightweight interpreted programming language with first-class functions.

  • web

    Some thing interesting about web. New door for the world.

  • server

    A server is a program made to process requests and deliver data to clients.

  • Machine learning

    Machine learning is a way of modeling and interpreting data that allows a piece of software to respond intelligently.

  • Game

    Some thing interesting about game, make everyone happy.

Recommend Org

  • Facebook photo Facebook

    We are working to build community through open source technology. NB: members must have two-factor auth.

  • Microsoft photo Microsoft

    Open source projects and samples from Microsoft.

  • Google photo Google

    Google ❤️ Open Source for everyone.

  • D3 photo D3

    Data-Driven Documents codes.