You signed in with another tab or window. Reload to refresh your session.You signed out in another tab or window. Reload to refresh your session.You switched accounts on another tab or window. Reload to refresh your session.Dismiss alert
So I have tried latest [email protected] and [email protected], but with the same result. There is a connection with internet, but the bot is unresponsive.
Please look into this scatch, I'm trying to reproduce echoBot example here:
#include<ESP8266WiFi.h>
#include<WiFiClientSecure.h>
#include<UniversalTelegramBot.h>
#include<ESP8266WebServer.h>
#include<WiFiManager.h>
#defineBOT_TOKEN_LENGTH47char BOTtoken[BOT_TOKEN_LENGTH] = "XXXXXXXXX:xxxxxxxxxxxxxxxxxxxxxxxxx";
X509List cert(TELEGRAM_CERTIFICATE_ROOT);
WiFiClientSecure client_secure;
UniversalTelegramBot *bot;
int BOT_MTBS = 1000; // mean time between scan messageslong bot_lasttime; // last time messages' scan has been donevoidhandleNewMessages(int numNewMessages) {
for (int i = 0; i < numNewMessages; i++) {
bot->sendMessage(bot->messages[i].chat_id, bot->messages[i].text, "");
}
}
voidsetup() {
Serial.begin(74880);
WiFiManager wifiManager;
client_secure.setTrustAnchors(&cert);
wifiManager.autoConnect("AP_door", "pwd");
if (WiFi.status() == WL_CONNECTED) {
bot = newUniversalTelegramBot(BOTtoken, client_secure);
}
}
voidloop() {
if (millis() - bot_lasttime > BOT_MTBS) {
int numNewMessages = bot->getUpdates(bot->last_message_received + 1);
while (numNewMessages) {
Serial.println("got response");
handleNewMessages(numNewMessages);
numNewMessages = bot->getUpdates(bot->last_message_received + 1);
}
bot_lasttime = millis();
}
}
So I have tried latest [email protected] and [email protected], but with the same result. There is a connection with internet, but the bot is unresponsive.
Please look into this scatch, I'm trying to reproduce echoBot example here:
My
platformio.ini
:The text was updated successfully, but these errors were encountered: