shurillu / CTBot

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

failed connect to telegram #113

Closed anakuda17 closed 5 months ago

anakuda17 commented 1 year ago

hello, i've issue for my iot project. yesterday my device is worked properly using this CTBot library .

but since this day 28 march 2023, this device does'nt have a connection to telegram again, i check for the connection between my board to my wifi is ok, i created the new bot on telegram and i using the other nodemcu board to connect, but the result are the same .

i just using a simple code here .
image

Araris commented 1 year ago

Hello, exactly the same situation, since 28 March 2023, testConnection() returns false.

hamster66 commented 1 year ago

I confirm. Today, all devices using the library have stopped working with telegram.

RichMiguel commented 1 year ago

I also have the same problem, is there any way to solve this problem?

GusevNikita commented 1 year ago

Hello friends, I figured out what's going on. You need to update the Fingerprint, in the file CTBotSecureConnection.h at Arduino\libraries\CTBot\src

Replace

uint8_t m_fingerprint[20]{ 0x07, 0x36, 0x89, 0x3D, 0x0F, 0xCC, 0x8C, 0xF7, 0xD0, 0x19, 0xB7, 0x83, 0x39, 0xC4, 0xD5, 0x15, 0x70, 0x9A, 0xC6, 0x5D };

to the new one relevant for api.telegram.org

uint8_t m_fingerprint[20]{ 0x8A, 0x10, 0xB5, 0xB9, 0xB1, 0x57, 0xAB, 0xDA, 0x19, 0x74, 0x5B, 0xAB, 0x62, 0x1F, 0x38, 0x03, 0x72, 0xFE, 0x8E, 0x47 };

Good luck =)

Araris commented 1 year ago

Thank you, Nikita, checked - it works.

hamster66 commented 1 year ago

Thank you, Nikita, checked too - look like it works.

anakuda17 commented 1 year ago

Hello friends, I figured out what's going on. You need to update the Fingerprint, in the file CTBotSecureConnection.h at Arduino\libraries\CTBot\src

Replace

uint8_t m_fingerprint[20]{ 0x07, 0x36, 0x89, 0x3D, 0x0F, 0xCC, 0x8C, 0xF7, 0xD0, 0x19, 0xB7, 0x83, 0x39, 0xC4, 0xD5, 0x15, 0x70, 0x9A, 0xC6, 0x5D };

to the new one relevant for api.telegram.org

uint8_t m_fingerprint[20]{ 0x8A, 0x10, 0xB5, 0xB9, 0xB1, 0x57, 0xAB, 0xDA, 0x19, 0x74, 0x5B, 0xAB, 0x62, 0x1F, 0x38, 0x03, 0x72, 0xFE, 0x8E, 0x47 };

Good luck =)

thank u nikita, this is legit .

bbird8 commented 1 year ago

Thanks!

As we had similar issue around one year ago, will this pop-up / be needed to do regularly? Can anybody provide info how this fingerprint gets defined?

juanitofuria commented 1 year ago

GusevNikita, thanks,It really works for me.

Jossy68 commented 1 year ago

Hello, I changed the Fingerprint, in the file CTBotSecureConnection.h in ArduinolibrariesCTBotsrc. To do the test, I used the sample library in CTBot, the ECHOBOT. Loaded on my Nodemcu ESP8266 and controlled via Arduino IDE Serial Monitor, it seems to connect to Telegram, but after a few seconds the device reboots!. Below you can see what appears on the monitor:

--------------- CUT HERE FOR EXCEPTION DECODER ---------------

ets Jan 8 2013,rst cause:2, boot mode:(3,6)

load 0x4010f000, len 3424, room 16 tail 0 chksum 0x2e load 0x3fff20b8, len 40, room 8 tail 0 chksum 0x2b csum 0x2b v000628e0 ~ld ����g��s��'|� d �lc��|;�l�o��g�l��{�d�l� �Starting TelegramBot...

testConnection OK

--------------- CUT HERE FOR EXCEPTION DECODER ---------------

Soft WDT reset

Exception (4): epc1=0x4000dd0b epc2=0x00000000 epc3=0x00000000 excvaddr=0x00000000 depc=0x00000000

stack>>>

