[Erhan] has been playing around with the Telegram instant messaging service. Initially, he worked out how to turn on and off LEDs from his cell phone: he sent commands from the phone through the Telegram bot API, to a computer that’s connected over serial to an MSP430 board that actually controlled the LEDs.
But that’s a little bit complicated. Better to cut out the middleman (err…microcontroller) and implement the Telegram reception and LED blinking on a Raspberry Pi. For a project that’s already using a Pi, using the instant messaging service’s resources is a very simple way to interface to a cellphone.
The code for both the standalone RPi project and the MSP430-based microcontroller application are available at [Erhan]’s GitHub. You’re going to be installing Node.js for their telegram-bot-api and jumping through the usual OAuth hoops to get your bot registered with Telegram. But once you’ve done that all on the Raspberry Pi (or target computer of your choice) it’s all just a few lines of fairly high-level code.
We’ve only seen one other Telegram application on Hackaday.io and we’re wondering why. It looks pretty slick, and with the bot’s ability to send a custom “keyboard” to the phone along with the message, it could make cell-phone-based control interfaces a cinch. Anyone else using Telegram for bots?
Filed under: misc hacks
No comments:
Post a Comment