demostrate control device via messengers
JavaScript
Fetching latest commit…
Cannot retrieve the latest commit at this time.
Permalink
Failed to load latest commit information.
.gitignore
README.md
index.js
package.json

README.md

webby-grove-demo

npm

This project's goal is to validate and demostrate we can control devices by Webby via some messengers.

Now tested on Telegram and Facebook messenger.

Usage

  • Rotate rotery angle sensor to control LED's light level

  • Check status

led
> LED is off
  • Change state
led on
> LED is on(255)
led off
> LED is off
  • Set value
> led 800
> set LED level to 200
> led
> LED is on(200)

Prerequisite

respberrypi

  • GrovePi+ extension board to connect Grove modules

grovepi

LED

Rotery angle sensor

rotery

(They are also avaialble via Grove starter kit)

Setup Hardware

Imgur

Connect GrovePi+ and Respberry Pi together. Plug Rotery angle sensor in pin A2, Plug Green LED in pin D5 on GrovePi+ board.

Setup Software

You need a 4G Micro SD Card and flash with linux image

You need to make GrovePi works first by following this instructions.

Then you need clone webby_template which provide the basic setup of chatbot framework.

$ git clone https://github.com/gasolin/webby_template.git demo
$ cd demo

Then you have to get this project and install a messenger adapter from npm. (Let's take telegram adapter for example. I've test it with Facebook messenger as well, so you can try on it in the same manner)

$ npm install --save hubot-telegram webby-grove-demo
$ npm install

Edit external-scripts.json and add "webby-grove-demo" string in it Edit node_modules/hubot-telegram/src/telegram.coffee and replace hubot to webbybot at the first line.

Then you need create a telegram bot and put the token in .bashrc file

export TELEGRAM_TOKEN=222333444:AAbbccDdeeffgghijklm

Refresh the bash environment with

. ~/.bashrc

Then you can host your bot on telegram and control the sensors.

$ ./bin/webby -a telegram