Introduction: Telegram Bot With Intel Edison

About: Fundador de The Inventor's House Hackerspace, Movimiento Maker y Hardware Libre, DIY, Workaholic

Hola a todos hoy voy a mostrarles un proyecto que realice en el Intel IoT Roadshow en Guadalajara Jalisco el cual trata de controlar nuestra Intel Edison a un bot por medio de la API de Telegram poder recibir la lectura de algunos sensores e igual poder activar algunas cosas desde telegram.

Comencemos

Hey there today im gonna show you one project done at the Intel IoT Roadshow on Guadalajara jalisco, this project control our intel Edison by a bot through the telegram API this will allow you receive some information of sensors and also send information to use in the edison.

Step 1: Material

El material necesario para crear este proyecto es

  • Intel Edison Board Arduino
  • Grove Starter Kit Plus Intel IoT Edition
  • Smartphone o PC con Telegram

The necesary material to build this poject is

  • Intel Edison Board Arduino
  • Grove Starter Kit Plus Intel IoT Edition
  • Smartphone o PC con Telegram

Step 2: Crear Bot En Telegram

Lo primero que debemos hacer es crear o tener una cuenta de Telegram, una vez tengamos una cuenta debemos crear nuestro bot en por medio del @BotFather para encontrar este bot solo es necesario en el buscador colocar su nombre

Debemos dar un nombre a nuestro nuevo bot, al terminar nos dará un token con el que podremos acceder desde nuestra Edison, guárdalo bien lo usaremos adelante

Si gustan pueden configurar alguna otra característica de nuestro bot por medio de las lista de comandos

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 wih that name.

We need to give a name to our new bot, when you finish it will give you a token wich will serve to get acces from our edison, keep it well we'll need it.

If you like you can configure some others caracteristics of our bot by the command list

Step 3: Nodejs

Por medio de terminal lo primero que debemos hacer es instalar es MRAA (Low Level Skeleton Library for IO Communication on GNU/Linux platforms) para poder controlar nuestro GPIO desde Javascript

Through the terminal we'll install first the MRAA (Low Level Skeleton Library for IO Communication on GNU/Linux platforms) in order to can controll our GPIO from javascript

echo "src mraa-upm <a href="http://iotdk.intel.com/repos/1.1/intelgalactic" <a href="http://iotdk.intel.com/repos/1.1/intelgalactic" rel="nofollow">  http://iotdk.intel.com/repos/1.1/intelgalactic"  </a> > /etc/opkg/mraa-upm.conf

opkg update
opkg install libmraa0

Ahora instalaremos en npm las herramientas necesarias en javascript para la API de Telegram que controla los bots y la conexion con MRAA

Now we'll install in npm the necesary tools in javascript for the Telegram API that controll the bots and the conection with MRAA

npm install node-telegram-bot mraa

Con eso tendremos instalado lo necesario para realizar este proyecto

With this we'll have installed all the necesary to this project

Step 4: Probando

Una vez realizado lo anterior pueden clonar el repositorio del proyecto

Once you have done, you can clone the project repository

git clone <a href="https://github.com/sabas1080/TelegramIntelEdison" rel="nofollow"> <a href="https://github.com/sabas1080/TelegramIntelEdison</a"> https://github.com/sabas1080/TelegramIntelEdison<...</a>>

Deben cambiar los valores por el de su bot, en este caso en la sección de Token deben introducir el token que se genero en el paso 2 el BotFather.

Estamos usando la librería MRAA para hacer la lectura de las entradas y salidas digitales, así como las entradas analógicas para ver algunas otras cosas que puedes hacer con MRAA puedes visitar el repositorio en la sección de ejemplos

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.

<a href="https://github.com/intel-iot-devkit/mraa/tree/master/examples/javascript" rel="nofollow">https://github.com/intel-iot-devkit/mraa/tree/mast...</a>

Ademas se puede agregar un teclado personalizado por si gustas agregar un toque mas estético.

Espero les sirva para hacer domotica en su casa, por medio de un semi-ayudante personal como los es un bot de Telegram al cual le podemos añadir algunas otras cosas que soporta nodejs

Hasta la próxima Inventores!!

Even you can add an costom keyboard in case of add an aesthetic touch.

Hope this help tou your domotic project by a telegram bot which we can add some other things, it supports nodejs

Intel® IoT Invitational

Participated in the
Intel® IoT Invitational