jeelabs / el-client

Arduino client for esp-link's REST, MQTT, and command interface
BSD 2-Clause "Simplified" License
85 stars 47 forks source link

MQTT Message Limit 980 characters? #41

Closed Rotario closed 6 years ago

Rotario commented 6 years ago

Hi, I'm sending data fine through the EL-Client running on a Teensy 3.6 and ESP Link on an ESP-07. They're connected through Serial1.

There seems to be a max character limit at 980 characters no matter what I set ELClient.h Proto Buffer to (default 128 still sends 980 characters) https://github.com/jeelabs/el-client/blob/d559214ada405739fa235b13c7e2b42175ddbe95/ELClient/ELClient.h#L128

Can this be changed? what limits the character count?

Thanks, Rowan

Rotario commented 6 years ago

I've reduced the topic length, and the max payload length increases respectively. So I'm assuming there's a 1024 byte limit on data sent including framing overhead etc, could this be a limit from the underlying Serial libraries that ship with the Teensy or could it be EL-Client? Thanks

Rotario commented 6 years ago

Looking at the debug log I've found that putting the data length over this 1024 limit makes the CRC bad? some overflow I guess? Find the debug log below.

428682> SLIP: start or end len=0 inpkt=1 428765> SLIP: start or end len=1024 inpkt=1 428766> SLIP: bad CRC, crc=c9a6 rcv=0000 len=1024 428766> \0B\00\05\00\00\00\00\00\02\00/1\00\00\DD\0311111 *** Lots of 1s for bulk data *** 11111\00\00\00\02\00\DD\03\00\00\01\00\00\00\00\00\01\00\00\00