-
Couldn't load subscription status.
- Fork 7.7k
-
Related area
Example Code
Hardware specification
ESP32-C6
Is your feature request related to a problem?
Hi, I would like to ask for some sample code for a gateway between RS-485 and Zigbee.
Describe the solution you'd like
I want to expand the Zigbee network using an RS-485 network. I will have several ESP32-C6 connected via RS-485. The first ESP32-C6/RS485 will be connected to the Zigbee coordinator via Zigbee. The coordinator will then use RS485 to connect to the second to Xth ESP32-C6/485, which will allow Zigbee devices to be registered with the coordinator. I hope I have described it clearly enough. Thank you.
Describe alternatives you've considered
No response
Additional context
No response
I have checked existing list of Feature requests and the Contribution Guide
- I confirm I have checked existing list of Feature requests and Contribution Guide.
Beta Was this translation helpful? Give feedback.
All reactions
Replies: 8 comments 2 replies
-
If you want to build a gateway I think you also need states of connected ZIGBEE EPs
This is a problem that I need to solve my Feature request
How to get the state of a ZIGBEE EP i.e. a lamp
Do you have a solution or is there already an example?
Beta Was this translation helpful? Give feedback.
All reactions
-
I want to expand the Zigbee network using an RS-485 network.
I think that this is an specific user gateway application implementation. It is not a Zigbee feature.
There are many RS485 Arduino Libraries for ESP32 SoCs.
Is it going to use Modbus? Or some proprierary protocol?
The gateway shall implement both sides, with message/protocol translation.
This issue will be migrated to Discussions.
Beta Was this translation helpful? Give feedback.
All reactions
-
A possible solution could be some Home Assistant based integration to read/write Modbus packets and send/receive Zigbee trnalated packets.
Beta Was this translation helpful? Give feedback.
All reactions
-
In this example
Zigbee_Gateway.ino
Are raw Zigbee communications sent to the UART port?
If so, that would be ideal.
/* Zigbee gateway configuration */
#define GATEWAY_ENDPOINT_NUMBER 1
#define GATEWAY_RCP_UART_PORT UART_NUM_1 // UART 0 is used for Serial communication
#define GATEWAY_RCP_RX_PIN 4
#define GATEWAY_RCP_TX_PIN 5
Beta Was this translation helpful? Give feedback.
All reactions
-
OK, I think that I may understand your point. The ESP32-C6 chip can operate as a Zigbee Network Co-Processor (NCP) or Radio Co-Processor (RCP) in conjunction with a host microcontroller, allowing it to act as a Zigbee radio. As an RCP, the ESP32-C6 runs Zigbee/Thread firmware to handle the radio and Zigbee stack, communicating with a separate host via serial (SPI or UART) for control and application logic, enabling custom Zigbee device creation or integration into platforms like Home Assistant. RCP vs. NCP modeWhen evaluating co-processor setups, it's helpful to compare RCP to another option, Network Co-Processor (NCP) mode.
Not sure if this communication from the RCP to the Host may work for the purpose that you may have in mind. |
Beta Was this translation helpful? Give feedback.
All reactions
-
I thing the function ZigbeeThermostat::zbAttributeRead is the right approach.
We need for a gateway a function (callback) - based on this - with returned information about the state of a given endpoint(s)!
In ZigbeeThermostat::zbAttributeRead the return result is the tmperature what is recognized by the attribute ESP_ZB_ZCL_CLUSTER_ID_TEMP_MEASUREMENT...
This should also possible for light, color, shutter and other states.
I don't find the definition from ESP_ZB_ZCL_CLUSTER_ID_TEMP_MEASUREMENT and have no knowledge to find out for other EPs.
Can someone create a message/state wrapper of given EPs for us (see also How to get the state of a ZIGBEE EP i.e. a lamp) as an example?
Beta Was this translation helpful? Give feedback.
All reactions
-
@P-R-O-C-H-Y - maybe you can add some information to this discussion. Thanks.
Beta Was this translation helpful? Give feedback.
All reactions
-
The Gateway example is there to showcase the setup for SoCs without native Zigbee. So for example you can use ESP32 which will be connected to ESP32C6 by UART and the C6 will be loaded with specific firmware, as mentioned in the readme of the example. So in that case the C6 will be sending all the Zigbee traffic to the ESP32 which can then use the Zigbee library to work as a regular ZB device.
Can you please describe more deeply what you are trying to do so I can try to help. Thanks
Beta Was this translation helpful? Give feedback.
All reactions
-
17605923412462861916111639503295
Something like this schrmatic.
Sorry fór my english, my language Is Czech...
Beta Was this translation helpful? Give feedback.
All reactions
-
Hi, can you PM me on Discord? We can speak in Czech and may be faster to help you :)
Join our channel and you will find me there https://discord.com/invite/8xY6e9crwv
Beta Was this translation helpful? Give feedback.