Skip to content

Add MQTT Class #24

New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

Merged
merged 35 commits into from
Jul 17, 2019
Merged
Show file tree
Hide file tree
Changes from all commits
Commits
Show all changes
35 commits
Select commit Hold shift + click to select a range
c010dcf
start adding mqtt client to init
Jul 11, 2019
0412871
add on_connect, on_disconnect, on_message, client-level callbacks
Jul 11, 2019
2422872
add sub/pub, refactor to reflect latest minimqtt
Jul 11, 2019
e8155fc
parse messages properly within on_message
Jul 11, 2019
11ad65e
cleanup publish_multiple a bit..
Jul 11, 2019
fff6baa
add subpub example code!
Jul 11, 2019
fed0298
add weather subscription method and example
Jul 11, 2019
b615e84
add methods to subscribe to randomizer service api, throttling feed
Jul 11, 2019
2306cbf
add /get retain method, modify on_message_mqtt to correctly parse a g…
Jul 16, 2019
febfdb7
start refactoring - get rid of MMQTT dep, it shouldnt be called from …
Jul 16, 2019
3b5d0a2
refactor to use an external mqtt client, not init one.
Jul 16, 2019
2d51477
add a mqtterror class
Jul 16, 2019
1ffa360
add special time topics, on_message parsing
Jul 16, 2019
b87ca44
pylint a bunch
Jul 16, 2019
efeb8df
Black errors
Jul 17, 2019
d67fcc8
replace IO REST with IO HTTP to match IO MQTT client name, remove deps
Jul 17, 2019
1f87bdd
add test file and modified unittest
Jul 17, 2019
730953c
reorganize tests
Jul 17, 2019
61681ef
add new travis location, remove unnecessary simpletest
Jul 17, 2019
b6830b3
remove old simpletests with invalid method signatures, etc
Jul 17, 2019
581dcbc
require username, reimport struct time...
Jul 17, 2019
566b6cf
add time topic example
Jul 17, 2019
7cc98d2
Adding publishing location/metadata via csv topic, add example
Jul 17, 2019
bf18c6b
add group example
Jul 17, 2019
188e90b
linted!
Jul 17, 2019
52c8167
removal of bad eval()
Jul 17, 2019
a2772c9
remove old unittests
Jul 17, 2019
99f3d0a
fix exit method, dc on exit
Jul 17, 2019
fa225cb
pylint and rename all mqtt examples, drop mqtt prefix as they're in t…
Jul 17, 2019
1abb2d8
pylint examples again
Jul 17, 2019
1f5d2ba
fixup sphinx
Jul 17, 2019
74f074c
fix autodoc in file
Jul 17, 2019
7fc15a4
lint
Jul 17, 2019
eb14759
drop log from example
Jul 17, 2019
5cc8839
there isnt a dep for esp32spi, drop it. add new examples to readme
Jul 17, 2019
File filter

Filter by extension

Filter by extension

Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
3 changes: 2 additions & 1 deletion .travis.yml
Original file line number Diff line number Diff line change
Expand Up @@ -43,6 +43,7 @@ install:

script:
- pylint adafruit_io/*.py
- ([[ ! -d "examples" ]] || pylint --disable=missing-docstring,invalid-name,bad-whitespace examples/*.py)
- ([[ ! -d "examples" ]] || pylint --disable=missing-docstring,invalid-name,bad-whitespace examples/http/*.py)
- ([[ ! -d "examples" ]] || pylint --disable=missing-docstring,invalid-name,bad-whitespace examples/mqtt/*.py)
- circuitpython-build-bundles --filename_prefix adafruit-circuitpython-adafruit_io --library_location .
- cd docs && sphinx-build -E -W -b html . _build/html && cd ..
36 changes: 2 additions & 34 deletions README.rst
Original file line number Diff line number Diff line change
Expand Up @@ -23,48 +23,16 @@ This driver depends on:

* `Adafruit CircuitPython <https://github.com/adafruit/circuitpython>`_

You'll also need a library to communicate with an ESP32 as a coprocessor using a WiFiManager object. This library supports connecting an ESP32 using either SPI or UART.

* SPI: `Adafruit CircuitPython ESP32SPI <https://github.com/adafruit/Adafruit_CircuitPython_ESP32SPI>`_

* UART: `Adafruit CircuitPython ESP_ATcontrol <https://github.com/adafruit/Adafruit_CircuitPython_ESP_ATcontrol>`_

Please ensure all dependencies are available on the CircuitPython filesystem.
This is easily achieved by downloading
`the Adafruit library and driver bundle <https://github.com/adafruit/Adafruit_CircuitPython_Bundle>`_.

Usage Example
=============

Create an Adafruit IO Client object

.. code-block:: python

io = RESTClient(aio_username, aio_key, wifi)

Sending data to an Adafruit IO feed

.. code-block:: python

io.send_data(feed, data)

Receiving data from an Adafruit IO feed

.. code-block:: python

data = io.receive_data(feed)

Creating a new feed named circuitpython with a description

.. code-block:: python

feed = io.create_new_feed('circuitpython', 'an Adafruit IO CircuitPython feed')

Listing the record of a specified feed:
Usage examples for the Adafruit IO HTTP API are within the examples/http folder.

.. code-block:: python

feed = io.get_feed('circuitpython')
Usage examples for the Adafruit IO MQTT API are within the examples/mqtt folder.

Contributing
============
Expand Down
Loading