CTBot
CTBot copied to clipboard
Problem with ESP.reset()
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