ctx: sys sp: 3ffff300 end: 3fffffb0 offset: 0160 3ffff460: 00000001 00000000 3fff205c 4020649e
3ffff470: 00000000 000025ca 553f7ced 002bb1f2
3ffff480: 00000000 c02fc02b c030c02c 00000000
3ffff490: 00003a98 000717d8 3fff0684 40207380
3ffff4a0: 000000dd 3fff2b14 3fff2114 4022249c
3ffff4b0: 00000008 00000001 00001996 00000000
3ffff4c0: 3fff2614 402235f4 3fff2114 00000000
3ffff4d0: 3fff2614 3ffef964 3fff2114 3ffef964
3ffff4e0: 00000000 00000001 3fff0684 402074a3
3ffff4f0: 00000000 00000001 3fff0684 4020768f
3ffff500: 00000000 0000193f ef5c28f5 001d31ec
3ffff510: 00000000 00000000 00000034 0000193f
3ffff520: 00003a98 3fff205c 3fff0684 402067fb
3ffff530: 3fff1f9c 000000e3 3ffe85f4 3ffff62c
3ffff540: 4025a8dc 00000010 3ffff5a8 3ffff62c
3ffff550: 000001bb 3ffef964 3fff0684 40207731
3ffff560: 4020cd10 dca79a95 4020cd10 dca79a95
3ffff570: 3ffe88b5 3ffff690 3ffee84c 40204edf
3ffff580: 4020c9b0 00000000 000007d0 40100abc
3ffff590: 00000000 00000000 00000000 3fff0684
3ffff5a0: 3fff0684 3ffef94c 3ffef964 0010001f
3ffff5b0: 80000000 00000001 3ffff5f0 40209080
3ffff5c0: 00000001 3ffefcac 3ffff608 402092fa
3ffff5d0: 3ffff728 00000001 3ffff5f0 3ffff6b8
3ffff5e0: 3ffff728 3ffee84c 3ffff690 40201797
3ffff5f0: 00000000 008d008f 00000000 00000000
3ffff600: 0058005f 00000000 00000000 ffffffff
3ffff610: 00000000 00000000 004e004f 00000000
3ffff620: 00000000 004d004f 00000000 3ffef894
3ffff630: 008d008f 80000000 3ffff6b8 40208f00
3ffff640: 00000000 4025a7d0 3ffff6b8 3ffeea74
3ffff650: 00000000 3ffffea0 3ffee84c 40202f0e
3ffff660: 5c5c5c5c 5c5c5c5c 3ffefe7c 3ffefe7c
3ffff670: 3fff067c 3fff067c 5c5c5c00 5c5c5c5c
3ffff680: 97128552 a9fcd307 2bea9500 615166e7
3ffff690: 25352697 63f3490e 97359260 80f418c1
3ffff6a0: 25d6e79f bbc3e364 1106eb4f b3a5e178
3ffff6b0: 0d3df4a7 e475b9be 55746567 74616470
3ffff6c0: 0a007365 bc685166 97fa80d8 f488f70d
3ffff6d0: dcf79f46 46d76e20 6d7eedaf 591837ce
3ffff6e0: b48f130a 97981adc 10a6ec72 d141c629
3ffff6f0: 0ef2ac1c 510442a3 2373f70f bae926ff
3ffff700: e5fb01f4 88844f1c 82f549b0 23c24355
3ffff710: 7ecb0030 3891dafe 60cf59e8 fac336a7
3ffff720: 938281ce 2df0b8f0 3ffefcac 0035003f
3ffff730: 80000000 00000000 00000000 00000000
3ffff740: 00000000 00000000 00000000 00000300
3ffff750: 0ca7b37d 451448bb 2da5861c d743b7bb
3ffff760: d32378e8 a264fa03 32b21883 00000080
3ffff770: 03030000 010000d4 c637f70a 0000afce
3ffff780: b8aed5ea 1cd70db2 6d155f3e 242cd263
3ffff790: 6b670000 a03fcf54 a8c02bc0 5acca9cc
3ffff7a0: 30c0acc0 2fc02cc0 afc023c0 adc0aec0
3ffff7b0: 28c009c0 27c024c0 14c02dc0 13c00ac0
3ffff7c0: 32c025c0 31c02ec0 2ac004c0 29c026c0
3ffff7d0: 0f009c00 0ec005c0 9dc0a0c0 9dc09cc0
3ffff7e0: 3d002f00 a1003c00 12c003c0 35c008c0
3ffff7f0: 00000002 00000000 00000020 40100188
3ffff800: 401024b1 ae95e02e 00000002 40102080
3ffff810: 3ffe91f2 401052ff 3ffec960 30cafcfb
3ffff820: 00000001 401044da 3ffed3b8 53b3a17d
3ffff830: 4010494b c8dd11fe 2135bbad 047b3121
3ffff840: b25db6bf eed3b7d1 2abd432d 8a77ff44
3ffff850: 40104413 00000043 00000002 00040000
3ffff860: 00002200 12e69c95 41795906 b0df3e2b
3ffff870: 00000002 00000000 00000020 40100188
3ffff880: 401024b1 00000000 00000002 40102080
3ffff890: 3ffe91f2 401052ff 3ffec988 3fffc278
3ffff8a0: 00000001 401044da 3ffed3b8 f63f04a7
3ffff8b0: 4010494b 00000030 00000000 ffffffff
3ffff8c0: 4024d4c3 00000001 3ffe9184 00000000
3ffff8d0: 40104413 00000041 00000002 00040000
3ffff8e0: 00002200 00ffffff 00000044 00000001
3ffff8f0: 401032dc 00080000 3ffe9341 00000030
3ffff900: 401024b1 00000000 00000002 40102080
3ffff910: 3ffe91f2 2c9f0300 4000050c 3fffc278
3ffff920: 40102fc4 3fffc200 00000022 36013f9d
3ffff930: 00614440 a3411240 50004040 0d68a827
3ffff940: ccb44fe1 561ee22b 8f488029 10030b80
3ffff950: 0909c495 19674f84 d6004978 2f5534ab
3ffff960: ed301528 b35b9cc1 236a93db 2e4a9fa0
3ffff970: 91154c10 00000001 3fff39c4 00000030
3ffff980: 0f033330 3ffffb30 3ffffc10 3ffffbf0
3ffff990: 8f7d4cbe d3ae4c52 40b70afd 2a98bb62
3ffff9a0: 3f3f3030 4cbe8f7d c53ded15 0000000a
3ffff9b0: 0d050507 6090a070 f0708050 0f050b0a
3ffff9c0: f0748a50 01108716 a06060c0 5daf3910
3ffff9d0: 030a0e02 0000da98 4024d4c3 3ffffcd0
3ffff9e0: 3ffffcd0 00000001 3ffffbf0 3ffffaf0
3ffff9f0: cf3fff3f 33fcff00 0cc030ff fccfc030
3ffffa00: 00f3330c 33c0c3f3 cff0f3f3 f3000c33
3ffffa10: 3c0cccf3 f0ccccff fc3ff0cc cc3cc00f
3ffffa20: 0030f003 0fc0c030 3ccf3030 cfff030f
3ffffa30: f3033c30 303c3ccc 33f330c3 3cf33f03
3ffffa40: 000fcf00 03c0c00f f3c3f00f 3c330003
3ffffa50: 30000c0f 0ff30c3c 4024d4c3 00000001
3ffffa60: ffffffff 00000000 3ffe9341 00000008
3ffffa70: 4024d512 3ffec938 3ffef384 00000001
3ffffa80: 00000002 00000000 00000020 40100188
3ffffa90: 00000005 00000005 00000002 40102080
3ffffaa0: 3ffe91f2 4024c5d3 4024d4c3 00000001
3ffffab0: ffffffff 00000000 3ffe9341 00000008
3ffffac0: 4024d512 3ffec988 3ffef384 00000001
3ffffad0: 00000002 00000000 00000020 40100188
3ffffae0: 00000005 00000005 00000002 40102080
3ffffaf0: 3ffe91f2 4024c5d3 3ffec988 3fff34bc
3ffffb00: 00000000 40235bab 3ffedce0 3ffef384
3ffffb10: 00000000 00000002 00000000 3ffec988
3ffffb20: 3fff34f2 4010595b 3ffefc34 3ffeed58
3ffffb30: 3ffef62c 3ffecc80 00000005 40102080
3ffffb40: 3ffe91f5 40213ba5 3ffefc34 3ffeed58
3ffffb50: 40102c0b 3ffecc80 00000020 40100188
3ffffb60: 00007fff 00626b69 3ffed514 3ffeed70
3ffffb70: 3ffeed70 3fff34bc 3fff34bc 40213dd7
3ffffb80: 3ffeeda8 3fff34bc 00000000 40214236
3ffffb90: 3ffef0a8 7fffffff 00002200 00000001
3ffffba0: 00000001 00004288 3ffed514 3ffef0a8
3ffffbb0: 3ffeed70 3ffeeda8 3ffef09c 4021b564
3ffffbc0: 3ffe9a70 2c9f0300 4000050c 3fffc278
3ffffbd0: 3fff34bc 3fffc200 00000022 00000001
3ffffbe0: 4020654e 00000030 00000010 3fff34bc
3ffffbf0: 3fff34bc 3ffeed7c 3ffeed70 4021b638
3ffffc00: 3fff0000 000000e2 b9e20003 00000003
3ffffc10: 3fff3500 3ffeed70 3fff1fa0 4021cfa8
3ffffc20: 00000005 3fff33e4 00000005 00000030
3ffffc30: 00000014 3fff1f9c 000000ff 00000000
3ffffc40: 00000006 3ffef19c 00000000 fffffffe
3ffffc50: 00000000 3fffc6fc 00000000 3fff1fa0
3ffffc60: 3ffeed70 3fff34bc 3fff1f9c 4021d010
3ffffc70: 3ffeed70 00000000 00000000 40214aed
3ffffc80: 4000050c 00000833 3ffe85f4 4021d036
3ffffc90: 3ffeed70 00000000 00000000 4021df77
3ffffca0: 4020500d 3fff34bc 3fff1f9c 402181b6
3ffffcb0: 3ffffe1c 00000000 00000001 3fff064c
3ffffcc0: 00002e10 19999999 00000000 00000000
3ffffcd0: 99999999 3ffe88b5 0000116a 00000000
3ffffce0: 00001510 000002a2 3ffe85f4 00000000
3ffffcf0: 3ffffdf0 00000008 3fff05ec 4020201d
3ffffd00: 3ffe88b5 00000020 3fff075c 40100a88
3ffffd10: 00000000 3ffee914 3ffffe30 0000000e
3ffffd20: 00007fed 00000287 3ffe85f4 4010073a
3ffffd30: 00000a60 00000001 3ffffea0 40209080
3ffffd40: 3ffffea0 3ffffd84 3fff065c 40202242
3ffffd50: 3ffffe28 3ffffd80 3ffe88c4 3ffeea74
3ffffd60: 3fff065c 00000000 3ffffe24 4020126c
3ffffd70: 3fff065c 00000000 00000000 40202ae0
3ffffd80: 3ffffea0 6c6c756e 40208e00 3fff065c
3ffffd90: 00000001 3ffffea0 40208ff1 4025a820
3ffffda0: 0000000d 00000000 00000004 3ffffea0
3ffffdb0: 3ffffe00 40208e25 3fff065c 00000001
3ffffdc0: 3ffffea0 40208ff1 4025a820 0000000d
3ffffdd0: 00000000 3ffffea0 3ffffe00 40208e25
3ffffde0: 3fff065c 00000001 3ffffea0 40208ff1
3ffffdf0: 4025a820 0000000d 00000000 3ffffea0
3ffffe00: 3ffffe00 40208e25 3fff065c 00000001
3ffffe10: 3ffffea0 40208ff1 4025a820 0000000d
3ffffe20: 00000000 3ffffea0 3ffffe00 40208e25
3ffffe30: 00000c30 00000186 3ffe85f4 4010073a
3ffffe40: 4025a820 0000000d 3ffffea0 3ffeea74
3ffffe50: 3fff065c 00000020 3ffefe7c 40100a88
3ffffe60: 3fff065c 00000001 3fffff60 40204c4d
3ffffe70: 00000000 00000010 3ffefe7c 3ffeff08
3ffffe80: 3fff05ec 3fff067c 3fffff00 3ffeea74
3ffffe90: 3fffdad0 00000000 3ffee84c 40201173
3ffffea0: 00000000 00000000 00000000 4025a658
3ffffeb0: 00000006 00000000 4025a820 00000000
3ffffec0: 00000000 00000020 00000000 00000000
3ffffed0: 00000000 00000000 00000000 3ffee834
3ffffee0: 00000000 00000145 3ffe85f4 4010073a
3ffffef0: 00000000 00000018 00000000 3ffee834
3fffff00: 00000001 00000000 3ffefc74 00000000
3fffff10: 00000000 0000014c 00000000 00000000
3fffff20: 3ffee89c 00000000 00000000 3ffeea74
3fffff30: 00000000 00000020 3ffefcac 40100a88
3fffff40: 00000000 3ffee84c 00000000 00000000
3fffff50: 3fffdad0 00000000 00000000 40204c9e
3fffff60: 00000000 00000000 00000001 00000000
3fffff70: 00000000 00000000 00000000 4020a5dc
3fffff80: 00000000 fffffffc 0010001f 00000000
3fffff90: 40207e70 3ffe89b2 3ffee8d8 3ffeea74
3fffffa0: 3fffdad0 00000012 3ffee8d8 4020850c
<<<stack<<<

