diff --git a/README.md b/README.md index dc5bef3e..f32bdf1f 100644 --- a/README.md +++ b/README.md @@ -1,73 +1,6 @@ -IBM Internet of Things Foundation for Python -============================================ +##Bluemix Deployment +Deploy the mobile phone demonstration into your own set of Bluemix services: a Python runtime, the Internet of Things service for devices, MQTT messaging and the Cloudant service for application data. -Python module for interacting with the [IBM Internet of Things Foundation](https://internetofthings.ibmcloud.com). - -* [Python 3.4](https://www.python.org/downloads/release/python-343/) -* [Python 2.7](https://www.python.org/downloads/release/python-279/) - -Note: Support for MQTT over SSL requires at least Python v2.7.9 or v3.4, and openssl v1.0.1 - - -Dependencies ------------- -* [paho-mqtt](https://pypi.python.org/pypi/paho-mqtt) -* [iso8601](https://pypi.python.org/pypi/iso8601) -* [pytz](https://pypi.python.org/pypi/pytz) -* [requests](https://pypi.python.org/pypi/requests) - - -Installation ------------- -Install the latest version of the library with pip -``` -[root@localhost ~]# pip install ibmiotf -``` - - -Uninstall ---------- -Uninstalling the module is simple. -``` -[root@localhost ~]# pip uninstall ibmiotf -``` - -Migrating from v0.0.x to v0.1.x -------------------------------- -There is a significant change between the 0.0.x releases and 0.1.x that will require changes to client code. Now that the library properly supports multiple -message formats you will want to update calls to deviceClient.publishEvent, appClient.publishEvent and appClient.publishCommand to also supply the desired message format. - -Sample code v0.0.9: -```python -deviceOptions = {"org": organization, "type": deviceType, "id": deviceId, "auth-method": authMethod, "auth-token": authToken} -deviceCli = ibmiotf.device.Client(deviceOptions) -myData = { 'hello' : 'world', 'x' : x} -deviceCli.publishEvent(event="greeting", data=myData) -``` - -Sample code v0.1.1: -```python -deviceOptions = {"org": organization, "type": deviceType, "id": deviceId, "auth-method": authMethod, "auth-token": authToken} -deviceCli = ibmiotf.device.Client(deviceOptions) -myData = { 'hello' : 'world', 'x' : x} -deviceCli.publishEvent(event="greeting", msgFormat="json", data=myData) -``` - -Also, as part of this change, events and commands sent as format "json" will not be assumed to meet the [IOTF JSON Payload Specification](https://docs.internetofthings.ibmcloud.com/messaging/payload.html#iotf-json-payload-specification). The default client behaviour will be to parse commands and events with format "json" as a generic JSON object only. Only messages sent as format "json-iotf" will default to being decoded in this specification. This can be easily changed -with the following code. - -```python -import ibmiotf.device -from ibmiotf.codecs import jsonIotfCodec - -deviceOptions = {"org": organization, "type": deviceType, "id": deviceId, "auth-method": authMethod, "auth-token": authToken} -deviceCli = ibmiotf.device.Client(deviceOptions) -# Revert to v0.0.x parsing for json messages -- assume all JSON events and commands use the IOTF JSON payload specification -deviceCli.setMessageEncoderModule('json', jsonIotfCodec) -``` - - -Documentation -------------- -* [Device Client](https://docs.internetofthings.ibmcloud.com/libraries/python_cli_for_devices.html) -* [Application Client](https://docs.internetofthings.ibmcloud.com/libraries/python_cli_for_apps.html) +[![Deploy to Bluemix] +(https://bluemix.net/deploy/button.png)] +(https://bluemix.net/deploy?repository=https://github.com/D5YhtS0ofv/iot-python) diff --git a/manifest.yml b/manifest.yml new file mode 100644 index 00000000..6c6ea3ce --- /dev/null +++ b/manifest.yml @@ -0,0 +1,21 @@ +declared-services: + iot-python-phone-demo-cloudantNoSQLDB: + label: cloudantNoSQLDB + plan: Shared + iot-python-phone-demo-iotf-service: + label: iotf-service + plan: iotf-service-free + +applications: +- services: + - iot-python-phone-demo-cloudantNoSQLDB + - iot-python-phone-demo-iotf-service + host: iot-python-phone-demo + name: iot-python-phone-demo + memory: 64M + disk_quota: 256M + command: python server.py + domain: mybluemix.net + path: samples/bluemixZoneDemo + instances: 1 + \ No newline at end of file diff --git a/samples/bluemixZoneDemo/README.md b/samples/bluemixZoneDemo/README.md index c84f0e60..f98572a7 100644 --- a/samples/bluemixZoneDemo/README.md +++ b/samples/bluemixZoneDemo/README.md @@ -1,7 +1,5 @@ -#Bluemix Zone Demo -Sample application demonstrating how to send events to the cloud from a device and process them in an application. The application demonstrates one approach to delegating access to sensor data in the IOT Foundation to users of a backend application utilising an IOT Foundation API key. - -See the demo application running live: http://iot-demo.mybluemix.net/ +#Bluemix Solutions Demo +Sample application demonstrating how to send events to the cloud from a device and process them in an application. The application demonstrates one approach to delegating access to sensor data in the Internet of Things service to users of a backend application using an Internet of Things service API key. You can also see the demo application running in the IBM Bluemix Internet of Things solutions page https://console.ng.bluemix.net/solutions/iot @@ -18,14 +16,17 @@ The main application is a Python WSGI server which primarily exists to provide d ### The Simulated Device -The second part of the application is a page designed to be run on a users phone that uses JavaScript to simulate device code running on the phone. The device code presents the same username & PIN to the backend application for authentication, on a successful authentication the backend application will provide the device with the necessary credentials required to connect securely to the IOT Foundation. +The second part of the application is a page designed to be run on a users phone that uses JavaScript to simulate device code running on the phone. The device code presents the same username & PIN to the backend application for authentication, on a successful authentication the backend application will provide the device with the necessary credentials required to connect securely to the Internet of Things service. --- ##Bluemix Deployment -The sample is specifically designed to be deployed into Bluemix. The application requires a binding to both an instance of the IOTF & Cloudant services. +The sample is specifically designed to be deployed into Bluemix. The application requires a binding to both an instance of the Internet of Things service & Cloudant services. + +[![Deploy to Bluemix](https://bluemix.net/deploy/button.png)](https://bluemix.net/deploy?repository=https://github.com/D5YhtS0ofv/iot-python.git) + ###Get the sample source code ``` @@ -63,7 +64,7 @@ Open http://<app_name>.mybluemix.net/ in a browser ##Configuration -The demo supports multiple themes. The Demo running in Bluemix uses a highly customised theme specifically designed for the IOT Bluemix Zone, but there are a number of simpler themes included in the sample code that provide a cleaner starting point for building your own application based on this sample. +The demo supports multiple themes. The Demo running in Bluemix uses a highly customised theme specifically designed for the Bluemix Internet of Things solution page, but there are a number of simpler themes included in the sample code that provide a cleaner starting point for building your own application based on this sample. One way to do this is to use the cf **set-env** command: ``` diff --git a/samples/bluemixZoneDemo/views/device.tpl b/samples/bluemixZoneDemo/views/device.tpl index 25d77ec0..83fc7d97 100644 --- a/samples/bluemixZoneDemo/views/device.tpl +++ b/samples/bluemixZoneDemo/views/device.tpl @@ -11,7 +11,6 @@
-
@@ -28,7 +27,7 @@ Disconnected

So what exactly is happening here?

-

Using MQTT messaging, the accelerometer data from your phone is being sent to the IoT Foundation.

+

Using MQTT messaging, the accelerometer data from your phone is being sent to the Internet of Things service.

A Bluemix app is using this data to mirror your movements — go on, try moving your phone.

Still not convinced?

Look at the web app and see what happens when you shake your phone harder!

pFad - Phonifier reborn

Pfad - The Proxy pFad of © 2024 Garber Painting. All rights reserved.

Note: This service is not intended for secure transactions such as banking, social media, email, or purchasing. Use at your own risk. We assume no liability whatsoever for broken pages.


Alternative Proxies:

Alternative Proxy

pFad Proxy

pFad v3 Proxy

pFad v4 Proxy