Coder Social home page Coder Social logo

Comments (2)

MathewHDYT avatar MathewHDYT commented on June 25, 2024

Issue was reproducible in combination when using MQTT and enabling the usage of STREAM_UTILS it causes a crash with the ThingsBoard::connected() method more specifically the crash occurs when it attempts to call the IMQTT_Client::connected method.

Meaning it crashes on the virtually dispatched call.


I could further debug the issue it prints a InstrFetchProhibited exception and crashes with this backtrace.

Guru Meditation Error: Core  1 panic'ed (InstrFetchProhibited). Exception was unhandled.

Core  1 register dump:
PC      : 0x00000000  PS      : 0x00060d30  A0      : 0x800dce14  A1      : 0x3ffcab80  
A2      : 0x3ffc3a30  A3      : 0x3ffc3738  A4      : 0x3ffc3d54  A5      : 0x3f40025b  
A6      : 0x00000000  A7      : 0x80000001  A8      : 0x800d5bcf  A9      : 0x3ffcab60  
A10     : 0x3ffc38a0  A11     : 0x3f400276  A12     : 0xa7df7740  A13     : 0x3ffcab1c  
A14     : 0x3ffc3d54  A15     : 0x3ffcab1c  SAR     : 0x00000015  EXCCAUSE: 0x00000014  
EXCVADDR: 0x00000000  LBEG    : 0x4008abd5  LEND    : 0x4008abe5  LCOUNT  : 0xffffffff  

Backtrace: 0xfffffffd:0x3ffcab80 0x400dce11:0x3ffcac00

  #0  0xfffffffd:0x3ffcab80 in ?? ??:0
  #1  0x400dce11:0x3ffcac00 in loopTask(void*) at /.platformio/packages/framework-arduinoespressif32/cores/esp32/main.cpp:50

It seems like the method it attempts to call are invalid. That is really weird tough because the underlying object is correct, the reference does point to a valid instance of the IMQTT_Client in memory.

I'm also rather confused why this occurs only when I enable THINGSBOARD_ENABLE_STREAM_UTILS, because the only thing that define changes in the associated class is adding more methods to both the interface and the implementation.


The only thing I can think of is the stupid way that is step for step removing the code that THINGSBOARD_ENABLE_STREAM_UTILS creates and then once it does not crash anymore readding the code until it crashes again. That should hopefully help get the specific lines that cause issues.

Used that method to debug further and what I could find out is that the Print inheritance causes direct issues with not being able to call any method without crashing. If that is removed it works partially again.

But additionally the begin_publish and other added calls if THINGSBOARD_ENABLE_STREAM_UTILS is enabled do not seem to be instantiated correctly because if the checks are removed to add those methods they do not crash anymore. If that is not done tough it causes a crash if it attempts to call them.

from thingsboard-client-sdk.

MathewHDYT avatar MathewHDYT commented on June 25, 2024

The underlying issue has been resolved it was the macro, causing issues because it was sometimes overwritten correctly and other times not. To resolve that issue the library now automatically detects if the StreamUtils library is installed and if it is it enables the aforementioned feature, otherwise it does not.

Additionally there also was a small mistake in the implementation that caused disconnects even if the data could be sent. That has been resolved now as well.

from thingsboard-client-sdk.

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.