I ask for help to understand what the problem is. Thank you very much.

smal57 commented 1 year ago

Hi; my skill level is = 0 or much closer..., Anyway at [issue#84} Stefano has suggest to disable the fingerprint if need. In my case i just send datas/messages and don't command anything, so could be possible without pain. See here what Stefano wrote: "**** There are two possibilities: using the useDNS(true) member function in order to use the Telegram Server symbolic name disabling the fingerprint verification by modifing the following row in the file CTBotDefines.h

define CTBOT_USE_FINGERPRINT 0

(set it to zero).

This should solve the issue, let me know! Cheers Stefano "**** That action solved immediately the problem... Before that discovered tread (issue#84) i swap to other Telegram structure expired at 31_december_2037, Hope i will be there too...not sure...at all. In any case i am just ready to turn back at Stefano very good task ! Saluti for Italy. Cheers everybody out there.

Jossy68 commented 1 year ago

Hello; I tried to set

define CTBOT_USE_FINGERPRINT from 1 to 0 (zero) in the file CTBotDefines.h, but nothing!!. does not work, continuous restart of Nodemcu!!!

That is a real problem!!!

smal57 commented 1 year ago

Hello Jossy68...

I am using a temporary ESP8266 Nodemcu V3 with Shurillu CTBOT version 3.0.0; see below part of library.property

========================== name=CTBot version=3.0.0 author=Stefano Ledda shurillu@tiscalinet.it maintainer=Stefano Ledda shurillu@tiscalinet.it sentence=Simple Arduino Telegram BOT library for ESP8266/ESP32 ...... Fingerprint authentication and 2.5.0+ ESP8266 Toolchain/Library supported. NEW: ArduinoJson version 6 supported! I know Stefano develop a new CTBOT greater then 3.0.0 but i can't found it.

========================== Actually Nodemcu is not rebooting, is still on my table, running. Hope help You. Ciao.

RimbangM commented 1 year ago

Hello friends, I figured out what's going on. You need to update the Fingerprint, in the file CTBotSecureConnection.h at Arduino\libraries\CTBot\src

Replace

uint8_t m_fingerprint[20]{ 0x07, 0x36, 0x89, 0x3D, 0x0F, 0xCC, 0x8C, 0xF7, 0xD0, 0x19, 0xB7, 0x83, 0x39, 0xC4, 0xD5, 0x15, 0x70, 0x9A, 0xC6, 0x5D };

to the new one relevant for api.telegram.org

uint8_t m_fingerprint[20]{ 0x8A, 0x10, 0xB5, 0xB9, 0xB1, 0x57, 0xAB, 0xDA, 0x19, 0x74, 0x5B, 0xAB, 0x62, 0x1F, 0x38, 0x03, 0x72, 0xFE, 0x8E, 0x47 };

Good luck =)

