espressif / esp-zigbee-sdk

Espressif Zigbee SDK
Apache License 2.0
173 stars 29 forks source link

ZBOSS NCP host (TZ-349) #124

Open kklem0 opened 1 year ago

kklem0 commented 1 year ago

Is your feature request related to a problem?

The current release only has ZBOSS RCP, but our old implementation uses ZBOSS NCP host.

Describe the solution you'd like.

The ZBOSS libraries for the NCP host include the following stack layers:

Zigbee cluster library (ZCL)
Commissioning logic (part of ZDO)
ZBOSS NCP serialization protocol
ZBOSS platform support layer for Linux-based OS

Since you use ZBOSS already if it is possible that we can use our old implementation with ZBOSS NCP host or if we need to rewrite it against esp-zigbee-sdk. It would be enough for us if we could get the ZBOSS NCP SoC firmware files.

Describe alternatives you've considered.

No response

Additional context.

No response

Hedda commented 1 year ago

+1 yes please consider adding support for ZBOSS NCP host for Zigbee NCP (Network Co-Processor) mode?

This feature request is also related to https://github.com/espressif/esp-zboss-lib/issues/4

Currently is seems like the ESP ZBOSS can only be used Zigbee via a RCP (Radio Co-Processor) mode and no support for ZBOSS NCP host?

See example:

https://developer.nordicsemi.com/nRF_Connect_SDK/doc/zboss/3.11.2.0/zboss_ncp_host_intro.html

https://developer.nordicsemi.com/nRF_Connect_SDK/doc/zboss/3.11.2.0/zboss_ncp_host.html

ZBOSS NCP host as Zigbee NCP mode is required to implement support in the zigpy-zboss radio library for zigpy as a Zigbee Coordinator adapter interface which is used by the ”ZHA” Zigbee gateway integration that is built-into Home Assistant:

https://github.com/kardia-as/zigpy-zboss/issues/19

https://github.com/kardia-as/zigpy-zboss

https://github.com/zigpy/zigpy

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

Hedda commented 1 year ago

ZBOSS NCP support would probably also be prefered for Zigbee2Tasmota (Z2T) compatible in Tasmota:

https://github.com/arendst/Tasmota/discussions/20045

For reference, Tasmotas's Zigbee2Tasmota (Z2T) already supports Texas Instruments ZNP and Silicon Labs EZSP Zigbee stacks/interfaces with respective Zigbee Coordinator adapter running Zigbee firmware in NCP (Network Co-Processor) mode:

https://tasmota.github.io/docs/Zigbee/

chshu commented 11 months ago

@kklem0 @Hedda We are working on a ESP Zigbee NCP solution, which will be based on the ESP Zigbee APIs, and provide the serial interface to communicate with host.

We will also prepare a corresponding zigpy python library to work with Home Assistant.

The draft version will be ready in 2024 January.

kklem0 commented 11 months ago

🎉

Hedda commented 11 months ago

We are working on a ESP Zigbee NCP solution, which will be based on the ESP Zigbee APIs, and provide the serial interface to communicate with host.

@chshu Nice! Will that API be compatible with the standard ZBOSS NCP serial protocol that and CLI the zigpy-zboss library already supports?

https://github.com/kardia-as/zigpy-zboss

Please see related feature request discussion here -> https://github.com/kardia-as/zigpy-zboss/issues/19

That is, if your serial interface will be 100% ZBOSS compatible then there is no need for a seperate zigpy radio library.

Hedda commented 11 months ago

@chshu also see related upstream discussion in the zigpy repository here -> https://github.com/zigpy/zigpy/issues/1052

chshu commented 11 months ago

Will that API be compatible with the standard ZBOSS NCP serial protocol that and CLI the zigpy-zboss library already supports?

@Hedda The ESP Zigbee NCP will not be compatible with ZBOSS NCP.

With ZBOSS NCP, users need to run ZCL and part of ZDO on host. We want to integrate ZCL and ZDO in the ESP Zigbee NCP as well, so host can handle the application logic only. If some hosts already have ZCL implementation, it's also flexible to access the NCP network layer directly.

Hedda commented 11 months ago

The ESP Zigbee NCP will not be compatible with ZBOSS NCP.

With ZBOSS NCP, users need to run ZCL and part of ZDO on host. We want to integrate ZCL and ZDO in the ESP Zigbee NCP as well, so host can handle the application logic only. If some hosts already have ZCL implementation, it's also flexible to access the NCP network layer directly.

Ok, I can see that might be wanted for complete onboard solutions like Zigbee for Tasmota, though popular open-source Zigbee frameworks like zigpy (for Home Assistant’s ZHA + Zigbee Plugin for Domoticz) and zigbee-herdsman (for Zigbee2MQTT and IoBroker) have their own ZCL and ZDO implementations.

Hedda commented 10 months ago

We are working on a ESP Zigbee NCP solution, which will be based on the ESP Zigbee APIs, and provide the serial interface to communicate with host.

We will also prepare a corresponding zigpy python library to work with Home Assistant.

The draft version will be ready in 2024 January.

FYI, assume this related pull request for zigpy-cli -> https://github.com/zigpy/zigpy-cli/pull/42 is indication that making progress on -> https://github.com/zigpy/zigpy/issues/1052

Hedda commented 10 months ago

FYI, looking at recent commits it looks like @lhespress has begun working on implementing esp-zigbee-ncp and API in this SDK:

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

https://github.com/zigpy/zigpy-cli/pull/45

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

https://github.com/espressif/esp-zigbee-sdk/blob/main/examples/esp_zigbee_ncp/README.md

https://github.com/espressif/esp-zigbee-sdk/tree/main/components/esp-zigbee-ncp

https://github.com/espressif/esp-zigbee-sdk/blob/main/docs/en/application.rst

https://github.com/espressif/esp-zigbee-sdk/blob/main/docs/en/api-reference/esp_zigbee_ncp.rst