witnessmenow / Universal-Arduino-Telegram-Bot

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

Receive problems with "LILYGO® TTGO T5-4.7 Inch E-paper ESP32 V3" hardware #284

Closed josefkaeufl closed 2 years ago

josefkaeufl commented 2 years ago

Hi,

I am using a LilyGo ESP32 ePaper hardware and I cannot properly receive messages with it.

I flashed the Echo example at the uC but it is not able to receive a message, which was sent to it after the uC finished setup(). In case a message was sent earlier, then it will be received in the first loop() run and a response will be sent back. Any other message later on will not be received again.

When starting my ESP8266 board, which is also connecting to the same telegram bot, it will again receive all (!) messages, which were received and responded by the ESP32 and/or the ones the ESP32 did not receive.

Has anyone had already the same problems with an ESP WROVER E board?

josefkaeufl commented 2 years ago

I tried another ESP32 (WROOM-32) just to see if the problem is the hardware or the software. And - surprise - same issue, so the problem seems to sit in front of the laptop. :)

I switched on the debug messages from the lib and this is what i get (see below)

It looks like the program receives the "hello" and responds, but afterwards something goes wrong. It cannot connect to the server. The behavior in telegram is that I get the response "hallo" from the bot but no new message (also after reset) will be received. The ESP32 board receives the message "hallo" again after each reset. (see picture)

18:56:10.182 -> Connecting to Wifi SSID Seppnet..... 18:56:12.799 -> WiFi connected. IP address: 192.168.0.186 18:56:12.799 -> Retrieving time: .................................................................1652201779 18:56:19.306 -> GET Update Messages 18:56:19.306 -> [BOT]Connecting to server 18:56:27.116 -> sending: botxxx:xxxx/getUpdates?offset=1&limit=1 18:56:27.150 -> 18:56:27.187 -> {"ok":true,"result":[{"update_id":xxx, 18:56:27.187 -> "message":{"message_id":2,"from":{"id":xxx,"is_bot":false,"first_name":"xxx","username":"xxx","language_code":"de"},"chat":{"id":xxx,"first_name":"xxx","username":"xxx","type":"private"},"date":1652201257,"text":"hallo"}}]} 18:56:27.187 -> 18:56:27.187 -> incoming message length 294 18:56:27.187 -> Creating DynamicJsonBuffer 18:56:27.187 -> GetUpdates parsed jsonObj: {"ok":true,"result":[{"update_id":xxx,"message":{"message_id":2,"from":{"id":xxx,"is_bot":false,"first_name":"xxx","username":"xxx","language_code":"de"},"chat":{"id":xxx,"first_name":"xxx","username":"xxx","type":"private"},"date":1652201257,"text":"hallo"}}]} 18:56:27.222 -> got response 18:56:27.222 -> sendPostMessage: SEND Post Message: {"chat_id":"xxx","text":"hallo"} 18:56:27.222 -> Posting:{"chat_id":"xxx","text":"hallo"} 18:56:27.528 -> 18:56:27.528 -> {"ok":true,"result":{"message_id":6,"from":{"id":xxx,"is_bot":true,"first_name":"xxx","username":"xxx"},"chat":{"id":xxx,"first_name":"xxx","username":"xxx","type":"private"},"date":1652201787,"text":"hallo"}} 18:56:27.563 -> 18:56:27.563 -> {"ok":true,"result":{"message_id":6,"from":{"id":xxx,"is_bot":true,"first_name":"xxx","username":"xxx"},"chat":{"id":xxx,"first_name":"xxx","username":"xxx","type":"private"},"date":1652201787,"text":"hallo"}} 18:56:27.563 -> Closing client 18:56:27.563 -> GET Update Messages 18:56:27.563 -> [BOT]Connecting to server 18:56:27.665 -> [BOT]Conection error 18:56:27.665 -> Received empty string in response! 18:56:28.648 -> GET Update Messages 18:56:28.648 -> [BOT]Connecting to server 18:56:28.748 -> [BOT]Conection error 18:56:28.748 -> Received empty string in response!

https://ibb.co/nwcmJnk

Josef, [10.05.2022, 18:42:50]: /start hallo Esp32TestBot, [10.05.2022, 18:48:14]: hallo Josef, [10.05.2022, 18:48:21]: was geht Esp32TestBot, [10.05.2022, 18:49:13]: hallo Esp32TestBot, [10.05.2022, 18:56:20]: hallo Esp32TestBot, [10.05.2022, 19:07:57]: hallo

I already tried ArduinoJson v6.18.0 as suggested by other users instead of the latest one, but without success.

josefkaeufl commented 2 years ago

Found some time to play around with lib/packet versions and now it works.

I upgraded the esp32 package in the boardmanager from 2.0.2 to 2.0.3 and now it works. Furthermore I am still using the ArduinoJson library version 6.18.0