Skip to content

Commit

Permalink
rename everything
Browse files Browse the repository at this point in the history
"iotf" stands for "IoT Foundation" which is the "legacy" name of the
Watson IoT Platform.
  • Loading branch information
boneskull committed Sep 21, 2017
1 parent 4045f32 commit 69cf7c1
Show file tree
Hide file tree
Showing 7 changed files with 30 additions and 22 deletions.
2 changes: 1 addition & 1 deletion .gitignore
Original file line number Diff line number Diff line change
Expand Up @@ -154,4 +154,4 @@ crashlytics-build.properties
fabric.properties

/uibmiotf_config.py
uibmiotf.json
watson_iot.json
30 changes: 19 additions & 11 deletions README.md
Original file line number Diff line number Diff line change
@@ -1,4 +1,4 @@
# micropython-ibmiotf
# micropython-watson-iot

> Unofficial IBM Watson IoT Platform SDK for Devices Running Micropython
Expand All @@ -7,15 +7,23 @@
Install with [micropython](https://github.com/micropython/micropython)'s `upip`:

```bash
$ micropython -m upip install micropython-umqtt.simple micropython-umqtt.robust micropython-ibmiotf
$ /path/to/micropython -m upip install micropython-logging micropython-umqtt.simple micropython-umqtt.robust micropython-watson-iot
```

## Install (bare metal)

You will need to manually copy `watson_iot.py`, as well as the prereqs `umqtt.robust` and `umqtt.simple`, and `logging.py` onto your device.

> The two `umqtt` modules must live in a `umqtt/` directory.
## Usage

In lieu of proper API documentation, here are a bunch of examples:

### Connecting

```python
from uibmiotf import Device
from watson_iot import Device

my_device = Device(
device_id='my-device-id', # required
Expand Down Expand Up @@ -92,7 +100,7 @@ my_device.unset_command('my-command')

### Registering a Custom Message Format

`micropython-ibmiotf` comes with built-in encoders and decoders for JSON (`json`) and plain text (`text`) message formats.
`micropython-watson-iot` comes with built-in encoders and decoders for JSON (`json`) and plain text (`text`) message formats.

**All incoming messages (via commands, for example) are byte literals!**

Expand Down Expand Up @@ -131,35 +139,35 @@ my_device.unset_decoder('csv')

## Limitations

`micropython-ibmiotf` is designed to run on severely resource-constrained microcontrollers.
`micropython-watson-iot` is designed to run on severely resource-constrained microcontrollers.

If your use case falls outside of the limitations listed below, take a look at [the official Python SDK](https://github.com/ibm-watson-iot/iot-python) instead.

### No "Applications" Nor "Gateways"

`micropython-ibmiotf` supports "unmanaged devices" only:
`micropython-watson-iot` supports "unmanaged" devices only (at time of writing):

> A device is anything that has a connection to the internet and has data to send to or receive from the cloud. You can use devices to send event information such as sensor readings to the cloud, and to accept commands from applications in the cloud.
That means you cannot create an [application](https://console.bluemix.net/docs/services/IoT/applications/app_dev_index.html#app_dev_index) or [gateway](https://console.bluemix.net/docs/services/IoT/gateways/gw_dev_index.html#gw_dev_index) with `micropython-ibmiotf`.
That means you cannot create an [application](https://console.bluemix.net/docs/services/IoT/applications/app_dev_index.html#app_dev_index) or [gateway](https://console.bluemix.net/docs/services/IoT/gateways/gw_dev_index.html#gw_dev_index) with `micropython-watson-iot`.

### No "Managed Devices"

`micropython-ibmiotf` (as of this writing) does not support [managed devices](https://console.bluemix.net/docs/services/IoT/devices/device_mgmt/index.html#index).
`micropython-watson-iot` (as of this writing) does not support [managed devices](https://console.bluemix.net/docs/services/IoT/devices/device_mgmt/index.html#index).

This may or may not be feasible.

### No XML Support

`micropython-ibmiotf` does not (and likely *will not*) parse commands received as XML; nor does it provide any "helpers" to publish events as XML.
`micropython-watson-iot` does not (and likely *will not*) parse commands received as XML; nor does it provide any "helpers" to publish events as XML.

### No Support for QoS 2

As of Sep 20, 2017, the official Micropython MQTT client does not support QoS 2, so neither does `micropython-ibmiotf`.
As of Sep 20, 2017, the official Micropython MQTT client does not support QoS 2, so neither does `micropython-watson-iot`.

### Micropython Itself

Micropython [is not CPython](http://docs.micropython.org/en/latest/pyboard/genrst/index.html). While Micropython is *based on* Python 3, `micropython-ibmiotf` is not targeting Python 3, nor is it targeting any forks of Micropython.
Micropython [is not CPython](http://docs.micropython.org/en/latest/pyboard/genrst/index.html). While Micropython is *based on* Python 3, `micropython-watson-iot` is not targeting Python 3, nor is it targeting any forks of Micropython.

# License

Expand Down
6 changes: 3 additions & 3 deletions example/handle_command.py
Original file line number Diff line number Diff line change
Expand Up @@ -13,10 +13,10 @@
Commands can also be sent via RESTful API.
"""

from uibmiotf import Device
from watson_iot import Device

# options can be loaded from uibmiotf.json; see
# uibmiotf.example.json for example
# options can be loaded from watson_iot.json; see
# watson_iot.example.json for example
my_device = Device(
device_id='my-device-id',
device_type='my-device-type',
Expand Down
6 changes: 3 additions & 3 deletions example/publish_event.py
Original file line number Diff line number Diff line change
Expand Up @@ -15,11 +15,11 @@
which devices and events they subscribe to."
"""

from uibmiotf import Device
from watson_iot import Device
import utime as time

# options can be loaded from uibmiotf.json; see
# uibmiotf.example.json for example
# options can be loaded from watson_iot.json; see
# watson_iot.example.json for example
device = Device(
device_id='my-device-id',
device_type='my-device-type',
Expand Down
File renamed without changes.
4 changes: 2 additions & 2 deletions setup.py
Original file line number Diff line number Diff line change
Expand Up @@ -91,11 +91,11 @@ def filter_tar(self, name):


setup(
name='micropython-ibmiotf',
name='micropython-watson-iot',
version='0.0.1',
packages=find_packages(),
description='Unofficial IBM Watson IoT Platform SDK for Devices Running Micropython',
url='https://github.com/boneskull/micropython-ibmiotf',
url='https://github.com/boneskull/micropython-watson-iot',
author='Christopher Hiller',
author_email='boneskull@boneskull.com',
maintainer='Christopher Hiller',
Expand Down
4 changes: 2 additions & 2 deletions uibmiotf/__init__.py → watson_iot.py
Original file line number Diff line number Diff line change
Expand Up @@ -35,12 +35,12 @@ def bytes_to_json(value):
def Device(**kwargs):
"""
Creates a Device object by merging parameters into contents of
`uibmiotf.json`, if present.
`watson_iot.json`, if present.
:return: New Device
:rtype: UnmanagedDevice
"""
try:
fh = open('uibmiotf.json')
fh = open('watson_iot.json')
# noinspection PyTypeChecker
config = dict(json.loads(fh.read()))
kwargs.update(**config)
Expand Down

0 comments on commit 69cf7c1

Please sign in to comment.