mbed connector webapp quickstart

Committer:
group-Make-NTU-Hackathon
Date:
Fri Feb 10 08:36:15 2017 +0000
Revision:
0:4233b7b10255
Initial commit

Who changed what in which revision?

UserRevisionLine numberNew contents of line
group-Make-NTU-Hackathon 0:4233b7b10255 1 # mbed-connector-python-quickstart
group-Make-NTU-Hackathon 0:4233b7b10255 2 This is a quickstart application for the [mbed-connector-api-python](https://github.com/armmbed/mbed-connector-api-python) package.
group-Make-NTU-Hackathon 0:4233b7b10255 3 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.
group-Make-NTU-Hackathon 0:4233b7b10255 4 The quickstart webapp is meant to be paired with the [quickstart embedded app](https://github.com/ARMmbed/mbed-client-quickstart). The quickstart web app will allow the user to visualize quickstart embedded devices and interact with them.
group-Make-NTU-Hackathon 0:4233b7b10255 5
group-Make-NTU-Hackathon 0:4233b7b10255 6 ### Pre-requisites
group-Make-NTU-Hackathon 0:4233b7b10255 7 - A [mbed connector](https://connector.mbed.com) account and have generated an [API token](https://connector.mbed.com/#accesskeys)
group-Make-NTU-Hackathon 0:4233b7b10255 8 - A endpoint running the [mbed client quickstart example](https://github.com/ARMmbed/mbed-client-quickstart)
group-Make-NTU-Hackathon 0:4233b7b10255 9 - Install the required packages `pip install -r requirements.txt`
group-Make-NTU-Hackathon 0:4233b7b10255 10
group-Make-NTU-Hackathon 0:4233b7b10255 11 ### Use
group-Make-NTU-Hackathon 0:4233b7b10255 12 1. Put your [API key](https://connector.mbed.com/#accesskeys) into the app.py file, replace the following text
group-Make-NTU-Hackathon 0:4233b7b10255 13 ```python
group-Make-NTU-Hackathon 0:4233b7b10255 14 token = "Change Me" # replace with your API token
group-Make-NTU-Hackathon 0:4233b7b10255 15 ```
group-Make-NTU-Hackathon 0:4233b7b10255 16 or set an evironment variable called `ACCESS_KEY` with the value of your API key
group-Make-NTU-Hackathon 0:4233b7b10255 17 2. Run the `app.py` file
group-Make-NTU-Hackathon 0:4233b7b10255 18 ```python
group-Make-NTU-Hackathon 0:4233b7b10255 19 python ./app.py
group-Make-NTU-Hackathon 0:4233b7b10255 20 ```
group-Make-NTU-Hackathon 0:4233b7b10255 21 3. Open a web page to the web.py server. Usually [//localhost:8080](//localhost:8080) will work.
group-Make-NTU-Hackathon 0:4233b7b10255 22 4. Interact with the web page, blink the LED's, subscribe to the resources, click the button on the board and see the numbers tick up on the web app.
group-Make-NTU-Hackathon 0:4233b7b10255 23 {{TODO: insert gif's here}}
group-Make-NTU-Hackathon 0:4233b7b10255 24 5. Modify : go checkout the API for the [mbed-connector-api-python library](https://docs.mbed.com/docs/mbed-connector-api-python/en/latest/) and make your own applications!
group-Make-NTU-Hackathon 0:4233b7b10255 25
group-Make-NTU-Hackathon 0:4233b7b10255 26
group-Make-NTU-Hackathon 0:4233b7b10255 27 ## Troubleshooting
group-Make-NTU-Hackathon 0:4233b7b10255 28 Here are some common problems and their solutions.
group-Make-NTU-Hackathon 0:4233b7b10255 29
group-Make-NTU-Hackathon 0:4233b7b10255 30 ##### Cannot establish a secure connection
group-Make-NTU-Hackathon 0:4233b7b10255 31 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]`.
group-Make-NTU-Hackathon 0:4233b7b10255 32
group-Make-NTU-Hackathon 0:4233b7b10255 33 ##### WebSocket transport not available
group-Make-NTU-Hackathon 0:4233b7b10255 34 Dont worry about that warning message, it is not applicable to this demo, but likewise the warning message cannot be disabled.
group-Make-NTU-Hackathon 0:4233b7b10255 35
group-Make-NTU-Hackathon 0:4233b7b10255 36 ##### ERROR 500 on trying to run the app.py file
group-Make-NTU-Hackathon 0:4233b7b10255 37 Make sure you added your [Access Key](https://connector.mbed.com/#accesskeys) 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.
group-Make-NTU-Hackathon 0:4233b7b10255 38