Gianbacchio / ESP8266-TelegramBot

Telegram Bot Library for ESP8266 on Arduino IDE
GNU General Public License v2.0
188 stars 71 forks source link

Erro #1

Open fernandopasse opened 8 years ago

fernandopasse commented 8 years ago

Is not working

Gianbacchio commented 8 years ago

please, specify what's wrong: don't compile, crash, do not connect, nothing on telegram...

fernandopasse commented 8 years ago

Sorry, this method is not working

String TelegramBOT::connectToTelegram(String command) { String mess=""; long now; bool avail; // Connect with api.telegram.org
IPAddress server(149,154,167,198); if (client.connect(server, 443)) {
Serial.println(".... connected to server"); String a=""; char c; int ch_count=0; client.println("GET /"+command); now=millis(); avail=false; while (millis()-now<1500) {
while (client.available()) { char c = client.read(); //Serial.write(c); if (ch_count<700) { mess=mess+c; ch_count++; } avail=true; } if (avail) { //Serial.println(); //Serial.println(mess); //Serial.println(); break; } } } return mess; }

Not connecting to the server