cotestatnt / AsyncTelegram2

Powerful, flexible and secure Arduino Telegram BOT library. Hardware independent, it can be used with any MCU capable of handling an SSL connection.
MIT License
83 stars 25 forks source link

Esp8266 reboot because hardware watchdog twice in 5 minutes #48

Closed joroMaser closed 2 years ago

joroMaser commented 2 years ago

I run this library in esp8266 and I got reboot 2 reboot in 5 minutes (I don't know how to print core dump) but here is the log of Hardware WDT Timeout when the library cannot connect to Telegram server. That happened in idle ...I didn't get any new message.

I know that is Hardware WDT Timeout because of this function that run in setup

void send_startup_reason() {
  String doc = "Startup  ";
  struct rst_info* pRstInfo = system_get_rst_info();
  switch (pRstInfo->reason) {
    default: doc += "Unknown"; break;
    case REASON_DEFAULT_RST: doc += "Power On (normal)"; break;
    case REASON_WDT_RST: doc += "Hardware WDT Timeout"; break;
    case REASON_EXCEPTION_RST: doc += "Exception"; break;
    case REASON_SOFT_WDT_RST: doc += "Software WDT Timeout"; break;
    case REASON_SOFT_RESTART: doc += "Soft Restart"; break;
    case REASON_DEEP_SLEEP_AWAKE: doc += "Deep Sleep Awake"; break;
    case REASON_EXT_SYS_RST: doc += "External System Reset"; break;
  }
  myBot.sendTo(MY_USER_ID, doc);

Hers is the log :


[D][AsyncTelegram2.cpp:144] getUpdates():   Connection closed from server
[D][AsyncTelegram2.cpp:28] checkConnection():   Start handshaking...
[D][AsyncTelegram2.cpp:34] checkConnection():   Connected using Telegram hostname
Last connection was 304 seconds ago

[D][AsyncTelegram2.cpp:144] getUpdates():   Connection closed from server
[D][AsyncTelegram2.cpp:28] checkConnection():   Start handshaking...
[D][AsyncTelegram2.cpp:34] checkConnection():   Connected using Telegram hostname
Last connection was 300 seconds ago

[D][AsyncTelegram2.cpp:144] getUpdates():   Connection closed from server
[D][AsyncTelegram2.cpp:28] checkConnection():   Start handshaking...

Unable to connect to Telegram server

[D][AsyncTelegram2.cpp:28] checkConnection():   Start handshaking...

Unable to connect to Telegram server

[D][AsyncTelegram2.cpp:28] checkConnection():   Start handshaking...
[D][AsyncTelegram2.cpp:34] checkConnection():   Connected using Telegram hostname
Last connection was 361 seconds ago

[D][AsyncTelegram2.cpp:54] reset(): Restart Telegram connection

[D][AsyncTelegram2.cpp:28] checkConnection():   Start handshaking...
[D][AsyncTelegram2.cpp:34] checkConnection():   Connected using Telegram hostname
Last connection was 82 seconds ago

[D][AsyncTelegram2.cpp:54] reset(): Restart Telegram connection

[D][AsyncTelegram2.cpp:28] checkConnection():   Start handshaking...

Unable to connect to Telegram server

########################################################
################Startup  Hardware WDT Timeout
########################################################

⸮⸮⸮⸮T⸮9⸮⸮Starting TelegramBot...
.......................................................................192.168.1.126

Test Telegram connection... 
[D][AsyncTelegram2.cpp:28] checkConnection():   Start handshaking...
[D][AsyncTelegram2.cpp:34] checkConnection():   Connected using Telegram hostname
Last connection was 12 seconds ago

[D][AsyncTelegram2.cpp:323] getMe():    
{
  "ok": true,
  "result": {
    "id": XXXXXXX,
    "is_bot": true,
    "first_name": "XXXXXXXX",
    "username": "XXXXXXXX",
    "can_join_groups": true,
    "can_read_all_group_messages": false,
    "supports_inline_queries": false
  }
}
OK

[D][AsyncTelegram2.cpp:54] reset(): Restart Telegram connection

[D][AsyncTelegram2.cpp:28] checkConnection():   Start handshaking...
[D][AsyncTelegram2.cpp:34] checkConnection():   Connected using Telegram hostname
Last connection was 53 seconds ago

[D][AsyncTelegram2.cpp:54] reset(): Restart Telegram connection

[D][AsyncTelegram2.cpp:28] checkConnection():   Start handshaking...

Unable to connect to Telegram server

[D][AsyncTelegram2.cpp:28] checkConnection():   Start handshaking...
[D][AsyncTelegram2.cpp:34] checkConnection():   Connected using Telegram hostname
Last connection was 41 seconds ago

[D][AsyncTelegram2.cpp:54] reset(): Restart Telegram connection

[D][AsyncTelegram2.cpp:28] checkConnection():   Start handshaking...
[D][AsyncTelegram2.cpp:34] checkConnection():   Connected using Telegram hostname
Last connection was 23 seconds ago

[D][AsyncTelegram2.cpp:54] reset(): Restart Telegram connection

[D][AsyncTelegram2.cpp:28] checkConnection():   Start handshaking...
[D][AsyncTelegram2.cpp:34] checkConnection():   Connected using Telegram hostname
Last connection was 46 seconds ago

[D][AsyncTelegram2.cpp:54] reset(): Restart Telegram connection

[D][AsyncTelegram2.cpp:28] checkConnection():   Start handshaking...

Unable to connect to Telegram server

########################################################
################Startup  Hardware WDT Timeout
########################################################

⸮؁Z⸮⸮⸮0Starting TelegramBot...
..............................................192.168.1.126

Test Telegram connection... 
[D][AsyncTelegram2.cpp:28] checkConnection():   Start handshaking...
[D][AsyncTelegram2.cpp:34] checkConnection():   Connected using Telegram hostname
Last connection was 8 seconds ago

[D][AsyncTelegram2.cpp:323] getMe():    
{
  "ok": true,
  "result": {
    "id": xxxxxx,
    "is_bot": true,
    "first_name": "xxxxxxx",
    "username": "xxxxxx",
    "can_join_groups": true,
    "can_read_all_group_messages": false,
    "supports_inline_queries": false
  }
}
OK

[D][AsyncTelegram2.cpp:54] reset(): Restart Telegram connection

[D][AsyncTelegram2.cpp:28] checkConnection():   Start handshaking...
[D][AsyncTelegram2.cpp:34] checkConnection():   Connected using Telegram hostname
Last connection was 82 seconds ago

[D][AsyncTelegram2.cpp:54] reset(): Restart Telegram connection

[D][AsyncTelegram2.cpp:28] checkConnection():   Start handshaking...
[D][AsyncTelegram2.cpp:34] checkConnection():   Connected using Telegram hostname
Last connection was 64 seconds ago

[D][AsyncTelegram2.cpp:144] getUpdates():   Connection closed from server
[D][AsyncTelegram2.cpp:28] checkConnection():   Start handshaking...
[D][AsyncTelegram2.cpp:34] checkConnection():   Connected using Telegram hostname
Last connection was 334 seconds ago
cotestatnt commented 2 years ago

Should be the same is as this https://github.com/cotestatnt/AsyncTelegram2/issues/46