1.1 About this Device
Let's see the video first.
As we know, GitHub is home to programmer and Travis CI is the home of open source testing. You can easily sync your GitHub projects with Travis CI and you’ll be testing your code in minutes. So when you commit the changes to your GitHub repository every time, the Travis CI will testing your code automatically. And you can know the testing results through the traffic light by red and green.
If you don’t know Travis CI please click https://travis-ci.org/.
What you need
Wio Link is a Wi-Fi development board to build connected IoT projects with Grove modules. Simplify your development of IoT devices without requirements of hardware programming or soldering.
If you want to know more information about Wio Link please click http://iot.seeed.cc/.
Configure your Wio Link
Before you configure the Wio Link, make sure the WiFi around you works well. If this is your first time to use Wio Link, please follow this link http://iot.seeed.cc/getting_started.html to get started.
Then configure your Wio Link as the picture below shows. And click “ UPDATE FIRMWARE ” on the upper right corner.
Let three relays to control different color
lights. After updating the firmware, see the API of your Wio Link, have a try
and make your traffic lights.
The URL is shown as below. The argument in the URL is [onoff], int value, 1 : on, 0 : off.
For example,
https://cn.iot.seeed.cc/v1/node/GroveRelay_02/onoff/1?access_token=5f5452ef4feede1ef2195f6e6bc8de8c
stands for open the GroveRelay_02.
Fork your own copy of the example project
Please click https://github.com/Lee-Kevin/Travis-ci_Wio-Link to get the copy of the example python project. And there’re 4 files in the project.
.travis.yml is the configure file which can tell Travis CI what to build.
language: pythonpython:
- "2.7"before_install:
- pip install requests
- python wio_link_execute.py buildinginstall:
script:
- python wio_link_execute.py building
- python helloworld.
pyafter_success:
- python wio_link_execute.py success
after_failure:
- python wio_link_execute.py failure
This example tells Travis CI that is a project written in Python, Travis CI tests this project against “2.7” version of Python.
before_install:
- pip install requests
To override the default pip dependency management.
script:
- python wio_link_execute.py building
- python helloworld.py
Python projects need to provide the script key in their .travis.yml to specify what command to run tests with.
- python wio_link_execute.py building is to tell people Travis CI begin to test the project, and lights up yellow.
helloworld.py is the file you want to test.
after_success:
- python wio_link_execute.py success
after_failure:
- python wio_link_execute.py failure
According to the compiled results execute different commands.
Configure your own project
Get the 3 relays’ Rest API and replace the API as shown in the red box of the following figure.
Save it, and now have a try to commit
changes to your project, and the traffic light will tell you the result.
Make. Invent. Do.
This project is made as an Open Source Project. It's a starting point. Let your creativity go wild with the mechanical, electrical and software design. Make the demo your own. Decorate it. Improve the work. No matter what, write a recipe about it.
To share and progress together.
Comments