Custom Zigbee Gateway on ESP32/8266 and ksIotFramework (framework for iot)
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.
.
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.
.
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 .
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.

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.

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 .
Comments
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... [Read more]
. 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... [Read more]