it's Work. LEGIT.

shurillu commented 1 year ago

Hello to all, thank you for the patience, I was away from my PC. I have already drafted a new release with the updated fingerprint. The new version is 2.1.10, it will be available in the Library Manager soon (maybe tomorrow). To speedup the update, you can download the new version from here. Take in mind that there are some incompatibilities with the ArduinoJson v 6.20.0 and later. The last supported version is the 6.19.4. Some resetting issues are dued to this.

Cheers

Stefano

Jossy68 commented 1 year ago

Hello everyone Problem solved with my Nodemcu ESP8266!. Stefano "shurillu" has recently updated the CTBot library to version 2.1.10 already available on Arduino IDE. I only had to install version 6.19.4 of ArduinoJson for Arduino IDE (the most recent is 6.21), as explained by Stefano, as not completely compatible (the nodemcu restarts continuously) with CTBot 6.19.4 (we hope that the next version will be compatible with AuduinoJson 6.21!!). Thank you all..

bosoft-ESP commented 1 year ago

Hello Stefano Could one try to have ctbot call https://www.grc.com/fingerprints.htm?domain=api.telegram.org to update the fingerprint when it has problems connecting to telegram (e.g. testConnection())? I have tried, but the ESP01s give error when trying to connect to HTTPS. Greetings and thanks for your great work