From 3720d284fddaec950e0ccf97d1673edba4d9a196 Mon Sep 17 00:00:00 2001 From: D5YhtS0ofv Date: Thu, 16 Jul 2015 11:19:56 -0400 Subject: [PATCH 01/10] Update read add Deploy to Bluemix button. --- samples/bluemixZoneDemo/README.md | 14 +++++++------- 1 file changed, 7 insertions(+), 7 deletions(-) diff --git a/samples/bluemixZoneDemo/README.md b/samples/bluemixZoneDemo/README.md index c84f0e60..f03523db 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,16 @@ 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=) ###Get the sample source code ``` @@ -63,7 +63,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: ``` From 8531e1c4f47f46cd68b140d87f9b0f87d2be9886 Mon Sep 17 00:00:00 2001 From: D5YhtS0ofv Date: Thu, 16 Jul 2015 11:24:35 -0400 Subject: [PATCH 02/10] Fix repository URL --- samples/bluemixZoneDemo/README.md | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/samples/bluemixZoneDemo/README.md b/samples/bluemixZoneDemo/README.md index f03523db..fefadb1d 100644 --- a/samples/bluemixZoneDemo/README.md +++ b/samples/bluemixZoneDemo/README.md @@ -25,7 +25,7 @@ The second part of the application is a page designed to be run on a users phone ##Bluemix Deployment 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=) +[![Deploy to Bluemix](https://bluemix.net/deploy/button.png)](https://bluemix.net/deploy?repository=https://github.com/D5YhtS0ofv/iot-python/tree/master/samples/bluemixZoneDemo) ###Get the sample source code ``` From 4a40cc3e40f8cb6e313c847620feaec3afbd29b9 Mon Sep 17 00:00:00 2001 From: D5YhtS0ofv Date: Thu, 16 Jul 2015 11:29:29 -0400 Subject: [PATCH 03/10] new repository URL again... --- samples/bluemixZoneDemo/README.md | 3 ++- 1 file changed, 2 insertions(+), 1 deletion(-) diff --git a/samples/bluemixZoneDemo/README.md b/samples/bluemixZoneDemo/README.md index fefadb1d..f98572a7 100644 --- a/samples/bluemixZoneDemo/README.md +++ b/samples/bluemixZoneDemo/README.md @@ -25,7 +25,8 @@ The second part of the application is a page designed to be run on a users phone ##Bluemix Deployment 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/tree/master/samples/bluemixZoneDemo) +[![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 ``` From 5a7f80688f64407f58d73d551cdd5ee6c7c8cc53 Mon Sep 17 00:00:00 2001 From: D5YhtS0ofv Date: Mon, 20 Jul 2015 12:51:50 -0400 Subject: [PATCH 04/10] New manifest file for Bluemix deployment --- manifest.yml | 21 +++++++++++++++++++++ 1 file changed, 21 insertions(+) create mode 100644 manifest.yml diff --git a/manifest.yml b/manifest.yml new file mode 100644 index 00000000..4087261e --- /dev/null +++ b/manifest.yml @@ -0,0 +1,21 @@ +declared-services: + iot-python-cloudantNoSQLDB: + label: cloudantNoSQLDB + plan: Shared + iot-python-iotf-service: + label: iotf-service + plan: iotf-service-free + +applications: +- services: + - iot-python-cloudantNoSQLDB + - iot-python-iotf-service + host: iot-python + name: iot-python + disk: 64M + command: setup.py + path: . + domain: mybluemix.net + memory: 64M + instances: 1 + \ No newline at end of file From 0bfabb945026c93b86dd5fe91c65faff23af73df Mon Sep 17 00:00:00 2001 From: D5YhtS0ofv Date: Mon, 20 Jul 2015 12:59:56 -0400 Subject: [PATCH 05/10] Just show deploy to Bluemix button --- README.md | 77 ++++------------------------------------------------ manifest.yml | 13 ++++----- 2 files changed, 10 insertions(+), 80 deletions(-) diff --git a/README.md b/README.md index dc5bef3e..9a35c421 100644 --- a/README.md +++ b/README.md @@ -1,73 +1,6 @@ -IBM Internet of Things Foundation for Python -============================================ +##Bluemix Deployment +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. -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 index 4087261e..dcc81f60 100644 --- a/manifest.yml +++ b/manifest.yml @@ -5,17 +5,14 @@ declared-services: iot-python-iotf-service: label: iotf-service plan: iotf-service-free - + applications: - services: - iot-python-cloudantNoSQLDB - iot-python-iotf-service host: iot-python name: iot-python - disk: 64M - command: setup.py - path: . - domain: mybluemix.net - memory: 64M - instances: 1 - \ No newline at end of file +- command: python server.py + domain: mybluemix.net + path: samples/bluemixZoneDemo + instances: 1 \ No newline at end of file From f418aa33fa565f2c123ad0d718f42254f3c4d87b Mon Sep 17 00:00:00 2001 From: D5YhtS0ofv Date: Mon, 20 Jul 2015 13:09:24 -0400 Subject: [PATCH 06/10] Removed erroneous hyphen --- manifest.yml | 4 ++-- 1 file changed, 2 insertions(+), 2 deletions(-) diff --git a/manifest.yml b/manifest.yml index dcc81f60..43fc7408 100644 --- a/manifest.yml +++ b/manifest.yml @@ -12,7 +12,7 @@ applications: - iot-python-iotf-service host: iot-python name: iot-python -- command: python server.py - domain: mybluemix.net + command: python server.py + domain: mybluemix.net path: samples/bluemixZoneDemo instances: 1 \ No newline at end of file From 174ee64fa4830a24fb760762457a23d82f7f3f6d Mon Sep 17 00:00:00 2001 From: D5YhtS0ofv Date: Mon, 20 Jul 2015 13:22:27 -0400 Subject: [PATCH 07/10] Set memory and disk, update read. --- README.md | 2 +- manifest.yml | 13 ++++++++----- 2 files changed, 9 insertions(+), 6 deletions(-) diff --git a/README.md b/README.md index 9a35c421..f32bdf1f 100644 --- a/README.md +++ b/README.md @@ -1,5 +1,5 @@ ##Bluemix Deployment -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 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. [![Deploy to Bluemix] (https://bluemix.net/deploy/button.png)] diff --git a/manifest.yml b/manifest.yml index 43fc7408..2cb70c58 100644 --- a/manifest.yml +++ b/manifest.yml @@ -8,11 +8,14 @@ declared-services: applications: - services: - - iot-python-cloudantNoSQLDB - - iot-python-iotf-service - host: iot-python - name: iot-python + - 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 + instances: 1 + \ No newline at end of file From 4ed5414fb71dece8f4960ec8122921440fbe47c7 Mon Sep 17 00:00:00 2001 From: D5YhtS0ofv Date: Mon, 20 Jul 2015 13:48:45 -0400 Subject: [PATCH 08/10] Remove missing watermark from mobile page. --- samples/bluemixZoneDemo/views/device.tpl | 1 - 1 file changed, 1 deletion(-) diff --git a/samples/bluemixZoneDemo/views/device.tpl b/samples/bluemixZoneDemo/views/device.tpl index 25d77ec0..02014d49 100644 --- a/samples/bluemixZoneDemo/views/device.tpl +++ b/samples/bluemixZoneDemo/views/device.tpl @@ -11,7 +11,6 @@
-
From 4902af8874708fb238a89af7fcea8c4204dce260 Mon Sep 17 00:00:00 2001 From: D5YhtS0ofv Date: Mon, 20 Jul 2015 13:49:47 -0400 Subject: [PATCH 09/10] Change text. --- samples/bluemixZoneDemo/views/device.tpl | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/samples/bluemixZoneDemo/views/device.tpl b/samples/bluemixZoneDemo/views/device.tpl index 02014d49..83fc7d97 100644 --- a/samples/bluemixZoneDemo/views/device.tpl +++ b/samples/bluemixZoneDemo/views/device.tpl @@ -27,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!

From 0e8a575f59fe3234229e4d30330ea7107503f8ea Mon Sep 17 00:00:00 2001 From: D5YhtS0ofv Date: Mon, 20 Jul 2015 13:51:08 -0400 Subject: [PATCH 10/10] fix manifest --- manifest.yml | 4 ++-- 1 file changed, 2 insertions(+), 2 deletions(-) diff --git a/manifest.yml b/manifest.yml index 2cb70c58..6c6ea3ce 100644 --- a/manifest.yml +++ b/manifest.yml @@ -1,8 +1,8 @@ declared-services: - iot-python-cloudantNoSQLDB: + iot-python-phone-demo-cloudantNoSQLDB: label: cloudantNoSQLDB plan: Shared - iot-python-iotf-service: + iot-python-phone-demo-iotf-service: label: iotf-service plan: iotf-service-free 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