zigpy-cli icon indicating copy to clipboard operation
zigpy-cli copied to clipboard

Add ”Zigbee Router” (router mode) and same same utils commands as Nerivec’s ember-zli command line interface tool for Silicon Labs

Open Hedda opened this issue 1 year ago • 1 comments

Can commands to join a Zigbee network be added to zigpy-cli to enable using NCP in ”router mode”? I believe that bellows CLI already have join commands for this? Nerivec has implemented this and more command line tools in his new ember-zli project:

  • https://github.com/Nerivec/ember-zli

ember-zli router

Use a coordinator firmware as a router and interact with the joined network.

USAGE
  $ ember-zli router

DESCRIPTION
  Use a coordinator firmware as a router and interact with the joined network.

EXAMPLES
  $ ember-zli router

See code: https://github.com/Nerivec/ember-zli/blob/v2.9.0/src/commands/router/index.ts


For more back-story and reference specifically on the ”Zigbee Router” (router mode) feature request please also see these related requested features for zigpy and bellows about being able to command NCP to join existing network as a Zigbee Router and/or Zigbee End Device. See these previous discussions and feature requests:

  • https://github.com/zigpy/zigpy/issues/1399

And

  • https://github.com/zigpy/bellows/issues/420

Please consider adding ”Zigbee Router” commands (i.e. add command to enable router mode, for join network, rejoin network, or leave network, etc.), and other utils commands as Nerivec’s ember-zli command line interface tool for Silicon Labs:

https://github.com/Nerivec/ember-zli

https://github.com/Nerivec/ember-zli?tab=readme-ov-file#router

Ember ZLI

Interact with EmberZNet-based adapters using zigbee-herdsman 'ember' driver

Interactive Menus (with links to Wiki)

Bootloader

Router

Sniff

Stack

Utils

ToC

  • ToC
  • Usage
  • Commands

Usage

$ npm install -g ember-zli
$ ember-zli COMMAND
running command...
$ ember-zli (--version)
ember-zli/2.3.0 win32-x64 node-v20.15.0
$ ember-zli --help [COMMAND]
USAGE
  $ ember-zli COMMAND
...

Commands

  • ember-zli bootloader
  • ember-zli help [COMMAND]
  • ember-zli router
  • ember-zli sniff
  • ember-zli stack
  • ember-zli utils
  • ember-zli version

Hedda avatar Jul 12 '24 13:07 Hedda

For reference, @tl-sl and @Nerivec use ZAP tooling/config with custom silabs-firmware-builder to build Zigbee Router firmware:

  • https://github.com/NabuCasa/silabs-firmware-builder/pull/84

  • https://github.com/NabuCasa/silabs-firmware-builder/pull/85

Implement a new protocol for communicating with the builtin CLI on Silabs router firmware and integrate through out. This will allow to probe and flash router firmware

Router firmware must implement a custom CLI command bootloader reboot that calls the bootloader_rebootAndInstall api.

This has been tested both standalone and integrated with sl-web-tools.

Probe of CPC 115200 is fixed in https://github.com/NabuCasa/universal-silabs-flasher/pull/86, but also requires router firmware built with SL_CLI_LOCAL_ECHO: 0

ZAP in this case refers to the ZCL Advanced Platform (ZAP) tool/format for configuring Matter devices in a standardized way:

  • https://github.com/project-chip/zap

  • https://docs.silabs.com/matter/2.2.2/matter-references/matter-zap

  • https://docs.nordicsemi.com/bundle/ncs-latest/page/nrf/protocols/matter/getting_started/tools.html

ZAP stands for ZCL Advanced Platform. It is used to configure clusters, attributes and other entities for Matter and Zigbee Pro applications.

ZAP is a generic generation engine and user interface for applications and libraries based on Zigbee Cluster Library, the specification developed by the Connectivity Standards Alliance.

ZAP allows you to perform the following:

  • perform SDK-specific customized generation of all global artifacts (constants, types, IDs, etc) based on the ZCL specification
  • provide UI for the end-user to select specific application configuration (clusters, attributes, commands, etc.)
  • perform SDK-specific customized generation of all user selected configuration artifacts (application configuration, endpoint configuration, etc) based on ZCL specification and customer-provided application configuration.

ZAP is a generic templating engine. Examples are provided for how to generate artifacts for the C language environment, but one could easily add new templates for other language environments, such as C++, java, node.js, python or any other.

Hedda avatar Nov 07 '24 11:11 Hedda