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.
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:
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: square.github.io/retrofit/
Thanx for the advice! I will try that this weekend!