-
Notifications
You must be signed in to change notification settings - Fork 53
New issue
Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.
By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.
Already on GitHub? Sign in to your account
No message received with Code similar to Echo example #35
Comments
I guess, I found the problem(s). First of all, #32 needs to get merged as ArduinoJson 6 has changes made that are not compatible with ArduinoJson 5. Secondly, the client just doesn't connect: If you change the following lines in void TelegramBot::begin() {
if(!client->connected()) {
client->connect(HOST, SSL_PORT);
}
} to void TelegramBot::begin() {
if(!client->connected()) {
if(client->connect(HOST, SSL_PORT)) {
Serial.println("Connected");
}
else {
Serial.println("Connection failed");
}
}
} you will see that the connection always fails. I just still have no idea why this happens... P.S. Link to the client documentation: https://www.arduino.cc/en/Reference/EthernetClient I will post updates here once I find out more... |
I guess, that Telegram has changed something in their API and that the library (or the Client.h library) can't handle TLS... |
@epiCS97 References: schlingensiepen/TelegramBotClient#6 and witnessmenow/Universal-Arduino-Telegram-Bot#104... |
Hi there, I need some help. I've coded something thats very similar to the Echo example. The only major thing i changed is that i send a custom message as soon as the ESP gets power.
I checked the IDs and stuff multiple times.
Here is the code:
#include <TelegramBot.h>
#include <ESP8266WiFi.h>
#include <WiFiClientSecure.h>
//------- WiFi Settings -------
const char* ssid = "epiCS-AP";
const char* password = "Password";
// ------- Telegram config --------
const char BotToken[] = "Token";
const char chat_id[] = "ID";
// SSL client
WiFiClientSecure net_ssl;
TelegramBot bot (BotToken, net_ssl);
void setup() {
// put your setup code here, to run once:
Serial.begin(115200);
while(!Serial)
// Attempt to connect to Wifi network:
Serial.print("Connecting Wifi: ");
Serial.println(ssid);
WiFi.begin(ssid, password);
while (WiFi.status() != WL_CONNECTED) {
Serial.print(".");
delay(500);
}
Serial.println("");
Serial.println("WiFi connected");
bot.begin();
Serial.println("START");
}
void loop() {
Serial.println("ALERT");
delay(2000);
Serial.println("STILL ALERT");
String message = "EINSATZ!";
if(bot.sendMessage(chat_id, message)){
Serial.println("TELEGRAM Successfully sent");
}
else{
Serial.println("TELEGRAM NOT Successfully sent");
}
delay(300000);
}
And here is the Serial output:
epiCS-AP
..................
WiFi connected
START
ALERT
STILL ALERT
TELEGRAM Successfully sent
I don't understand why it doesn't work, but maybe you have a clue.
The text was updated successfully, but these errors were encountered: