ESP8266 ESP32 Arduino Telegram WebApp MiniApp
156 subscribers
61 photos
12 videos
10 files
60 links
ESP8266 ESP32 Arduino Telegram WebApp MiniApp
Me from Bangert Andijk The Netherlands
Download Telegram
Sorry
The ino code with
do bubblesort while

Results in watchdog reboot loop
If a different json is send

Moved the on/off time sort to html javascript schedule html
Just before webapp send data sort on/off times
Webapp storage cloud storage
Same on phone as on pc desktop
Now i have to change webapp from browser storage to telegram cloud storage

STRANGE: to change cloud storage
webapp does not have to be launched from bottom keyboard
even does change data if launched from another channel
unlike webapp send data
Talk About Telegram
// 4mb ESP32 Wroom version
// compiled this ESP32 dev board
// lots of things turned off // remarked
// but does some things

https://github.com/ldijkman/async-esp-fs-webserver/blob/master/docs/ino/thermostat_web_flash/ESP32_Telegram_WebApp_MiniApp_schedule.ino
ESP32 Settings
// 4mb ESP32 Wroom version
// compiled this ESP32 dev board
// lots of things turned off // remarked
// but does some things

https://github.com/ldijkman/async-esp-fs-webserver/blob/master/docs/ino/thermostat_web_flash/ESP32_Telegram_WebApp_MiniApp_schedule.ino
if you want webapps miniapps button to work
you need to replace/delete the folder / map / directory
arduino/libraries/UniversalTelegramBot
with my version
https://github.com/ldijkman/Universal-Arduino-Telegram-Bot/archive/refs/heads/master.zip

Arduino => sketch => manage libraries => add .ZIP library

if your first
ask @botfather for /newbot
copy bot token for use in arduino code

ask @IDBot for /getid
copy chat id for use in arduino code

ask @botfather for /newapp
web app url https://ldijkman.github.io/async-esp-fs-webserver/ino/thermostat_web_flash/Telegram_WebApp/schedule.html
for image/photo download https://raw.githubusercontent.com/ldijkman/async-esp-fs-webserver/master/docs/ino/thermostat_web_flash/Home_Bot.png
use paperclip in telegram send area to upload the image/photo
ESP8266 or ESP32
Anonymous Poll
40%
ESP8266
60%
ESP32
Telegram Home Automation
Image icon suggestion for you bot
BrainStorm & BrainPain
Looks to me telegram is a chromium browser
ChatGPT => "Indeed, Telegram's Web Apps are run inside a Chromium-based WebView"
Webapp send data is a post from iframe webapp to parent
Do not like that it is closing the webapp window on send data
And i would like a way to get sensordata to webapp webpage

I can open the webapp with URL parameters added for bot token and chat id
Tested it and that is working

But not so smart to put that in the webapp url
Not that it is directly vissible in telegram (it is in inspect)
But possible vissible elsewhere where the urls pass trough
ESP32_Telegram_WebApp_MiniApp_schedule.ino
66.3 KB
4mb ESP32 version a bit more working

Arduino IDE Menu => Tools => Board: "ESP32 Dev Module"
Visual ESP Dev Boards
Some of The boards i ran the
Arduino Universal Telegram Bot
on
https://t.me/Arduino_ESP8266_ESP32
Forwarded from Luberth Dijkman
esp32_S2_Telegram_thermogpt.ino
71.7 KB
ESP32 S2
onboard LED on 15
on = on off=off
and with off delay timer buttons
working

to program flash => connect USB, (powerup) 
       => with button 0 Pressed, to get it into program mode
arduino settings for this ESP32 S2 board
     https://t.me/Arduino_ESP8266_ESP32/7/32
Changed the WebApp a bit
Floating button menu
🐞BUG 🐞BUG 🐞BUG 🐞BUG 🐞BUG 🐞BUG

if wrong, very long message is send to
bot and thus to ESP

it hangs on that message
reboot, reprogram, powercycle, does not help
My Home Bot CQ Arduino ESP does not respond anymore to commands

message must be cleared from list
not sure how yet

did send a wrong, very long message to the bot
xxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxx
serial monitor output:

incoming message length 1500
Creating DynamicJsonBuffer
Failed to parse update, the message could be too big for the buffer. Error code: IncompleteInput
Closing client
xxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxx

if i go in browser to
https://api.telegram.org/botxxxxxmybottokenxxxxx/getUpdates?chat_id=xxxxxmychatidxxxxxxx
i see a large list of pending messages

Normaly when i look with browser getupdates url the list is empty

if i do
https://api.telegram.org/botxxxxxmybottokenxxxxx/getUpdates?chat_id=xxxxxmychatidxxxxxxx&offset=58837515
offset is topmessage id is id+1
then all later/pending messages recieved like a watterfall by bot