ESP32 reboot when using wifi and timer iterrupt
Posted: Thu Mar 17, 2022 1:54 pm
Hello community
I try to send via UDP data from my ESP32 to my laptop. Sending the data in the loop()-fuction works without any problems.
Now I want to send the data using an interrupt fuction (timer based).
void IRAM_ATTR onTimer()
{
Serial.println("test");
if(connected){
//Send a packet
udp.beginPacket(udpAddress,udpPort);
udp.printf("test");
udp.endPacket();
}
}
The timer starts and the ESP32 connects to my wifi, but after 2 seconds the ESP32 resets. Then the timer starts again and the ESP32 connects again and so on.
Without sending data via udp there is no reset.
DO you have any ideas what my problem is?
Thanks for you help
Yours Lukas
I try to send via UDP data from my ESP32 to my laptop. Sending the data in the loop()-fuction works without any problems.
Now I want to send the data using an interrupt fuction (timer based).
void IRAM_ATTR onTimer()
{
Serial.println("test");
if(connected){
//Send a packet
udp.beginPacket(udpAddress,udpPort);
udp.printf("test");
udp.endPacket();
}
}
The timer starts and the ESP32 connects to my wifi, but after 2 seconds the ESP32 resets. Then the timer starts again and the ESP32 connects again and so on.
Without sending data via udp there is no reset.
DO you have any ideas what my problem is?
Thanks for you help
Yours Lukas