Telegram is a freeware, cross-platform, cloud-based instant messaging (IM) software. Telegram accounts are tied to telephone numbers and are verified by SMS. Users can add multiple devices to their accounts and receive messages on all of them. Connected devices can be removed individually or all at once. The associated number can be changed at any time and when doing so, the user's contacts will receive the new number automatically. In addition, a user can set up a username as an alias that allows them to send and receive messages without exposing their phone number.
For our drone control, we will be using a custom Telegram Bot.
Telegram Bots
Bots are simply Telegram accounts operated by software – not people – and they'll often have AI features. They can do anything – teach, play, search, broadcast, remind, connect, integrate with other services, or even pass commands to the Internet of Things. They can respond to messages or mentions, can be invited into groups, and can be integrated into other programs. There are also inline bots, which can be used from any chat screen. In order to activate an inline bot, the user needs to type in the message field a bot's username and query. People can use Internet Of Things (IoT) services with two-ways interaction for IFTTT implemented within Telegram.
Telegram bot API
It is easy to set up Telegram Bots. There are a lot of tutorials available.
https://core.telegram.org/bots - BotFather
https://core.telegram.org/bots/api - General API
We used BotFather and the Telegram API to develop our custom Telegram bot named @DroneTellobot.
Our custom bot is developed in such a way that it can be accessed directly using its unique name @DroneTellobot or by adding the bot into a group.
If added to a group, all the members of the group can simultaneously use the bot to control the drone. This is very useful in a case for eg. testing the drone as a team.
Telegram Commands
At the time of this writing, the following commands are programmed into the custom telegram bot.
- /takeoff - drone takeoff
- /land - drone land
- /forward - drone forward
- /back - drone back
- /up - drone up
- /down - drone down
- /left - drone left
- /right - drone right
- /battery - drone battery
- /shutdown- close comm
- /status - bot info
There is the possibility to add more commands which are available with the help of DJI Tello SDK, which will be incorporated soon.
References:
https://core.telegram.org/bots
https://core.telegram.org/bots/api
Blog Series:
Telegram Controlled Drone #1 : Introduction
Telegram Controlled Drone #2 : Preparation - Drone and M5Stack module
Telegram Controlled Drone #3 : Preparation - Telegram Bot