Gianbacchio / ESP8266-TelegramBot

Telegram Bot Library for ESP8266 on Arduino IDE
GNU General Public License v2.0
187 stars 71 forks source link

wdt reset with using SoftwareSerial Lib from Arduino #17

Open Macci0 opened 7 years ago

Macci0 commented 7 years ago

I tried a lot things wrote in this Issue: https://github.com/esp8266/Arduino/issues/1426 (interrupt/timing problem) My workaround;

ETS_GPIO_INTR_DISABLE(); // interrupt disablen wegen softuart, da sonst wdt reset möglich
IPAddress server(149,154,167,198);
....
client.println("Connection: close"); /// zum speicher frei geben
ETS_GPIO_INTR_ENABLE(); // interrupt enablen/disablen wegen softuart, da sonst wdt reset möglich

In my Telegram-bot Lib. (Connection: close remove also a Bug if you try to send an Email an with Telegrambot usage)

With that workaround there is missing Serial Data. So i do this in my Sketch:

for (int l = 0; l < 20 ; l++)
               { 
                error = my_sds.read(&p25,&p10);
                  if (!error)   {
                                break; 
                                }
                    else       {
                                p25=-2;
                                p10=-2;
                                } 
                delay(100);
                }