Closed karlvoigt closed 6 months ago
I managed to fix this issue by implementing the single line fix proposed by arjenhiemstra in issue #832 on the PubSubClient project.
This only requires adding a single line check to the following lines of PubSubClient.cpp
:
uint16_t tl = (this->buffer[llen+1]<<8)+this->buffer[llen+2]; /* topic length in bytes */
memmove(this->buffer+llen+2,this->buffer+llen+3,tl); /* move topic inside buffer 1 byte to front */
as follows:
uint16_t tl = (this->buffer[llen+1]<<8)+this->buffer[llen+2]; /* topic length in bytes */
if(!(tl < bufferSize)) return false;
memmove(this->buffer+llen+2,this->buffer+llen+3,tl); /* move topic inside buffer 1 byte to front */
Considering the ThingsboardClientSdk already ships with its own version of the PubSub library, I would suggest implementing this fix while waiting for the PubSub library to be properly updated.
Thanks a lot for the heads up will immediately start on the aforementioned fix and create a pull request so It can be merged into the custom PubSubClient version.
The own fork was originally made, out of exactly this reason as well because the PubSubClient is complety inactive and has not merged any Pull Requests in over 4 years.
PlatformIO project for ESP32 using Arduino framework. ThingsBoard 0.12.2
I noticed an issue where the ESP32 would crash if a Shared Attribute or RPC callback is received while we are uploading telemetry. I have looked through all the open and closed issues for the Thingsboard CLient SDK but could not find any relevant solutions.
I get the following error output over UART:
Whith the following trace:
The following function is called from a task to send the telemetry:
With the main loop then being used to call
tb.loop
: