Telegram Bot With Intel Edison

by sabas1080 in Circuits > Electronics

2619 Views, 20 Favorites, 0 Comments

Telegram Bot With Intel Edison

9ff2f2f01c4bd1b013.png
12179038_978314848881397_166084499_n.jpg

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.

Material

11987203_1111040342247961_4584469098800582410_n.jpg
12109177_1111040302247965_7455460335293797064_n.jpg
12033021_1111040292247966_330971489481970615_n.jpg
12118670_1111040315581297_9127095565796561039_n.jpg

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

Crear Bot En Telegram

telebot-1.jpg
telebot-2.jpg

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

Nodejs

12171549_978314565548092_2087596748_o.jpg

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

Probando

Screenshot_2015-10-22-16-57-19.png
12179038_978314848881397_166084499_n.jpg

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