Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

[REQUEST] "ESP Zigbee NCP serial to IP proxy SDK" example project (TZ-648) #253

Open
Hedda opened this issue Feb 20, 2024 · 9 comments
Open

Comments

@Hedda
Copy link
Contributor

Hedda commented Feb 20, 2024

Is your feature request related to a problem?

@lhespress (and @chshu) not sure if should post a request here or zigpy-espzb repo at https://github.com/lhespress/zigpy-espzb

Duplicate/cross-posting of lhespress/zigpy-espzb#4

(For bsck-story also see related dependecy here -> zigpy/zigpy-cli#45 )

This however is a feature request for "ESP Zigbee NCP serial proxy SDK" example similar to "Gateway Example" (Zigbee gateway with RCP firmware):

https://github.com/espressif/esp-zigbee-sdk/tree/main/examples/esp_zigbee_gateway

That is, please consider making and maintaining an "ESP Zigbee NCP serial proxy SDK" example design to be used with zigpy-espzb

The example should demonstrate how to build an ESP Zigbee NCP serial proxy server. Using a Wi-Fi SoC such as ESP32, ESP32-C3 or ESP32-S3 running a serial-to-network proxy relay server service (similar to "ser2net") allowing for a remote socket connection, used in combination with an 802.15.4 SoC like ESP32-H2 or ESP32-C6 running ESP Zigbee NCP to provide 802.15.4 radio via ZNSP (Zigbee NCP Serial Protocol) interface.

That is, a software solution that would make the two hardware designs from the "ESP Thread Boarder Router SDK" project usable as a network-attached remote Zigbee Coordinator NCP adapter, and as such instead offer a UART-to-IP serial streaming tunneling proxy relay solution (i.e. a remote Serial Port over TCP/IP) that works the same way as TubesZB’s Zigbee Gateways and ZigStar’s Zigbee Gateways solutions, meaning that it would present Espressif Zigbee NCP with ZNSP (Zigbee NCP Serial Protocol) interface as a remote serial communication port that can be used with Home Assistant's ZHA integration (which depends on zigpy):

https://www.home-assistant.io/integrations/zha

Such solutions based on ESP32 are commonly also referred to "Serial to TCP Bridge" and Tasmota is also a popular choice for it:

https://tasmota.github.io/docs/Serial-to-TCP-Bridge/

That is, just offering a pass-through tunneling of the UART port using a "ser2net" type Serial-to-IP proxy solution for relay connection:

  • ESP32-C6/ESP32-H2 with Zigbee NCP firmware <-> ESP32-S3 with Serial-to-IP Proxy Server <-> Home Assistant's ZHA integration.

Preferably announcing the proxy service on the network via Zeroconf for automatic network discovery which is supported inside ZHA:

https://www.home-assistant.io/integrations/zha#discovery-via-usb-or-zeroconf

Otherwise, the end-user has to manually configure IP address and TCP port for the socket so Zeroconf makes it very user-friendly:

https://www.home-assistant.io/integrations/zha#zigate-or-sonoff-zbbridge-devices

FYI, Zeroconf (Zero-configuration networking) in the ZHA integration in turn depends on the Zeroconf integration:

https://www.home-assistant.io/integrations/zeroconf/

PS: TubesZB Zigbee Gateways and ZigStar Zigbee Gateways solutions as just examples as there are many ESP32-based solutions for this which shows that there are real-world use cases for "ESP Zigbee NCP serial-to-IP proxy" type products:

Describe the solution you'd like.

No response

Describe alternatives you've considered.

No response

Additional context.

No response

@github-actions github-actions bot changed the title [REQUEST] "ESP Zigbee NCP serial proxy SDK" project similar to "ESP Thread Boarder Router SDK" based on same hardware [REQUEST] "ESP Zigbee NCP serial proxy SDK" project similar to "ESP Thread Boarder Router SDK" based on same hardware (TZ-648) Feb 20, 2024
@Hedda Hedda changed the title [REQUEST] "ESP Zigbee NCP serial proxy SDK" project similar to "ESP Thread Boarder Router SDK" based on same hardware (TZ-648) [REQUEST] "ESP Zigbee NCP serial to IP proxy SDK" example project (TZ-648) Feb 20, 2024
@chshu
Copy link
Collaborator

chshu commented Feb 21, 2024

@Hedda Thanks for the suggestion, we are indeed working on a esp-zigbee-host example, which will run on a ESP Wi-Fi SoC and access the ESP NCP via UART. Although we still recommend our customer to use the Host+RCP mode if they use ESP Wi-Fi SoC as the host.

Generally, for the Zigbee Gateway solution, we will have two options for our customers:

@xieqinan
Copy link
Contributor

@teleger

The openthread is located within the esp-idf components. Could you please double-check the path to your esp-idf installation?

@Hedda
Copy link
Contributor Author

Hedda commented Feb 28, 2024

@teleger that is off-topic for this specific request. Please start a new seperate issue instead to no hi-jack this.

@MartinXBcn
Copy link

@Hedda Thanks for the suggestion, we are indeed working on a esp-zigbee-host example, which will run on a ESP Wi-Fi SoC and access the ESP NCP via UART. Although we still recommend our customer to use the Host+RCP mode if they use ESP Wi-Fi SoC as the host.

Generally, for the Zigbee Gateway solution, we will have two options for our customers:

Can you give an update of the status of the development of "esp-zigbee-host example, which will run on a ESP Wi-Fi SoC and access the ESP NCP via UART"?
Question for my understanding:
Why do you recommend the "RCP-solution" instead of the "NCP-solution"?
I would have thought that in case of the "NCP-solution" the workload for the host-ESP32-S3 is less compared to the "RCP-solution", i.e. more processor-capacity available on the host-ESP32-S3 for other user-tasks. Am I wrong?

@Hedda
Copy link
Contributor Author

Hedda commented Jul 18, 2024

Why do you recommend the "RCP-solution" instead of the "NCP-solution"?

That might no longer be the recommation as the project by @lhespress that would be first to make use of it currently only support NCP for now, see:

https://github.com/lhespress/zigpy-espzb

@lhespress
Copy link
Contributor

Can you give an update of the status of the development of "esp-zigbee-host example, which will run on a ESP Wi-Fi SoC and access the ESP NCP via UART"?

We have provide a esp-zigbee-host example as a reference.

Why do you recommend the "RCP-solution" instead of the "NCP-solution"?

This is recommend when ESP Wi-Fi + Zigbee SoCs, of course, you also can use "NCP-solution" on ESP Wi-Fi SoCs.

@MartinXBcn
Copy link

Can you give an update of the status of the development of "esp-zigbee-host example, which will run on a ESP Wi-Fi SoC and access the ESP NCP via UART"?

We have provide a esp-zigbee-host example as a reference.

Why do you recommend the "RCP-solution" instead of the "NCP-solution"?

This is recommend when ESP Wi-Fi + Zigbee SoCs, of course, you also can use "NCP-solution" on ESP Wi-Fi SoCs.

I have seen the example "esp-zigbee-host".
What I am missing in the example - as I do not have direct access to the ESP32-H2-MINI-1 but it is connected to the ESP32-S3-WROOM-1 via UART/SPI - is to upload the firmware of ESP32-H2 via the ESP32-S3 like it is realized in the example "esp-zigbee-gateway", i.e. the built NCP image will be automatically packed into the esp-zigbee-host-firmware and uploaded to ESP32-S3 and from the ESP32-S3 to ESP32-H2.
I started to add the upload-feature of "esp-zigbee-gateway" to "esp-zigbee-host", upload works, but I was struggling with other problems. That is why I asked if there is already a ready-to-run-example. Or is there a separate example only showing the feature of uploading a firmware from ESP32-S3 to ESP32-H2?

@chshu
Copy link
Collaborator

chshu commented Jul 26, 2024

Or is there a separate example only showing the feature of uploading a firmware from ESP32-S3 to ESP32-H2?

The ESP RCP update is a standalone feature supported by the esp_rcp_update component, it used in several examples:

You may refer to these examples and integrate the feature to your project.

If you are using both ESP SoCs as Wi-Fi and Zigbee, the Gatway + RCP mode is recommended. The Host + NCP is only suggested when using ESP NCP with 3rd-party host SoC. The difference between RCP and NCP modes:

  • RCP Mode: Zigbee Stack and application all run on host SoC, only 15.4 Mac layer frame transmit and receive actions are communicated between the two SoCs
  • NCP mode: Zigbee stack runs on NCP, ZCL and Applications run on host, the protocols between Host and NCP is more complicate than RCP mode, more code needs to be implemented for each ZCL cluster behavior (commands/events/callbacks), all these are naturally supported if the application and stack run on the same SoC in RCP mode.

@Hedda
Copy link
Contributor Author

Hedda commented Oct 16, 2024

@lhespress Do you have any more thoughts on these name change suggestions? -> lhespress/zigpy-espzb#11

Again, please see all related comments in your pull request for zigpy-cli here -> zigpy/zigpy-cli#45

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Projects
None yet
Development

No branches or pull requests

5 participants