shurillu / CTBot

A simple (and easy to use) Arduino Telegram BOT Library for ESP8266/ESP32
MIT License
147 stars 34 forks source link

CTBot v.1.4.0 does not connect since March-22, 2020 #45

Closed jbrepogmailcom closed 4 years ago

jbrepogmailcom commented 4 years ago

Hello, even your pure example does not connect for several days. I have tried three different wifi networks, still "testConnection NOK". Can you please test that the example works without any modifications on 1.4.0? Thanks

shurillu commented 4 years ago

Hello jbrepogmailcom, I've just checked with useDNS(true) (with URL) and useDNS(false) (with static IP) and it just work. So, a dumb question: have you double checked the telegram token? Maybe checking the BotFather.. A suggestion: enable the debug mode (in CTBot.h) and take a look to the serial monitor: maybe you can find some useful hints!

Let me know, cheers

Stefano

shurillu commented 4 years ago

I forgot:

jbrepogmailcom commented 4 years ago

Hello, thank you for quick response. I have all versions correct as you write. I also tried two different boards where other wifi sketches work fine. I tried that Telegram works by calling "https://api.telegram.org/bot---my_token---/sendMessage?chat_id=---my_ID---&text=Test" (that worked, so bot is OK).After I enabled debugging, I get this log:

Starting TelegramBot... Connecting to wifi...

Connecting Wifi: Bez_hesla_is_back! ...... WiFi connected IP address: 10.0.0.2 1 ...connected.

Connected using fixed IP TLG connectivity... 0 getMe error:{"ok":false,"error_code":502,"description":"Bad Gateway"} testConnection NOK

When I created sketch that connects https and I inserted above URL there and correct fingerprint, it worked fine. So I think there may be a bug in your library.

Jan

shurillu commented 4 years ago

Mmm weird behavior... Try to change the fixed Telegram IP to 149.154.167.220 like another user does here #44 (file: CTBot.cpp) I checked both IPs and works. Pelase, let me know if that fix works.

Stefano

shurillu commented 4 years ago

Ok, doing some research and pinging the api.telegram.org it answer as 149.154.167.220, so try to use this one. I can't still figure out why when I use the 149.154.167.198 IP the bot still works. Anyway, have you tried to use the URL mode in spite of using fixed IP by calling the useDNS(true) member function?

Stefano

jbrepogmailcom commented 4 years ago

Hello new IP works, thank you, closing the issue. I noticed that telegram certificate is valid until May-23, 2020. Does it mean that CTBot will stop working if the certificate is not updated right after May-23?