CTBot icon indicating copy to clipboard operation
CTBot copied to clipboard

Message delivery confirmation is not reliable

Open jekyll2014 opened this issue 5 years ago • 0 comments

Ciao Stefano, I've decided to report this as a new issue.

Sometimes I get false from sendMessage() while the message have been sent successfully.

Here is the Telegram chat log for example:

1:10:22 1970/1/1 espTest: 1:10:22 1970/1/1; ADC=3; IN1=1; IN2=1; IN3=1; IN4=1; IN5=1; IN6=1; IN7=1; IN8=0;

1:10:32 1970/1/1 espTest: 1:10:32 1970/1/1; ADC=3; IN1=1; IN2=1; IN3=1; IN4=1; IN5=1; IN6=1; IN7=1; IN8=0;

1:10:44 1970/1/1 espTest: 1:10:44 1970/1/1; ADC=4; IN1=1; IN2=1; IN3=1; IN4=1; IN5=1; IN6=1; IN7=1; IN8=0;

1:10:44 1970/1/1 espTest: 1:10:44 1970/1/1; ADC=4; IN1=1; IN2=1; IN3=1; IN4=1; IN5=1; IN6=1; IN7=1; IN8=0;

1:10:54 1970/1/1 espTest: 1:10:54 1970/1/1; ADC=3; IN1=1; IN2=1; IN3=1; IN4=1; IN5=1; IN6=1; IN7=1; IN8=0;

1:10:54 1970/1/1 espTest: 1:10:54 1970/1/1; ADC=3; IN1=1; IN2=1; IN3=1; IN4=1; IN5=1; IN6=1; IN7=1; IN8=0;

1:10:54 1970/1/1 espTest: 1:10:54 1970/1/1; ADC=3; IN1=1; IN2=1; IN3=1; IN4=1; IN5=1; IN6=1; IN7=1; IN8=0;

1:11:10 1970/1/1 espTest: 1:11:10 1970/1/1; ADC=3; IN1=1; IN2=1; IN3=1; IN4=1; IN5=1; IN6=1; IN7=1; IN8=0;

1:11:10 1970/1/1 espTest: 1:11:10 1970/1/1; ADC=3; IN1=1; IN2=1; IN3=1; IN4=1; IN5=1; IN6=1; IN7=1; IN8=0;

1:11:20 1970/1/1 espTest: 1:11:20 1970/1/1; ADC=9; IN1=1; IN2=1; IN3=1; IN4=1; IN5=1; IN6=1; IN7=1; IN8=0;

1:11:36 1970/1/1 espTest: 1:11:36 1970/1/1; ADC=3; IN1=1; IN2=1; IN3=1; IN4=1; IN5=1; IN6=1; IN7=1; IN8=0;

The beginning of the message is Telegram's reception time, then there are botID (espTest) and bot local time of the message creation. Bot is sending report each 10 seconds (sometimes NTP request delays it ~5 seconds more).

You can see that: espTest: 1:10:44 - doubled espTest: 1:10:54 - tripled espTest: 1:11:10 - doubled The Telegram receiption time for doubled messages is the same which means bot just tried sending it until sendMessage() = true. The situation is quete common - I can see it each 5-15 messages... Here is a bigger log sample: https://docs.google.com/document/d/e/2PACX-1vS_ez-aUz00RDJoEy1kD4qbKz9LdXdYldWjLzEuQdIHNxSU7q_bSAUzEHkFhgEG6wXvoJ61hefQC_Lz/pub

You can try it with my code shared: https://github.com/jekyll2014/ESP8266_IOT_sensor/blob/master/testTelegram.rar

I think the issue can be connected with Telegram server reply timeout...

jekyll2014 avatar Mar 15 '19 10:03 jekyll2014