-
Notifications
You must be signed in to change notification settings - Fork 115
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
maximum length of message #13
Comments
here is what i get from serial...
the string that is passed to the message send is shown msg SENT... but what is received is much sorter. i can confirm that this is the case using mqtt spy. i can send longer messages using mqtt spy. i've upped the max message size to 256 in MQTT.h but that has not helped. any ideas? |
Hmm, increasing MQTT_MAX_PACKET_SIZE in MQTT.h should have allowed slightly larger packets. It's a left-over from knolleary's original code. Also, many buffer sizes and positions are stored in 8-bit integers. So that's another limit there. I'm working on a more dynamic solution that should allow up to the maximum of 256MB packets. Of course, the ESP8266 doesn't have anywhere near that much RAM. |
Ah that would be fantastic, i did notice all the code was in uint8_t.... Solid library though. keep up the good work. Let me know if you want me to test anything |
…atform RAM size We have each message type also report the size of the variable header and payload it will write. This allows the exact packet size to be allocated before writing into it. Message::send() is simplified a little. Hopefully this helps #13.
I've pushed my changes and my little sensor node still seems to be working. I'm going to bed soon so you have a while to test it before I'm available again :) |
Im about to head off as well.. so it will be tomorrow. but thank you! |
only kidding. just tried it out, and it has published the whole message, so that has worked. Thank you. |
this is a great improvement. |
Hi, I'm new to the use of ESP and MQTT, I'm currently working on a NodeMCU v1.0. I would like to know what is the new limit length for the messages, I'm currently able to receive a 1011B payload using Mosquitto broker but I'm aiming for a 40MB payload, is this possible? My code: `#include <SPI.h> const char *ssid = "xxxxx"; IPAddress ip(192,168,200,60); // Blue 192,168,200,60 White 192,168,200,70 IPAddress server(192,168,200,80); //Broker MQTT WiFiClient wclient; #define BUFFER_SIZE 150000 void callback(const MQTT::Publish& pub) {
} else {
} void setup() { pinMode(LED_BUILTIN, OUTPUT); //Inicializacion para comunicacion SPI digitalWrite(D2, HIGH); digitalWrite(D2, LOW); //to enable /TC_EN SPI.begin(); digitalWrite(SS, HIGH); delay(1); void loop() {
} if (WiFi.status() == WL_CONNECTED) {
} //Para verificar que esta funcionando When I send a 1012B message I get this exception: Exception (9): ctx: cont
Since I'm new to this I don't really know what to do to solve it. |
What is the maximum length of message?
I'm getting quite a truncation at about 50B, when i can send massive messages using MQTT-SPY
The text was updated successfully, but these errors were encountered: