Adafruit_MQTT_Library/examples/mqtt_arbitrary_buffer
Stuart Feichtinger 8caa2dcfd6 More writing
2016-01-31 19:15:46 -06:00
..
python_subscriber Clean up 2016-01-31 18:57:31 -06:00
mqtt_arbitrary_buffer.ino Tweaks 2016-01-31 18:43:14 -06:00
README.md More writing 2016-01-31 19:15:46 -06:00

Adafruit MQTT Library example with support

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.

Installing and configuring Mosquitto (minimal working setup)

####On a Raspberry Pi/Linux:

sudo apt-get install mosquitto
cd /etc/mosquitto/
#See Common Setup Instructions Below

####On a Mac:

brew install mosquitto
cd /usr/local/etc/mosquitto
#See Common Setup Instructions Below

####Common

sudo nano mosquitto.conf

scroll about two thirds of the way down until you see:

# -----------------------------------------------------------------
# Default authentication and topic access control
# -----------------------------------------------------------------

You should see #password_file about a paragraph after that. Change

#password_file

To

password_file pwfile

Now ctrl-x to save and exit.

Using Example Python Subscriber:

Install dependents if haven't already

cd ../Adafruit_MQTT_Library/examples/mqtt_arbitrary_buffer/python_subscriber
pip install -r requirements.txt

Run python script with default values

python subscriber.py

Use help to see a list of modifiable options

python subscriber.py -h