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 does not receive any message #259

Open Firemann112 opened 2 years ago

Firemann112 commented 2 years ago

Hey, the bot is not receiving any messages from me, I've tried everything but it doesn't work. Can someone help me please? I am using the FlashLED example. My ArduinoJson version is 6.18.5 and the UniversalTelegramBot version 1.3.0. I use a Wemos D1 mini V3 and have installed version 3.0.2 of the esp8266 board in the board manager. I use the Arduino IDE 1.8.15.

Ap1965 commented 2 years ago

Its the same for me. I try it the first time to connect ESP32 with telegram and nothing works.

Znarfomat commented 2 years ago

Hey, I just encountered the same problem. No messages were received. I updated Universaltelegrambot and ArduinoJson to the latest version (1.3.0 and 6.18.5) and now it works again on my Adafruit Huzzah 32. Hope this helps.

workpage2 commented 2 years ago

After initializing wifi, add the line: secured_client.setCACert(TELEGRAM_CERTIFICATE_ROOT); // Add root certificate for api.telegram.org

RosmanAndrey commented 2 years ago

Same problem

RosmanAndrey commented 2 years ago

Disabling connection security helped client.setInsecure();

felixerdy commented 2 years ago

I'm having the same issue with a SAMD21 board. Already tried different hardware. Neither older versions nor the latest version of this library is working for me ☹️. Flashing the SSL certificate on the WiFi chip did not help and using BearSSL also has no effect.

witnessmenow commented 2 years ago

I'm having the same issue with a SAMD21 board. Already tried different hardware. Neither older versions nor the latest version of this library is working for me ☹️. Flashing the SSL certificate on the WiFi chip did not help and using BearSSL also has no effect.

What network interface are you using? TLS v1.2 requirement might be the issue?

felixerdy commented 2 years ago

I'm having the same issue with a SAMD21 board. Already tried different hardware. Neither older versions nor the latest version of this library is working for me ☹️. Flashing the SSL certificate on the WiFi chip did not help and using BearSSL also has no effect.

What network interface are you using? TLS v1.2 requirement might be the issue?

I'm using a WINC1500 based module and flashed the latest firmware (19.6.1) using the Arduino Firmware / Certificates Updater. That should have TLS v1.2 included or am I wrong?

Just enabled the debug flags with the following serial output:

16:05:27.137 -> GET Update Messages
16:05:27.137 -> [BOT]Connecting to server
16:05:47.147 -> [BOT]Conection error
16:05:47.147 -> Received empty string in response!
witnessmenow commented 2 years ago

I have no idea , I don't see the version it supports mentioned in the documentation I looked at. I've never used the chip before so I can't really comment on it. I think it would be best to raise a separate issue for this in case someone else has knowledge on it

albadrun commented 2 years ago

Hi, I have to initialize the secured_client manually to make it works. Something like this.

const char fingerprint[] PROGMEM = "F2 AD 29 9C 34 48 DD 8D F4 CF 52 32 F6 57 33 68 2E 81 C1 90";

WiFiClientSecure https_client;
UniversalTelegramBot bot(BOT_TOKEN, https_client);

void setup() {
  // manual setup https related
  https_client.setFingerprint(fingerprint);
  https_client.setTimeout(15000)
}

The fingerprint var is telegram fingerprint for certificate, can retrieve it from lock badge beside url on your browser.

AndreyUshak commented 2 years ago

Hi, the same thing, wemos esp8266, tried different ESP versions, doesn't get a response, works on other libraries, maybe something with the certificate?

tglaria commented 2 years ago

Doesn't work for me when using WiFi101 library and using AT WINC1500 wifi board. I can connect to WiFi, but can't connect to the Telegram servers.

I'm guessing either the ssl certificate is not correctly sent or an error with the local time.

orimate commented 7 months ago

I faced this error after I restarted my project after 2 years again. I connected my wemos d1 mini via Wlan with my cell phone hotspot. (Samsung S23). I was not able to get my bot online until I went home and I connected the chip directly with my router. The bot came online. So it seems that the Phone blocked something. Maybe this helps.

danielPaggio commented 7 months ago

Same here.If I get trough mobile data then Bot Connection error but some times works. If its someone who understand why???

orimate commented 6 months ago

Yesterday I travelled to my Mom. I wanted to get my bot online. This sketch was completely good at home. I tried with a "normal" (not via phone hotspot) internet connection. I got the same error as earlier via hotspot. I don't have any idea why the bot works at home and why not hier (Mom) and not with my hotspot. (I tried with Samsung S23 and Xiaomi Redmi 11S)

[BOT]Connecting to server<\r><\n> [BOT]Conection error<\r><\n> Received empty string in response!<\r><\n>