Garage Door Controller: Connectivity wio link to MIT AI2 App

Simplify IoT Development.

Moderators: lily.li, violet, seth.welday

Post Reply
tbro333.tb
Pre-kindergarten
Pre-kindergarten
Posts: 2
Joined: Mon Apr 11, 2016 1:57 am

Garage Door Controller: Connectivity wio link to MIT AI2 App

Post by tbro333.tb » Mon Apr 11, 2016 2:09 am

I have got my wio link all connected to my android phone. I have 3 relays connected and firmware updated. I have been on MIT's website and built a simple app with 3 buttons: OPEN, CLOSE, and STOP to connect and control the garage door where I work. I am in need of help to figure how to get the app to communicate with the wio link. All help is greatly appreciated! Thank you in advance!!

nevillekong
Pre-kindergarten
Pre-kindergarten
Posts: 5
Joined: Thu Mar 17, 2016 4:58 pm

Re: Garage Door Controller: Connectivity wio link to MIT AI2

Post by nevillekong » Mon Apr 11, 2016 10:21 am

tbro333.tb wrote:I have got my wio link all connected to my android phone. I have 3 relays connected and firmware updated. I have been on MIT's website and built a simple app with 3 buttons: OPEN, CLOSE, and STOP to connect and control the garage door where I work. I am in need of help to figure how to get the app to communicate with the wio link. All help is greatly appreciated! Thank you in advance!!
Cool!Would you like share your Garage Door Controller on our Recipe?I think your project will inspire more people. :)

yexiaobo
Pre-kindergarten
Pre-kindergarten
Posts: 46
Joined: Tue Dec 11, 2012 10:53 am

Re: Garage Door Controller: Connectivity wio link to MIT AI2

Post by yexiaobo » Mon Apr 11, 2016 10:51 am

Hi tbro333.tb,

If you wanna connecting you Android App to Wio Link. Just need to know how to handle the HTTP request/response.

Some python code below:

Code: Select all

import requests

wio_link_key = "your wio link token"
wio_link_relay = "https://cn.iot.seeed.cc/v1/node/GroveRelay [ the port number] /onoff/"
wio_link_relay1 = "https://cn.iot.seeed.cc/v1/node/GroveRelay [ the port number] /onoff/"
wio_link_relay2 = "https://cn.iot.seeed.cc/v1/node/GroveRelay [ the port number] /onoff/"

url = wio_link_relay + [on or off statue code: 0/1] + "?" + wio_link_key
url1 = wio_link_relay1 + [on or off statue code: 0/1] + "?" + wio_link_key
url2 = wio_link_relay2 + [on or off statue code: 0/1] + "?" + wio_link_key
requests.post(url)
requests.post(url1)
requests.post(url2)

BTW, I recommend a HTTP RESTful library for Android which help handle HTTP RESTful easily: http://square.github.io/retrofit/

tbro333.tb
Pre-kindergarten
Pre-kindergarten
Posts: 2
Joined: Mon Apr 11, 2016 1:57 am

Re: Garage Door Controller: Connectivity wio link to MIT AI2

Post by tbro333.tb » Wed Apr 13, 2016 11:12 pm

Thanx for the advice! I will try that this weekend!

Post Reply