GithubHelp home page GithubHelp logo

maggiemei / mbed-os-example-server-withtemphum Goto Github PK

View Code? Open in Web Editor NEW
0.0 2.0 0.0 226 KB

mbed clieservernt with temp&hum sensor

License: Apache License 2.0

Python 4.09% CSS 0.83% JavaScript 91.31% HTML 3.77%

mbed-os-example-server-withtemphum's Introduction

mbed-os-example-server-withTempHum

This is a simple webapp for mbed server meant to be paired with the mbed-os-example-client-withTempHum application. The goal of this application is to get the user up and running, using the mbed-connector-python package and talking to devices through mbed Device Connector in under 5 min, 5 steps or less.

If you are not familiar with the mbed connector api, we recommend that you read the mbed-connector-api-python first.

Pre-requisites

  • A mbed connector account and have generated an API token
  • An endpoint with Grove Temperature & Humidity Sensor running the [mbed-os-example-client-withTempHum](https://github.com/MaggieMei/ mbed-os-example-client-withTempHum)
  • Install the required packages sudo pip install -r requirements.txt

Use

  1. Put your API key into the app.py file, replace the following text
    token = "Change Me" # replace with your API token

or set an evironment variable called ACCESS_KEY with the value of your API key 2. Start mysql service by running sudo service mysql start 3. Run the app.py file

python ./app.py
  1. Open a web page to the web.py server. Usually //localhost:8080 will work.

    web page

  2. Click at the GET button under the Presses field, you will see the number of button 2 pressed on the board. When Subscribe is chosen, the number will update automatically without click any more.

  3. Value of current temperature will be displayed in the Current Temperatue field. It keeps updating every two seconds. Temperature Curves can also be obtained for the allotted time. After setting the date-time and clicking the GET button, a new file named Temperature.png will be generated under the same directory. The button Restart Temperature Detection is used for clear all the temperature data stored and start detection again. By default, the data will be cleared every 24 hours.

  4. Operation for Current Humidity field is just the same as above!

Troubleshooting

Here are some common problems and their solutions.

Cannot establish a secure connection

This is most likely caused by not having the requests[security] package installed. If you are using Ubuntu 14.4 LTS you may need to update pip first pip install -U pip and then install the requests security package pip install -U requests[security].

WebSocket transport not available

Dont worry about that warning message, it is not applicable to this demo, but likewise the warning message cannot be disabled.

ERROR 500 on trying to run the app.py file

Make sure you added your Access Key to the app. You can do this by either changing the value of the token variable in the app.py file or by setting the ACCESS_KEY environment variable to your access key.

mbed-os-example-server-withtemphum's People

Contributors

maggiemei avatar

Watchers

 avatar  avatar

mbed-os-example-server-withtemphum's Issues

Recommend Projects

  • React photo React

    A declarative, efficient, and flexible JavaScript library for building user interfaces.

  • Vue.js photo Vue.js

    ๐Ÿ–– Vue.js is a progressive, incrementally-adoptable JavaScript framework for building UI on the web.

  • Typescript photo Typescript

    TypeScript is a superset of JavaScript that compiles to clean JavaScript output.

  • TensorFlow photo TensorFlow

    An Open Source Machine Learning Framework for Everyone

  • Django photo Django

    The Web framework for perfectionists with deadlines.

  • D3 photo D3

    Bring data to life with SVG, Canvas and HTML. ๐Ÿ“Š๐Ÿ“ˆ๐ŸŽ‰

Recommend Topics

  • javascript

    JavaScript (JS) is a lightweight interpreted programming language with first-class functions.

  • web

    Some thing interesting about web. New door for the world.

  • server

    A server is a program made to process requests and deliver data to clients.

  • Machine learning

    Machine learning is a way of modeling and interpreting data that allows a piece of software to respond intelligently.

  • Game

    Some thing interesting about game, make everyone happy.

Recommend Org

  • Facebook photo Facebook

    We are working to build community through open source technology. NB: members must have two-factor auth.

  • Microsoft photo Microsoft

    Open source projects and samples from Microsoft.

  • Google photo Google

    Google โค๏ธ Open Source for everyone.

  • D3 photo D3

    Data-Driven Documents codes.