Code Monkey home page Code Monkey logo

mqtt_button's Introduction

cub2bed_client

What is cub2bed_client?

Simple two-way message appliance

Purpose

First user alerts the second user to come2bed via status-light, and the second user responds with positive or negative response that the first user can see.

Contributors

Software Dependencies not in Arduino Library Manager

BOM

Pinouts

  • button input on pin 5 (see learnings)
  • button LED on pin 16
  • GND to button input, LED

Error codes

  • FATAL
    • Always throws a DEBUG message and blinks built-in LED at (error code x 1 second) intervals
    • ERR 01: Can not connect to MQTT broker. Device must be restarted.
    • ERR 02: Can not connect to Ethernet. Device must be restarted.
    • ERR 03: Can not connect to WiFi. Device must be restarted.
  • CAUTION - NOT IMPLEMENTED, see FR request
    • throws a DEBUG message
    • blinks built-in LED at (error code x 1 second) intervals
    • ERR 04: MQTT publish failed.

Information Sources

Issues

  • [P2]071620: button too dim (resistor, change LED?)
  • [P1]101320: cub2bedSub pulls last-1 message, not last message, causing logic issues?
  • [P2]101520: If cub2bedPub fails, downstream is not handled properly
  • [P2]101520: statusLightPub On should be handled by c2b server, not client, ensuring light only goes on when the server has recognized cub2bed message from client
  • [P2]102420: Move local MQTT server to named entry instead of IP address so DNS can resolve it if entry changes
  • [P2]110620: Client doesn't have a timeout to reset its state if no server message is received
  • [P1]122320: Client appears to light the button every 10 seconds for less than 1 second

Feature Requests

  • [P3]101220: MQTT- [P3]110920: publish to secondary MQTT broker
  • [P3]111020: publish to multiple MQTT brokers
  • [P2]111120: ThinkSpeak investigation
  • [P3]120620: Error messages to MQTT broker
  • [P1]012421: Async blinking of built-in LED for non-FATAL errors (e.g. MQTT publish)

Questions

Learnings

  • 071620 - Breadboard makes box fit not; 60mm might be tight either way. Might want to take z-axis to 65mm
  • 101220 - Seem to be having trouble with button input on multi-purposed ESP8266 pins. No issues on SCL/SDA

Revisions

  • 101220
    • new code branched from cub2bed_client
    • messaging via 900mhz radio removed
    • messaging via MQTT topic added
  • 101520
    • MQTT code improvements
  • 101620
    • [I]101620 [P1]; Example ping code fires every loop() but docs say to ping infrequently within the keepalive window to avoid packet collision -> add timer loop to ping at MQTT_KEEP_ALIVE
  • 103020
    • [I]101720 [P2]; blue LED on Huzzah board needs to be supressed (or piped!) -> moving button LED to pin 16 from 2 to separate from on-board LED. Added code to disable on-board LED.
    • [FR]051920 [P3]; Use the builtin LED as a crude indicator (packet send, receive, etc.) -> closed as duplicate to 102420 P2 issue
  • 010221
    • [FR]100120 [P3]; validate Ethernet code -> code aligned with functioning status_light Ethernet code
    • [FR]111020 [P3]; combine MQTT publish code blocks for AdafruitIO MQTT and generic MQTT -> complete
    • [I]101220 [P3]; AdafruitIO feeds not setup properly, see Publish setup code -> closed because of MQTT code merge
    • [I]102420 [P1]; Need an error indicator for for non-DEBUG, while(1) errors, MQTT connection errors -> while(1) error handling improved and now blinks button LED in unique pattern to indicate fatal error
  • 012421
    • [FR]123120 [P2]: Add error blink codes to onboard LED for while (1) -> Adding BUILT_IN_LED blinking matching the fatal error code, aligning with new code in air_quality

mqtt_button's People

Contributors

ericklein avatar

Watchers

 avatar

mqtt_button's Issues

button input not working

not detecting button presses. Need to properly wire the button (resistor) and also check what pin input mode ezButton defaults to?

light in button too dim

The light in the arcade button is too dim when lit. Might be an issue of bulb/LED optimized for 5v and only getting 3.3v from Huzzah?

Recommend Projects

  • React photo React

    A declarative, efficient, and flexible JavaScript library for building user interfaces.

  • Vue.js photo Vue.js

    ๐Ÿ–– Vue.js is a progressive, incrementally-adoptable JavaScript framework for building UI on the web.

  • Typescript photo Typescript

    TypeScript is a superset of JavaScript that compiles to clean JavaScript output.

  • TensorFlow photo TensorFlow

    An Open Source Machine Learning Framework for Everyone

  • Django photo Django

    The Web framework for perfectionists with deadlines.

  • D3 photo D3

    Bring data to life with SVG, Canvas and HTML. ๐Ÿ“Š๐Ÿ“ˆ๐ŸŽ‰

Recommend Topics

  • javascript

    JavaScript (JS) is a lightweight interpreted programming language with first-class functions.

  • web

    Some thing interesting about web. New door for the world.

  • server

    A server is a program made to process requests and deliver data to clients.

  • Machine learning

    Machine learning is a way of modeling and interpreting data that allows a piece of software to respond intelligently.

  • Game

    Some thing interesting about game, make everyone happy.

Recommend Org

  • Facebook photo Facebook

    We are working to build community through open source technology. NB: members must have two-factor auth.

  • Microsoft photo Microsoft

    Open source projects and samples from Microsoft.

  • Google photo Google

    Google โค๏ธ Open Source for everyone.

  • D3 photo D3

    Data-Driven Documents codes.