Now since we want to use telegram bot feature to control our IoT device so for that we have to do some initialization setup on Arduino IDE.
Steps:
-
Setting up Telegram Bot Libraries
- Now in Arduino IDE,
Sketch
->Include Library
->Manage Libraries
and search for telegram. - Install
Universal Telegram Bot
(If it asks you to install JSON dependeny then click on Install all). - Search for json and make sure
ArduinoJson
is installed(Working with v6.17.2).
- Now in Arduino IDE,
-
Getting the telegram Bot Token
-
Open telegram app and search for
BotFather
. Click on the account with blue tick. -
Tap
Start
-
Type
/newbot
to create new bot. -
Give the name to your bot.
-
Give username to your bot. It's should end with
bot
in name. -
Now at (1) it gives you the bot interface link and (2) provides you the HTTP API Key.Keep both the things private to yourself.
-
-
Now setup in Arduino IDE
- In Arduino IDE,
File
->Exampels
->Universal Telegram Bot
->ESP8266
->Flash LED
- Now fill the SSID,Password and API Key.
- Compile and Upload.
- On Telegram open the bot you made and
Start
- In Arduino IDE,