Problemi gestione messaggi Telegram

Spazio dedicato agli utenti Italiani
Post Reply
videobelu
Posts: 73
Joined: Fri Feb 12, 2021 4:25 pm
Location: Villar Perosa
Has thanked: 140 times
Been thanked: 16 times

Problemi gestione messaggi Telegram

Post by videobelu »

Buongiorno @cicciocb volevo segnalarti un problema con la gestione dei messaggi verso Telegram.
Ho utilizzato il tuo ottimo programma, inserendolo nel mio sistema e la gestione dei messaggi funzionava bene.
Poco dopo pero' ho cominciato ad avere dei problemi, frequentemente il sistema si riavviava (codice roboot 12).
Ho pensato che per qulche ragione questa nuova parte "litigasse" con il mio codice ma non trovando niente di strano ho provato a caricare il tuo programma (che riporto qui')
in un altro ESP32 (Annex32 WiFi 1.43.2 CAN BLE) e l'ho lasciato girare per tutta la notte e ho scoperto che anche questo si riavviava fequentemente.
Per darti un idea dalle 21 di ieri alle 6 di stamattina si e' riavviato circa 20 volte.
Per il resto come ho detto la gestione dei messaggi funziona bene.
Grazie

Fabrizio

'Telegram example on how receive messages from Telegram
'Simple Echo demo: Reply with the message received
'requires the BOT TOKEN

BOT_TOKEN$ = "xxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxx"
CHAT_ID$ = "yyyyyyyy"

tx$ = wget$("https://api.telegram.org/bot" + BOT_TOKEN$ + "/sendMessage?chat_id=" + CHAT_ID$ + "&text=" + "Riavvio Software")

onwgetasync asynco
timer0 5000, check_telegram
next_id$ = ""

'simulate program activity
z = 0
while 1
wlog z
z = z + 1
pause 10000
wend

wait

check_telegram:
wgetasync "https://api.telegram.org/bot" + BOT_TOKEN$ + "/getUpdates?offset=" + next_id$
return

asynco:
b$ = WGETRESULT$
msg$ = json$(b$, "message.text")
if (msg$ <> "not found") then
id$ = json$(b$, "update_id")
next_id$ = trim$(str$(val(id$) + 1, "%11.0f")) ' set the id for the next message
CHAT_ID$ = json$(b$, "chat.id")
wlog "Message : "; msg$
wlog "Chat ID : "; CHAT_ID$
wlog "From :"; json$(b$, "username")

'Reply message
msg$ = "You sent me: " + msg$
wlog wget$("https://api.telegram.org/bot" + BOT_TOKEN$ + "/sendMessage?chat_id=" + CHAT_ID$ + "&text=" + msg$)
end if
return
Fabrizio Bellini
User avatar
cicciocb
Site Admin
Posts: 1900
Joined: Mon Feb 03, 2020 1:15 pm
Location: Toulouse
Has thanked: 407 times
Been thanked: 1271 times
Contact:

Re: Problemi gestione messaggi Telegram

Post by cicciocb »

Buongiorno,
daro' un occhiata per capire da dove viene il problema.
videobelu
Posts: 73
Joined: Fri Feb 12, 2021 4:25 pm
Location: Villar Perosa
Has thanked: 140 times
Been thanked: 16 times

Re: Problemi gestione messaggi Telegram

Post by videobelu »

Buongiorno, a titolo di informazione sto' provando di nuovo questo programma utilizzando la nuova versione 1.43.3
e mi sembra che il problema del reboot sia sparito, non so' se ci sono stati dei bug-fix in merito o se qualcosa e' cambiato nella gestione di Telegram.
Grazie

Fabrizio
Fabrizio Bellini
User avatar
PANNO
Posts: 114
Joined: Thu Feb 25, 2021 4:03 am
Has thanked: 121 times
Been thanked: 25 times

Re: Problemi gestione messaggi Telegram

Post by PANNO »

Fabrizio ,

i use the latest Annex and have also reboots on esp32.
maybe yo have different code now ?

sry no italiano language from me
videobelu
Posts: 73
Joined: Fri Feb 12, 2021 4:25 pm
Location: Villar Perosa
Has thanked: 140 times
Been thanked: 16 times

Re: Problemi gestione messaggi Telegram

Post by videobelu »

[Local Link Removed for Guests] wrote: [Local Link Removed for Guests]Thu Jun 03, 2021 2:47 pm Fabrizio ,

i use the latest Annex and have also reboots on esp32.
maybe yo have different code now ?

sry no italiano language from me
Ciao PANNO .......in effetti di tanto in tanto il sistema ha dei reboot strani....ho l'impressione che possano dipendere da qualche cosa che varia nella gestione di telegram.....magari cicciocb con la sua esperienza puo' capirne la causa

Hello PANNO ....... in fact from time to time the system has some strange reboots .... I have the impression that they may depend on something that varies in the management of telegram ..... maybe cicciocb with the his experience can understand the cause

Fabrizio
Fabrizio Bellini
Post Reply