Git Product home page Git Product logo

hcc-esp32's Introduction

Home Climate Control ESP32 based edge device firmware

This application connects to WiFi, then to the MQTT broker, introduces itself and starts sending sensor data on MQTT publish topic, and listening to commands on MQTT subscribe topic, according to DZ edge device MQTT protocol.

All configuration parameteres are selected using idf.py menuconfiig.

Project Status

Early access. "Release early, release often". Right now, this project provides functionality identical to hcc-esp8266, but on ESP-IDF as opposed to Arduino. More moving pieces, but more power early on. Bug reports are welcome.

How to use this application

Prerequisites

Hardware Required

  • This application can be executed on any ESP32 board, the only required interfaces are GPIO and WiFi.
  • For development, Adafruit HUZZAH32 is used, reason being - it features 1S LiPo battery connector and charger. Given the fact that the devices being developed will be most likey remote and wireless, this is a serious advantage. YMMV.
  • 1-Wire sensors. The only one supported right now is DS18B20 (family 0x28), more to come (request support here if you want it earlier). Beware of counterfeits.

Configure the project

  • Open the project configuration menu (idf.py menuconfig)
  • Configure Wi-Fi, MQTT and 1-Wire settings under "hss-esp32 Configuration" menu.
  • When using Make build system, set Default serial port under Serial flasher config.

Build and Flash

Build the project and flash it to the board, then run monitor tool to view serial output:

idf.py -p PORT flash monitor

(To exit the serial monitor, type Ctrl-].)

Example MQTT Output

The output is duplicated on the serial console and in MQTT output stream.

/hcc/edge {"entity_type":"sensor","device_id":"ESP32-246F28A7C53C","sources":["D90301A2792B0528","E40300A27970F728"]}
/hcc/sensor/D90301A2792B0528 {"entity_type":"sensor","name":"D90301A2792B0528","signature":"TD90301A2792B0528","signal":24.625,"device_id":"ESP32-246F28A7C53C"}
/hcc/sensor/E40300A27970F728 {"entity_type":"sensor","name":"E40300A27970F728","signature":"TE40300A27970F728","signal":26.1875,"device_id":"ESP32-246F28A7C53C"}

What's next?

  • You might want to explore the Home Climate Control project, for which these edge devices were intended in the first place.
  • If all you want is a simple MQTT temperature sensor, then take a look at hcc-esp8266 - it has a lower entry threshold.

hcc-esp32's People

Contributors

climategadgets avatar

Stargazers

 avatar  avatar  avatar  avatar  avatar  avatar  avatar

Watchers

 avatar  avatar  avatar

hcc-esp32's Issues

Implement PWM servo control

As an application developer, I want to be able to issue PWM positioning commands so that RC servos connected to GPIO pins can be controlled.

Acceptance criteria: RC servos connected to GPIO pins execute PWM positioning commands.

Implement straight A4988 operations

As an application developer, I want to be able to issue direction and step commands via A4988 driver, so that I can control steppers.

Acceptance criteria: direction and step commands issued to A4988 driver API make the stepper move.

Reconcile blink behavior with hcc-esp8266

As a Home Climate Control user, I want all edge devices to have consistent behavior so that I don't have to remember which is which and stay amazed at subtle differences between them.

Acceptance criteria: onboard LED blink pattern is the same as hcc-esp8266 provides:

  • LED stays on while connecting to WiFi and MQTT broker;
  • LED turns on for 5ms before 1-Wire bus poll, and for 5ms after.

Integrate WiFi and Ethernet connectivity into the project code

As an application developer, I want my project to not depend on WiFi and Ethernet connectivity example code so that it can be packaged and distributed independently.

Acceptance criteria: there are no references to components $ENV{IDF_PATH}/examples in the code.

Convert the code base to C++

As an application developer, I want to be able to code in C++ so that I can, well, utilize OOP concepts.

Acceptance criteria: ongoing task until all loose ends that it makes sense to convert are converted.

Implement A4988 power management

As an application developer, I want to be able to order A4988 chip to fall asleep, so that I can conserve energy.

Acceptance criteria: SLP signal passed to A4988 and works as documented.

Allow to enable and disable 1-Wire support via menuconfig

As an application user, I want to be able to enable and disable 1-Wire support so that I can either use 1-Wire devices, or save the GPIO pin for other purposes.

Acceptance criteria:

  • 1-Wire subsection in menuconfig can be completely enabled or disabled
  • 1-Wire code must not execute if the support is disabled

Implement A4988 microstepping support

As an application developer, I want to be able to order A4988 chip to move the stepper in microsteps, so that I can implement silent operation and fine control.

Acceptance criteria: All microstepping modes work as documented.

Depends on #9.

Add A4988 support to menuconfig

As an application developer, I want idf.py menuconfig to include configuration elements specific to A4988 stepper driver.

Acceptance criteria: idf.py menuconfig allows to set the following parameters:

  • Enable or disable A4988 support completely
  • Enable or disable microstepping support
  • Enable or disable power saving feature support
  • Choose GPO pins for individual functions, with sensible defaults

Note: not enabling extra features frees up to 3 (microstepping) + 1 (power saving) GPIO pins.

Get time from NTP

As an application developer and an infrastructure engineer, I want my application to be able to provide NTP sourced timestamps so that MQTT consumers can observe correct event time.

Acceptance criteria: Actual time retrieved from NTP and available for information producers within application.

Create configuration

As an application developer, I want idf.py menuconfig to include my application's configuration elements so that my application is properly configured.

Acceptance criteria: idf.py menuconfig allows to set the following parameters:

  • WiFI access point:
    • SSID
    • security token
  • MQTT:
    • Broker MQTT URL
    • Root publish topic
    • Root subscribe topic
  • 1-Wire (also see #8):
    • GPIO pin
    • Poll interval
  • A4988 stepper driver: see #7
  • When PKI is supported,
    • Public key
    • Private key

Remove hardcoded max 1-Wire devices limit

  • Expected behavior: As many 1-Wire devices are detected and sampled as there are on the bus.
  • Actual behavior: the number is hardcoded at menuconfig time (see 9b44c6fa0f4062299e4f516843c5a07a29fd260c).

Acceptance criteria: the hardcoded limit is removed, and arbitrary number of devices is handled with dynamically allocated memory.

Publish 1-Wire sensor samples to MQTT

(depends on #4)

As an application developer, I want to publish 1-Wire sensor samples to MQTT so that they can be consumed at the other end.

Acceptance criteria: 1-Wire sensor samples are successfully consumed at the given MQTT topic.

Implement limit switch and failsafe position in stepper API

As an application developer, I want to be able to use a limit switch and failsafe position with stepper based mechanisms to assure their power loss tolerance.

Acceptance criteria:

  • Logic to detect limit switch and disable further stepper movement in a given direction is implemented;
  • Logic to move the stepper into a given location on boot is implemented.

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.