Telegram is a very popular instant messaging platform around the world. It is similar to Whatsapp or Facebook Messanger, but with many more functions. In addition to sending messages, images, audio and video files and creating groups, it is possible to create bots - automated programs that perform functions and tasks requested by users. Bots are really useful. There are many bots which can facilitate your life. TrakBot can trak your packages, ExchangeRates can canvert values, TempMail provides a temporary email, PollBot, WeatherInfo and many other. Tens or hundred apps concentrated in one.
That's a really intresting project: turn on and off a LED using a Telegram bot. It sounds trivial, but it will be very useful for future applications in the Raspberry Pi world. Telegram is an easy and smart app and kowing how to combine it with your micro computer will give you a great start point.
How the project works? Sending a message to a Telegram bot on your smartphone will turn on and off a led connected to your Raspberry Pi.
Create a bot with BotFather, follow the instructions and save the bot token
install pyhton:
sudo apt-get install python-pip
install Telepot:
sudo pip install telepot
import Repository git
git clone https://github.com/salmanfarisvp/TelegramBot.git
open telegrambot.py in your File Manager, change BOT TOKEN with your token
open the termial and type:
pyhton telegrambot.py
or
pyhton /TelegramBot/telegrambot.py
Done! Connect the LED, open the telegram bot chat and type "on", the LED will turn on.
Visit Mako to read the full project: http://www.makosite.one/telegram-bot.php
Comments
Please log in or sign up to comment.