Closed arihantdaga closed 3 years ago
Hi. When in debug mode there is a lot of info coming out from serial port. It may happen that Serial is not fast enough to deliver all data and a bigger overflow occurs, resulting in a watchdog exception and consequent reboot.
Try to reduce debug to warning level and test again. If the error keeps happening you may try to change DEBUG_DBG lines to DEBUG_WARN so you are able to see some messages in warning only mode.
Anyway you can use mqtt gateway code as it is without any change. I've been using it for months with 10 different nodes now. I recommend to use Platformio to compile the code.
@gmag11 . Thank you. That helped. After lowering debug level, it is not crashing. But i am really curious about it, how could it lead to crash, it's not a memory overflow problem, also, serial in esp32 is definitely faster than esp8266. Is enigmaIoT functions running in timers or some async manner? I was assuming everything is running in the same thread and is handled by EnigmaIOTGateway.handle() method. And also why do we need to disable interrupts when pushing in the queue? I am sorry for being so curious. But i just wish to understand it better to contribute further in the development of this library.
Got it working. Thanks. Closing.
Hello, Thank you very much @gmag11 for this project. I started using it recently for one of my application. So far it has been working great, i was using esp8266 gateway. But then due to heap shortage, i decided to switch to esp32 for the gateway. But i think something is crashing esp32 in the addInputMsqQueue function. I am realtively new to esp32, so i could not pinpoint the reason. I am using a slightly modified version of EnigmaIOTGatewayDummy example. Its working with esp8266 perfectly. In esp8266i get this in logs
But in esp32
It did not reach EnigmaIOTGateway.cpp:815. And i saw something like
portENTER_CRITICAL (&myMutex);
in addInputMsgQueue. So i understand something is special here. But i could not understand why is it crashing here.