Hey there today I'm gonna show you one project done at the Intel IoT Roadshow on Guadalajara, Jalisco. This project controls our intel Edison by a bot through the telegram API this will allow you receive some information of sensors and also sends information to use in the edison.
First thing to do is create or have an account in telegram. Once we have it we must create our bot by the @BotFather. To add this bot you only need to browse with that name.
We need to give a name to our new bot, when you finish, it will give you a token which will serve to get access from our edison. Keep it well we'll need it.
Even you can add a custom keyboard in case of add an aesthetic touch.
Hope this helps you your domotic project by a telegram bot which we can add some other things. It supports nodejs.
Through the terminal we'll install first the MRAA (Low Level Skeleton Library for IO Communication on GNU/Linux platforms) in order to can control our GPIO from javascript.
echo "src mraa-upm http://iotdk.intel.com/repos/1.1/intelgalactic" > /etc/opkg/mraa-upm.conf
opkg updateopkg install libmraa0
Now we'll install in npm the necessary tools in javascript for the Telegram API that control the bots and the connection with MRAA.
npm install node-telegram-bot mraa
With this we'll have installed all the necessary to this project.
Once you have done, you can clone the project repository.
git clone https://github.com/sabas1080/TelegramIntelEdison
You need to change the values to your own bot in this case on the token section you must copy the token generated in the step 2 by the BotFather.
We're using the MRAA library to do the digitals inputs and outputs and also the analogic inputs. To see other things that MRAA allows you, you can visit the repository on the examples section.
https://github.com/intel-iot-devkit/mraa/tree/master/examples/javascript
Even you can add a custom keyboard in case of add an aesthetic touch.
Hope this help you your domotic project by a telegram bot which we can add some other things, it supports nodejs.
Comments