CTBot icon indicating copy to clipboard operation
CTBot copied to clipboard

Problem with ESP.reset()

Open bosoft-ESP opened this issue 10 months ago • 4 comments

Hello I have tried to implement a reset to an ESP01S via a telegram text message. The function is: `

if (msg.text.indexOf(F("RESET_ESP")) != -1){ myBot.sendMessage(msg.sender.id,"RESET of the ESP received"); msg.text = ""; delay(1000); ESP.reset(); }

On receiving 'RESET_ESP', it sends the message “RESET of the ESP received” and executes ESP.reset(). The problem is at startup. The ESP receives 'RESET_ESP' again and resets indefinitely, and there is no way to stop it. I have implemented this before resetting: while (myBot.getNewMessage(msg)){ delay(1000); msg.text = ""; }` But it keeps receiving from telegram 'RESET_ESP'. This last function I have also put it in the setup(), but it does not detect pending text. . The ESP is still receiving 'RESET_ESP'. Any idea?

Regards

bosoft-ESP avatar Apr 28 '24 08:04 bosoft-ESP