witnessmenow / Universal-Arduino-Telegram-Bot

Use Telegram on your Arduino (ESP8266 or Wifi-101 boards)
MIT License
1.09k stars 302 forks source link

bot.getUpdates takes long time #216

Open valentyn-zaitsev opened 3 years ago

valentyn-zaitsev commented 3 years ago

Hello! I tested the TelegramBot library and noticed that the next line takes about 3.5 seconds. It's very long.

int numNewMessages = bot.getUpdates(bot.last_message_received + 1);

(It can be reduced by reducing bot.waitForResponse to 200, but the best result is 1.5 second. It's also too long.

Who is faces with this before, why it's so long delay? Can it be fixed somehow?

RomeHein commented 3 years ago

Yeah same here. The best way would be to use websockets, but that would mean an asyncTCP library that would handle https...

mgx0 commented 3 years ago

Setting connection to insecure would help in my opinion. All I care about is encrypted communication. Having correct time set, verified certificate is nice but not for this cpu and for this purpose.

Try insecure client but still https