logo elektroda
logo elektroda
X
logo elektroda

Custom Zigbee Gateway on ESP32/8266 and ksIotFramework (framework for iot)

cziter15 2211 2
ADVERTISEMENT
Treść została przetłumaczona polish » english Zobacz oryginalną wersję tematu
  • Welcome,

    I've been building projects based on ESP32/8266 microcontrollers for a couple of years now. I played around with atmegas / Arduino at first, but once the aforementioned modules fell into my hands, I stayed with them. I base my projects on xIotFramework - my own IoT framework, which is based on Arduino ports under ESP. I wrote it mainly so that I don't have to clone the firmware pattern every time, but separate the shared components into a separate library.

    I wrote the library based on what I learned from programming games professionally - a composition-based architecture where each category of functionality is embedded in a separate component. Examples of components include WiFiConnector, MqttConnector and Led. Each component resembles a separate Arduino program. They all execute in sequence and are encapsulated in an Application object.

    But back to the project - Zigbee Gateway .

    The Zigbee protocol is a solution present in home automation. Thanks to off-the-shelf modules such as the EBYTE-E180, its implementation in the device is simple. All you need to do is run the EZSP firmware on it, which exposes the entire interface via the UART. What's more, there are many ready-made programs to support this protocol, including there are plug-ins for Home Assistants. It turned out that I don't need to implement all the logic on the ESP, but only expose the UART to the socket - i.e. de facto make a sort of Serial To Ethernet bridge. This is how I handled Zigbee in the project.

    Zigbee Gateway module with visible electronic components. .

    However, I wanted the Zigbee gateway to be more than just a simple gateway, as such can be purchased as a USB stick. The device was to be mounted in a central room and also serve as an electronic notification assistant. This functionality was realised with the MAX98357A chip, which is an I2S DAC converter. A speaker of up to 3 W can be connected virtually directly to it. Decoding of MP3 streams is carried out with the help of the ESPAudio-I2S library. Requests to play specific sounds arrive with the help of MQTT. Alerts are also signalled via an LED.

    Zigbee Gateway with blue lighting on a wooden shelf next to a festive box. .

    Interestingly, the ESP32S3 has hardware USB. This gives the possibility for debugging and software updates.

    Both the chassis and PCB were designed at EasyEDA. I outsourced the manufacturing of the laminates and the case to an external company. Soldering the 0603 components is not difficult, I did this using a hotplate, good flux and paste.

    Updates and worklogs can also be found on Hackaday:
    https://hackaday.io/project/194721-ks-zigbee-gateway .

    Cool? Ranking DIY
    Do you have a problem with Arduino? Ask question. Visit our forum Arduino.
    About Author
    cziter15
    Level 11  
    Offline 
    cziter15 wrote 34 posts with rating 21, helped 2 times. Live in city Bydgoszcz. Been with us since 2013 year.
  • ADVERTISEMENT
  • #2 21418336
    gulson
    System Administrator
    Thank you for your presentations. There is a lot going on here, and a relatively short description. We even have a new framework. Do you have any plans for development? I see you are making everything available on github, maybe some sort of community will build up?
    If you drop me a Paczkomat on Private Message, I'll send a small gift.
  • #3 21418493
    cziter15
    Level 11  
     gulson wrote:
    Lots going on here, and a relatively short description. We even have a new framework.
    .
    Typical problem of post writing by the author. The framework has been a few years in the making, I have put several devices on it. I started with simple circuits on ESP8266 where in basically every device I suddenly had to copy WiFiManager and its entire setup. Currently, I have come to a place where I have my own device portal written in Vue as a Single Page Application. This page is served as a compressed 'blob' and uses Cache mechanisms. Further communication flies over Websocket. This gives a very responsive interface both for configuring the WiFi target from within the AP, and during normal operation - as a debugging interface for the device.

    Screenshot of the device portal showing technical details of the ESP32 device. .

    Screenshot of a device showing a terminal with application logs and a command input field.

    The effect of the device can best be seen from the HomeAssistant frontend:
    Smart home management system user interface showing a room overview. .

    We can control lighting, switches and also monitor parameters such as humidity, light intensity or temperature.
    Basically, everything depends on which actuators and sensors we connect to the Zigbee network.

    gulson wrote:
    Do you have any development plans?
    .
    Nothing concrete, I would like to build a drone in some time - also based on the framework. Everything at the moment is as a hobby project.

    gulson wrote:
    I see you are making everything available on github, maybe some sort of community will build up?
    .
    It would be nice to build such a community around the framework, as it significantly speeds up the design of small IoT devices especially for hobbyists. I'll honestly admit that here I'm a bit unsure how to reach people with this project.
ADVERTISEMENT