Adafruit_MQTT_Library/examples/mqtt_arbitrary_buffer/README.md

35 lines
725 B
Markdown
Raw Normal View History

2016-01-31 23:19:38 +01:00
# Adafruit MQTT Library example with support
2016-02-01 01:57:43 +01:00
This example illustrates Publish an arbitrary data packet using the Adafruit MQTT library to an MQTT feed which can then be parsed by the included python subscriber client.
2016-02-01 02:02:57 +01:00
## Installing and running Mosquitto
2016-02-01 02:03:23 +01:00
####On a Raspberry Pi:
2016-02-01 02:02:57 +01:00
```bash
sudo apt-get install mosquitto
```
2016-02-01 02:03:23 +01:00
####On a Mac:
2016-02-01 02:02:57 +01:00
```bash
brew install mosquitto
```
2016-02-01 02:00:38 +01:00
## Using Example Python Subscriber:
2016-02-01 01:57:43 +01:00
Install dependents if haven't already
2016-02-01 01:59:14 +01:00
```bash
2016-02-01 01:57:43 +01:00
cd ../Adafruit_MQTT_Library/examples/mqtt_arbitrary_buffer/python_subscriber
pip install -r requirements.txt
2016-02-01 01:59:14 +01:00
```
2016-02-01 01:57:43 +01:00
Run python script with default values
2016-02-01 01:59:14 +01:00
```bash
2016-02-01 01:57:43 +01:00
python subscriber.py
2016-02-01 01:59:14 +01:00
```
2016-02-01 01:57:43 +01:00
2016-02-01 02:00:38 +01:00
Use help to see a list of modifiable options
2016-02-01 01:59:14 +01:00
```bash
2016-02-01 01:57:43 +01:00
python subscriber.py -h
2016-02-01 01:59:14 +01:00
```