mysensors / MySensors

MySensors library and examples
https://www.mysensors.org
1.32k stars 895 forks source link

ESP32 gateway freezes #1443

Open rikki78 opened 4 years ago

rikki78 commented 4 years ago

I've been experiencing freezes on the RFM 69 gateway and I do not understand what is wrong.

I'm using a standard, example sketch with the following defines:

#define MY_RADIO_RFM69
#define MY_RFM69_NEW_DRIVER
#define MY_GATEWAY_ESP32  
#define MY_GATEWAY_MQTT_CLIENT
#define MY_DEBUG_VERBOSE_CORE
#define MY_INDICATION_HANDLER

The gateway works well for a while, but at some point just freezes and nothing is happening anymore.

Since the ESP32 has dual cores and multiple tasks, I've started another task which prints the value of a debug variable every 10 seconds. This tasks is not affected when the gateway freezes. To trace where the freeze happens, I'm setting the debug variable to a different value throughout the program - I'm limited in my tools but this works well - and the value is being printed in the serial log. After the print the value is reset to 0. On an interrupt I add a value (2) to the debug variable, so it can be seen if the interrupt is still occurring. Concluded is that the gateway always freezes at the same point in the program. No idea why, it seems like proper code to me. The interrupt is fired once more, but once only.

This is the location in the program after which the program halts: https://github.com/mysensors/MySensors/blob/master/core/MyTransport.cpp#L466

So this line is still executed, but it doesn't continue anymore.

I will try updating to espressif 2.0 to see if that makes a difference, as it seems like something not caused by the MySensors framework

rikki78 commented 4 years ago

The update to Espressif framework 2.0 didn't make a difference either. Do you have a clue @tekka007 ?