Skip to content

Latest commit

 

History

History
44 lines (31 loc) · 3.04 KB

readme.md

File metadata and controls

44 lines (31 loc) · 3.04 KB

This project was used as a demo platform for a technical talk on MQTT and is dependant on the following related resources:

This repository serves as the primary readme for the talk.

Tools and Dependencies

Please refer to the following resources

ESP8266 Resources

ESP8266 Library Dependencies

emqtt Broker emqtt.io

Once emqtt is downloaded and launched, following the directions on the site, you can get to the emqtt dashboard by going to http://localhost:18083/ and entering user name: admin and password public as defaults.

mqtt-spy

IoT Web Dashboard Dependencies

Please refer to the dashboard repository iot-led-dashboard for more information.

ESP8266 Code Description

IMPORTANT: This project uses Platformio's ability to "inject" defines based on the [env:...] build-flags argument for modifying the main.ino for multiple devices; including uploads. So, if you're a little unfamiliar with this, you'll see what appears like a constant (ie SET_LED_TOPIC_DEF) used in main.ino that doesn't seem to be defined. Just review the platformio.ini for its definition based on a particular [env:{device name}] set of defines. So, for your own purposes, modify the platformio.ini build flags to set defines as appropriate. There are defines for wifi settings, MQTT broker settings, and MQTT topics.

This program is designed to:

  1. connect to a predefined/hard-coded wifi SSID as defined in the platformio.ini file using the ESPHepler library
  2. connect to a predefined/hard-coded MQTT broker s defined in the platformio.ini file; also using the ESPHepler library
  3. Detect a button press to ramp a pot (short for potentiometer) value up and down; cycling as long as the button is pressed
  4. Listen for pot and led value set from predefined/hard-coded topics as defined in the platformio.ini file and update the local system as appropriate
  5. Send the pot value to a predefined/hard-coded topic as defined in the platformio.ini file when the value changes either by button press(es) or MQTT topic set(s)
  6. Send the led value to a predefined/hard-coded topic as defined in the platformio.ini file when the value changes by MQTT topic set(s)