shurillu / CTBot

A simple (and easy to use) Arduino Telegram BOT Library for ESP8266/ESP32
MIT License
147 stars 34 forks source link

Fix CTBot::sendCommand - json emply #85

Open VashCrHm opened 3 years ago

VashCrHm commented 3 years ago

From the date 21-06-2021 16:00 is necessary add "https://api.telegram.org";

const String URL = (String)"GET /bot" + m_token + (String)"/" + command + parameters;

to

const String URL = (String)"GET https://api.telegram.org/bot" + m_token + (String)"/" + command + parameters;

File CTBot.cpp, line 30

1) auto-redirect from "api.telegram.org" to "core.telegram.org" 2) "getNewMessage error: ArduinoJson deserialization error code: json emply" (because it receives html code as a response, no json file)

I hope it will be of help, greetings :)

grosdax commented 3 years ago

Thank you it works like a charm

bbird8 commented 3 years ago

Perfect! Thanks!

konig87nikkinakki commented 3 years ago

Perfect. i wrote issue #84 some days ago. now it works, here is my configuration: 1) Arduino ver 1.8.12 2) libreria CTbot ver 2.1.5 3) JSON LIBRARY by Benoit Blanchon ver 6.18.0 4) core di ESP8266 (programmatore) ver 2.6.3 AND IT S WORKING (i just run echoBot from Examples and it works fine, testConnection OK, yesterday was "NOK".

GhaniyKie commented 3 years ago

Thanks a lot, @VashCrHm Cause of you my room lamp can lights again hahaha...

mhilmanmaulana commented 3 years ago

Perfect. i wrote issue #84 some days ago. now it works, here is my configuration:

  1. Arduino ver 1.8.12
  2. libreria CTbot ver 2.1.5
  3. JSON LIBRARY by Benoit Blanchon ver 6.18.0
  4. core di ESP8266 (programmatore) ver 2.6.3 AND IT S WORKING (i just run echoBot from Examples and it works fine, testConnection OK, yesterday was "NOK".

could you drop the sytax for me so I can try it? Thanks @konig87nikkinakki

shurillu commented 3 years ago

Many thanks VashCrHm, I'm updating the two library and soon I'll draft a new release.

UPDATE

I've uploaded a quick fix in the v3.0.0 branch. I'll do the same with a new v2.x.x release this evening.

gokil0815 commented 3 years ago

i hope so... because i really need it for college assignment

shurillu commented 3 years ago

I have just published a new release (2.1.6) with fixes suggested (and verified) in this thread. It should fix the problem. Please let me know if it solve the issue.

Cheers

Stefano

rolo11 commented 3 years ago

Grat job!!!!!!!!!!

konig87nikkinakki commented 3 years ago

sytax

What is a sytax? i ve modified the file in library as shown in top of this Issue, and it's working now. I wrote my configuration so everyone can know exactly what i'm using to Compile and Program

By the way it's working since yesterday so maybe we solved the issue ;-)

bgie commented 3 years ago

Had the same issue, connection with telegram server failed after my esp8266 was running for >1 year. The latest version fixed it, so thanx a lot.