GithubHelp home page GithubHelp logo

azholtikov / zh_gateway Goto Github PK

View Code? Open in Web Editor NEW
4.0 1.0 0.0 58 KB

Gateway for ESP32 ESP-IDF for data exchange between ESP-NOW devices and MQTT broker via WiFi/LAN.

License: Apache License 2.0

CMake 0.59% C 99.41%

zh_gateway's Introduction

ESP-NOW Gateway

Gateway for ESP32 ESP-IDF for data exchange between ESP-NOW devices and MQTT broker via WiFi/LAN.

Tested on

  1. ESP32 ESP-IDF v5.2

Features

  1. Automatically adds gateway configuration to Home Assistan via MQTT discovery as a binary_sensor.
  2. Automatically adds supported devices configurations to Home Assistan via MQTT discovery.
  3. Update firmware from HTTPS server via OTA.
  4. Update firmware of supported devices from HTTPS server via ESP-NOW.
  5. LAN or WiFi connection to router.
  6. Direct or mesh work mode.

Notes

  1. All devices on the network must have the same work mode.
  2. ESP-NOW mesh network based on the zh_network.
  3. For initial settings use "menuconfig -> ZH Gateway Configuration". After first boot all settings (except work mode) will be stored in NVS memory for prevente change during OTA firmware update.
  4. To restart the gateway, send the "restart" command to the root topic of the gateway (example - "homeassistant/gateway/70-03-9F-44-BE-F7").
  5. To update the gateway firmware, send the "update" command to the root topic of the gateway (example - "homeassistant/gateway/70-03-9F-44-BE-F7"). The update path should be like as "https://your_server/zh_gateway_esp32.bin". The online status of the update is displayed in the root gateway topic.

Build and flash

Run the following command to firmware build and flash module:

cd your_projects_folder
git clone --recurse-submodules https://github.com/aZholtikov/zh_gateway.git
cd zh_gateway
idf.py menuconfig
idf.py build
idf.py flash

Attention

  1. The program is tested on LILYGO T-ETH-Lite ESP32 and Wireless-Tag WT32-ETH01. To work on another module it will be necessary change ZH_LAN_MODULE_TYPE and ZH_LAN_MODULE_POWER_PIN (for using LAN connection only). No changes are required when using a WiFi connection.
  2. If using a WiFi connection, the WiFi router must be set to the same channel as ESP-NOW.
  3. Only one device can be updated via ESP-NOW at a time. During the device upgrade, there may be delays in the response of others devices on the network.
  4. The certificate (certificate.pem) must match the upgrade server.

Supported devices

  1. zh_espnow_switch
  2. zh_espnow_led
  3. zh_espnow_sensor

Any feedback will be gladly accepted.

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.