Skip to content

Navigation Menu

Sign in
Appearance settings

Search code, repositories, users, issues, pull requests...

Provide feedback

We read every piece of feedback, and take your input very seriously.

Saved searches

Use saved searches to filter your results more quickly

Sign up
Appearance settings

add RS485 Gateway to Example #11892

DaTTcz started this conversation in Ideas
Sep 28, 2025 · 8 comments · 2 replies
Discussion options

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.
You must be logged in to vote

Replies: 8 comments 2 replies

Comment options

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?

You must be logged in to vote
0 replies
Comment options

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.

You must be logged in to vote
0 replies
Comment options

A possible solution could be some Home Assistant based integration to read/write Modbus packets and send/receive Zigbee trnalated packets.

You must be logged in to vote
0 replies
Comment options

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

You must be logged in to vote
1 reply
Comment options

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

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 mode

When evaluating co-processor setups, it's helpful to compare RCP to another option, Network Co-Processor (NCP) mode.

Feature Radio Co-Processor (RCP) Network Co-Processor (NCP)
Zigbee Stack Location Runs entirely on the host processor. The Zigbee stack runs on the ESP32-C6.
Application Location Runs entirely on the host processor. The application also runs on the host, but communicates with the Zigbee stack on the ESP32-C6.
Communication Communication between the host and ESP32-C6 is limited to 15.4 frame transmission and reception. The host and ESP32-C6 communicate using a more complex protocol that includes Zigbee-specific commands and callbacks.
Complexity The ESP32-C6 firmware is simpler, while the host software manages the full Zigbee stack. The communication protocol is more complex, requiring more code on the host to manage the Zigbee application layer.

Not sure if this communication from the RCP to the Host may work for the purpose that you may have in mind.

Comment options

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?

You must be logged in to vote
0 replies
Comment options

@P-R-O-C-H-Y - maybe you can add some information to this discussion. Thanks.

You must be logged in to vote
0 replies
Comment options

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

You must be logged in to vote
0 replies
Comment options

17605923412462861916111639503295
Something like this schrmatic.
Sorry fór my english, my language Is Czech...

You must be logged in to vote
1 reply
Comment options

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

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Category
Ideas
Labels
Status: Community help needed Issue need help from any member from the Community. Chip: ESP32-C6 Issue is related to support of ESP32-C6 Chip Area: Zigbee Issues and Feature Request about Zigbee
Converted from issue

This discussion was converted from issue #11882 on October 02, 2025 13:39.

AltStyle によって変換されたページ (->オリジナル) /