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

[SUGGESTION] Use Nordic nRF52840 chip ... #394

Open
captcha1 opened this issue Apr 24, 2020 · 51 comments
Open

[SUGGESTION] Use Nordic nRF52840 chip ... #394

captcha1 opened this issue Apr 24, 2020 · 51 comments

Comments

@captcha1
Copy link

The Nordic nRF52840 chip is inexpensive and has Zigbee ZBOSS support.

The pca10059 is only $10.

Nordic has an SDK with different Zigbee architectures (entire stack or just MAC layer)

... and example code

... and precompiled examples

MakerDairy sells similiar USB dongles in a nice case

@puddly
Copy link
Collaborator

puddly commented Apr 24, 2020

I use the dongle as a sniffer and it seems to work fine. If you want to try writing a zigpy radio library for it, using their "CLI interface" might make this a relatively simple adapter to implement.

@Gamester17
Copy link
Contributor

Gamester17 commented Aug 12, 2020

Anyone working on a zigpy radio library for ZBOSS stacks on Nordic Semiconductor (Nordic Semi) nRF52833/nRF52840 hardware?

nRF52840 Dongle specifications (which include Zigbee 3.0 support) looks to be very attractive for its price of about $9 dollars.

https://www.nordicsemi.com/Software-and-tools/Development-Kits/nRF52840-Dongle

nRF52840 SoC for Bluetooth 5.3 BLE, Bluetooth Mesh, NFC, Thread and Zigbee very impressive hardware specifications:

https://www.nordicsemi.com/Products/nRF52840

  • 64 MHz Arm Cortex-M4 with FPU
  • 1 MB Flash, 256 KB RAM
  • 2 Mbps, 1 Mbps, Long Range
  • Bluetooth
    • Bluetooth 5.3
    • Bluetooth Low Energy
    • Bluetooth mesh
  • 802.15.4
  • Thread
  • Zigbee 3.0
  • ANT
  • +8 dBm TX Power
  • 128-bit AES CCM, Arm CryptoCell-310
  • UART, SPI, TWI, PDM, I2S, QSPI, PWM
  • 12-bit ADC
  • NFC
  • USB 2.0

And unlike most of the others, their nRF5 SDK for Zigbee (and Thread) is available without cost from nordicsemi.com (NordicSemi)

https://www.nordicsemi.com/Software-and-tools/Software/Zigbee-software

https://www.nordicsemi.com/Software-and-tools/Software/nRF5-SDK-for-Thread-and-Zigbee

https://www.nordicsemi.com/Products/Low-power-short-range-wireless/Zigbee

It includes a pre-built Zigbee 3.0 stack (ZBOSS independent Zigbee stack by DSR)

http://www.dsr-zboss.com

As already mentioned its firmware application offer a CLI (Command line interface) as an open API

https://infocenter.nordicsemi.com/index.jsp?topic=%2Fsdk_tz_v4.0.0%2Fzigbee_cli_wrapper.html

The zb-cli-wrapper is a Python package that includes example wrapper for Nordic Zigbee CLI Agent

https://pypi.org/project/zb-cli-wrapper/

nRF52840 DK Development kit / development baord is also not expensive at around $49

https://www.nordicsemi.com/Software-and-tools/Development-Kits/nRF52840-DK

@Gamester17
Copy link
Contributor

Gamester17 commented Aug 18, 2020

nRF52840 SoC becomes very powerful if it is combined with a nRF21540 RF Font-End Module (FEM) chip that integrates a power amplifier (PA) and low noise amplifier (LNA) as on paper get a boost up to 16 times range increase and -100 dBm RX sensitivity.

https://www.nordicsemi.com/Products/Low-power-short-range-wireless/nRF21540

nRF21540 key features and specifications:

  • Supported wireless standards
    • Bluetooth Low Energy (incl. Bluetooth mesh)
    • Thread and Zigbee (802.15.4)
    • Proprietary 2.4 GHz
  • Output Power – Adjustable in small increments up to +21 dBm
  • Receive Gain – +13 dB with 2.5 dB noise figure
  • Antennas – 2x antenna ports for antenna diversity
  • Host Interface – I/Os, SPI, or a combination
  • Supply Voltage – 1.7 V to 3.6V
  • Current consumption
    • Tx tuned to +20 dBm: 115 mA
    • Rx: 4.1 mA
    • Power down mode: 30 nA
  • Temperature Range – -40°C to +105°C
  • Package – QFN16 4×4 mm
  • When nRF21540 is combined with an nRF52 or nRF53 SoCs, Bluetooth LE (1Mbps) gets up to 16 times range increase, and -100 dBm RX sensitivity.

nRF21540 development kit provides a full-featured development kit with the following features:

  • WiSoC – Nordic Semi nRF52840 Arm Cortex-M4F SoC with Bluetooth LE, 802.15.4, 2.4 GHz protocol support
  • Range Extender – nRF21540 RF front end module
  • Antennas – 2x 2.4 GHz antennas for antenna diversity, NFC antenna connector
  • USB – 1x Micro USB connected to nRF52840 SoC, 1x Micro USB for program/debug and power
  • Expansion – Arduino Uno Rev3 compatible headers
  • Debugging
    • Segger J-Link OB programming/debugging via Micro USB port
    • 2x SWF RF ports for direct RF measurements
  • Misc – 4x user-programmable buttons and LEDs
  • Power
  • 5V via Micro USB “programming” port
    • Coin-cell battery holder
    • Pins for current consumption measurements

That board shares many of the same features as the original nRF52840 DK, meaning software support is basically identical.

Also, nRF21540 evaluation kit that is meant to connect the RF FEM to lab equipment or other radios via an SMA connector.

https://www.nordicsemi.com/Products/Low-power-short-range-wireless/nRF21540

@Gamester17
Copy link
Contributor

Gamester17 commented Aug 18, 2020

@NordicSemiconductor @coderbyheart @LuDuda @philips77 @roshanrajaratnam @mjdietzx / @DSRCorporation @t7ko Does anyone at Nordic Semiconductor and/or DSR Corporation have any interest and resources that could develop a radio library for zigpy as POC?

ZBOSS and Nordic Semiconductor support is the last major Zigbee stack and Zigbee hardware that is missing zigpy support now.

@coderbyheart
Copy link

Thank you for bringing this to my attention. I have forwarded this thread internally to colleagues who might have more input.

I think it's fair to say that interest for zigpy support is rather low (DevZone search) which is not meant to say that this project is not valuable. It's probably not on many peoples radar at Nordic.

Nordic provides a Zigbee CLI wrapper for python which you might be able to leverage for this effort, and this is what we recommend to use when building solutions on Zigbee.

@Gamester17
Copy link
Contributor

@coderbyheart That is probably because most people do not know that zigpy is the Zigbee library that Home Assistant depends on https://www.home-assistant.io/integrations/zha/

Home Assistant is otherwise very popular so I think it is hard to call that project not valuable.

@coderbyheart
Copy link

Please double check my comment, I explicitly did write

which is not meant to say that this project is not valuable.

It's a double negative so I see it's easy to misread, sorry for that.

@Gamester17
Copy link
Contributor

Please double check my comment, I explicitly did write

which is not meant to say that this project is not valuable.

It's a double negative so I see it's easy to misread, sorry for that.

Sorry, yeah I am not a native English speaker, though I understand that they might also have problems with a double negative ;)

If look at it from a marketing value view you can see Nordic Semiconductor and ZBOSS support is missing from Home Assistant:

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

Home Assistant made it on the official GitHub Octoverse Top-10 list for most popular open source projects on GitHub this year:

https://octoverse.github.com/#trends

If there was support for Nordic Semiconductor in Home Assistant's ZHA component via zigpy then you get more devs and users.

https://github.com/zigpy/zigpy/blob/dev/README.md

I also read that a few other open source project are looking into integrating zigpy because it has board hardware support.

@MeisterBob
Copy link

I'm quite familiar with the nRF52 and IEEE802.15.4 but new to zigbee.

I wanted to write a zigpy radio library for the nRF52. I have read into the code of some of the other radio libraries and if I got it right, I need to implement all the function of the ControllerApplication Class that are marked as @abc.abstractmethod and those who raise an NotImplementedError.

Do you have an API description which is more complete than the one in the contributing document?

And for testing: how can I add my new nRF52 lib to Homeassistant?

@Hedda
Copy link
Contributor

Hedda commented Dec 20, 2020

Check out the zha custom radios custom component for testing a new radio library in Home Assistant:

https://github.com/zha-ng/zha-custom-radios

Archived as as not used any longer but you probably get the gist of it.

@MeisterBob
Copy link

I plan on using the zigbee cli that nordic provides. Maybe I need to extend the firmware but it's a good starting point. It uses the zboss stack. There is also a python zigbee cli wrapper but I'm not sure if I will it or not.

@Hedda
Copy link
Contributor

Hedda commented Dec 20, 2020

Not sure if any more help than looking at all the other radio libraries but there is a beginning of API documentation in #477

Documenting zigpy API a kind of developer guide #477

There is now also a wiki that was just created a few: https://github.com/zigpy/zigpy/wiki

Be sure to check out the discussion area as well: https://github.com/zigpy/zigpy/discussions

@LuDuda
Copy link

LuDuda commented Dec 20, 2020

FYI @tomchy

@Hedda
Copy link
Contributor

Hedda commented Dec 21, 2020

There is also a python zigbee-cli-wrapper but I'm not sure if I will it or not.

FYI, found this project by @hipiphock & @ninima0323 which looks to be using zb-cli-wrapper to command Zigbee devices:

https://github.com/hipiphock/Dongle-Handler/

https://github.com/ninima0323/TestGUI

If it existed then maybe they would be interested in using zigpy together with a zigpy-zboss radio library in such a project? ;)

@tomchy
Copy link

tomchy commented Jan 8, 2021

@LuDuda: Thank you for bringing my attention to this conversation!

The first question that comes into my mind is: does the the zigpy project expects a well-defined device in a Zigbee network (e.g. the coordinator), able to send ZCL commands - or - a generic, universal Zigbee dongle, that (from Zigbee protocol perspective) is defined and configured through python classes?

If it is enough to pass the Zigbee CLI device definition through handlers and provide an API to send/receive ZCL commands, than the CLI example looks like a good choice to do the job. On the contrary, if it is expected to define a device through python (e.g. it is required to provide an API to add Zigbee endpoints, set simple descriptors, send/receive raw APS frames), I'd advise to look into the NCP solution, introduced in NCS 1.4.0.

@MattWestb
Copy link
Contributor

@tomchy @LuDuda and @MeisterBob
I think im not the right person answer your question but some input i can giving.
The zigpy is trying doing one universal zigbee communication between the radio module and the host system and is using quirks for "compensating / translating" commands that is not compatible with zigbee cluster library = if one devices (example one On/Off plug) is 100% zigbee compatible zigpy is only letting the command thru to / from the host system (HA or others) and if not the quirks is "translating" them to true zigbee commands so the host system is understanding them.
One Xiaomi sensor is sending there attribute in property way is converted to real ZCL commands to the host system.

For TI coordinators is using the TIs Z-Stack Monitor and Test(MT) APIs for configuring and communicating with the devices in the mesh but its little high level and is limiting the functionality.
Opposite is the Silabs EZSP is very low level making it not so easy implanting but is making it very flexible and powerful then being good implanted and is recommended way if its possible to being done. Silabs do also having one CLI to the zigbee stack but its not being users in zigpy (its being used in IKEA GW and so on) then its not so powerful as the native EZSP protocol for coordinators.

For the TI integration is @puddly that having the most experience and for the EZSP and others is @Adminiuga the mastermind and overall architect of zigpy.

I think implanting Nordic coordinators in Zigpy is one win win situation for both sides then its open more doors and making it more flexible and user friendly for the zigbee community but its not done over one night and need lot of work being done.

In lesser than one year zigpy devs have rewritten EZSP for support of more protocols versions (over 15K line codes changed) after implanting deCONZ radios and getting the all radios from alpha or beta to stable stage (exceptions is TI CC253X with old ZHA 1.2 stack) and its more or less only one large platform that is missing in the system, the Nordick one.

@Hedda
Copy link
Contributor

Hedda commented Jan 9, 2021

@doudz might also be able to answer some questions as he too has gone through this process with ZiGate (NXP Semi based)?

PS: FYI- There is now alsoa new discussion space available for zigpy here -> https://github.com/zigpy/zigpy/discussions as well as a brand new wiki here space for zigpy -> https://github.com/zigpy/zigpy/wiki (again it's brand new so not yet started to be populated).

@argentumus
Copy link

argentumus commented May 12, 2021

I am also interested in using this chip in ZHA. I want to connect a few sensors and servos to HA and I am resisting to use wifi/ESPHome as much as I can. Zigbee has been great and I am forced to have wifi for some devices (when there is no option). I managed to stay away from Zwave, BLE, etc. and for that reason I prefer to have my custom projects connected to my ZHA based Zigbee mesh.

@github-actions
Copy link

github-actions bot commented Nov 8, 2021

There hasn't been any activity on this issue recently. Due to the high number of incoming GitHub notifications, we have to clean some of the old issues, as many of them have already been resolved with the latest updates. Please make sure to update to the latest version and check if that solves the issue. Let us know if that works for you by adding a comment 👍 This issue has now been marked as stale and will be closed if no further activity occurs. Thank you for your contributions.

@github-actions github-actions bot added the stale label Nov 8, 2021
@tomchy
Copy link

tomchy commented Nov 9, 2021

I think it is a good idea to keep this suggestion 🙂
The CLI/Shell sample is now available on the NCS master branch:

And the NCP solution has reached the v1.0.0 milestone in the NCS v1.7.0:

@github-actions github-actions bot removed the stale label Nov 9, 2021
@Hedda
Copy link
Contributor

Hedda commented Nov 16, 2021

@tomchy Is that still using the ZBOSS Zigbee stack? .

FYI, Home Assistant has just posted some user statistics for the first time so maybe you could use that data as an incentive to convince ZBOSS and/or Nordic Semi bosses/management to contribute developer time to make a new radio library for zigpy:

https://www.home-assistant.io/blog/2021/11/12/100k-analytics/

As noted there, their analytics is opt-in only and most users have not enabled analytics, yet it shows that around 14% of all Home Assistant users who actively enabled opt-in for analytics are using the native ZHA (Zigbee Home Automation) integration today:

https://analytics.home-assistant.io/#integrations

image

That zha component in Home Assistant's core in turn depends on the zigpy library and its radio libraries for zigpy in this project:

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

https://github.com/home-assistant/core/tree/dev/homeassistant/components/zha

https://github.com/zigpy

Home Assistant founders estimate that less than around 20% of all users have enabled opt-in for analytics and if that is the case at 14% of the userbase there should be just over 50,000 Home Assistant installations with the ZHA integration installed, however, based on the number of users who has registered on the official Home Assistant community forum my guesstimate would be way fewer users have opt-in for analytics and there and there are actually many more ZHA installations than so. Anyway, that is technically off-topic but those interested can continue that part of the discussion in Home Assistant community forum here:

https://community.home-assistant.io/t/home-assistant-founders-believe-there-is-currently-only-around-50-000-installations-of-zha-integration-what-do-you-zigbee-users-in-the-community-think-about-those-statistics/357305

Note! I guess it is maybe important noting that while the ZHA integration component is the only "native" Zigbee implementation in Home Assistant core, there are of course also many other integrations for Home Assistant that can indirectly support Zigbee devices. Other implementations that support Zigbee devices are however abstracted behind some kind of third-party hub/bridge/gateway hardware appliance or software application, such as deCONZ/Phoscon by dresden elektronik, Zigbee2MQTT, Tasmota (Zigbee2Tasmota), Philips Hue Bridge, IKEA TRÅDFRI Gateway, Samsung SmartThings, Xiaomi Gateway (or Aqara), and Tuya Smart Gateway, but all of those third-party hubs/bridges/gateways translate and convert Zigbee into other protocols or APIs, (may it be proprietary protocol/API or an open standard like example MQTT), so as far as their Home Assistant integrations go it is not really Zigbee support that has been implemented.

@MattWestb
Copy link
Contributor

More in the basket more you can do and is not locked so i think its great open more doors if possible.

The statics is interesting what deCOZ user is using there system stand alone or with other integrations then they is on place 34 and they is saying having over 100K installations (= radio adapter sold)(i think most in ZHA and Z2M and some other systems) but i think most is using then with deCONZ and HA as automation system for it.

@Hedda
Copy link
Contributor

Hedda commented Dec 16, 2021

@tomchy @coderbyheart @LuDuda @philips77 @roshanrajaratnam @mjdietzx @DSRCorporation @t7ko @andkononykhin @Diadlo @MeisterBob @greg-fer

FYI, zigpy developer puddly have begun preliminary work on a new radio API for zigpy as well as on merging respective low-level and high-level functions from different radio libraries into the zigpy-cli command-line tool.

As his work has just begun it would now be a great time for members of Nordic Semiconductor and DSR Corporation Zigbee developers to start giving your feedback and input on the design of this new unified new radio API and CLI for zigpy which is meant as a common way for Python developers to support Zigbee stacks and radio hardware from multiple manufacturers. Please see:

https://github.com/zigpy/zigpy + https://github.com/zigpy/zigpy-cli/ (specifically zigpy/zigpy-cli#5)

At the moment he is focusing on completely exposing the low-level network and node info, (for example energy scanning already works with TI ZNP and the deCONZ ConBee/RaspBee using the same code however the zigpy-znp command line tool just needs to be transplanted into zigpy-cli), so if you want a chance to influence what should go into that zigpy CLI versus what should go into the separate zigpy radio libraries for each manufacturer then now would be the best time to begin contributing.

  • This new CLI as a standard radio settings API is primarily being discussed here -> [RFC] Standard radio settings API #842

  • Development started here -> New radio API #848

  • Cross-radio backup and restore -> Implement new radio API zigpy-cli#2

  • pully mentioned that he is eventually planning on trying to add a similar shell using IPython for sending commands interactively ("since it has autocompletion and is async-friendly").

  • pully also mentioned that bootloader commands are low on the priority list, "since that code is often pretty complex and uses internal radio library code. A plugin system could work, but since the existing bootloader tools are synchronous, it'd take either a complete rewrite to work with zigpy-cli, or the tools would essentially be run externally in a separate thread, which is no easier than directly running the original tools."

@eexarevsky
Copy link

JFYI: DSR now open NCP protocol description.
See here: https://github.com/the-tcpdump-group/tcpdump-htdocs/blob/master/linktypes/LINKTYPE_ZBOSS_NCP.html
NCP protocol parser is now included into Wireshark.
Nordic has NCP support in their SDK: https://developer.nordicsemi.com/nRF_Connect_SDK/doc/latest/nrf/samples/zigbee/ncp/README.html
Speaking about Nordic SDK - you can now use it with Nordic HW only. Means, you can't do your own implementation of ZBOSS NCP protocol for Zigbee Platform on some another SoC (I am in doubt you may want to, but just in case).

@DamKast
Copy link

DamKast commented Feb 15, 2022

Nice. Has anybody started to work on this? I can give a hand...

If not, I'll start to work on this locally. And I'll let you know if I go far enough.

@Hedda
Copy link
Contributor

Hedda commented Feb 16, 2022

Updated: @DamKast looks like @MeisterBob started on a zigpy radio for nrf52 in 2020 but would be awesome if you picked it up!

@MeisterBob first wrote here in 2020 -> #709

I started developing a radio library for nRF52 SoCs but I am a little Stuck, because I don't really understand the API between zigpy and the radio libraries. Can someone (maybe a developer of the other radio libraries) share his knowledge?

and he also posted comments -> #394 (comment)_ and #394 (comment)_

I wanted to write a zigpy radio library for the nRF52. I have read into the code of some of the other radio libraries and if I got it right, I need to implement all the function of the ControllerApplication Class that are marked as @abc.abstractmethod and those who raise an NotImplementedError. Do you have an API description which is more complete than the one in the contributing document?

I plan on using the zigbee cli that nordic provides. Maybe I need to extend the firmware but it's a good starting point. It uses the zboss stack. There is also a python zigbee cli wrapper but I'm not sure if I will it or not.

MeisterBob then uploaded his initial work in this repository on GitHub back at the beginning of January of 2021 with no updates:

https://github.com/MeisterBob/zigpy_nrf52

Also, it looks like he started work on a matching Zigbee NCP firmware configuration for the nRF52 dongle for reference as well?

https://github.com/MeisterBob/nrf52_zigbee_dongle

https://github.com/MeisterBob/zephyr-docker

https://developer.nordicsemi.com/nRF_Connect_SDK/doc/latest/nrf/releases/release-notes-1.7.0.html#zigbee

Will you make it from scratch based on their Zigbee CLI Reference or base it on Nordic Semi's Zigbee CLI wrapper? I believe one of the problems with Zigbee CLI wrapper might be if their code licenses are not compatible with the open-source license you want?

https://developer.nordicsemi.com/nRF_Connect_SDK/doc/latest/nrf/samples/zigbee/shell/README.html

https://infocenter.nordicsemi.com/topic/sdk_tz_v4.1.0/zigbee_example_cli_reference.html

https://infocenter.nordicsemi.com/topic/sdk_tz_v4.1.0/zigbee_example_cli_agent.html

https://infocenter.nordicsemi.com/index.jsp?topic=%2Fsdk_tz_v4.1.0%2Fzigbee_cli_wrapper.html

https://devzone.nordicsemi.com/f/nordic-q-a/59443/building-zigbee-cli-example-4-0

https://devzone.nordicsemi.com/f/nordic-q-a/60497/hint-for-zigbee-coordinator-development/246415#246415

Will you be using "nRF52840 Dongle" and/or "nRF52840 DK" be used as reference hardware (and recommend them for testers?)?

https://www.nordicsemi.com/Products/Development-hardware/nrf52840-dongle

https://www.nordicsemi.com/Products/Development-hardware/nrf52840-dk

While the new radio API for zigpy that @puddly been working on has not yet been merged it sounds as if it probably will sooner rather than later so might want to target that new radio API and use his zigpy-znp radio library branch for it as a reference (or?):

PS: Bikeshedding name idea but probably be nicer if call yours "zigpy-nfr" or at least without numbers if will not limit it to nrf52, or if Zigbee CLI they are using is not proprietary to Nordic Semi and instead ZBOSS NCP serial protocol then maybe "zigpy-zboss" or "zigpy-zoi" is better as DRS ZOI ZBOSS Open Initiative Zigbee stack is meant to be hardware-agnostic? -> https://dsr-zoi.com

@github-actions
Copy link

There hasn't been any activity on this issue recently. Due to the high number of incoming GitHub notifications, we have to clean some of the old issues, as many of them have already been resolved with the latest updates. Please make sure to update to the latest version and check if that solves the issue. Let us know if that works for you by adding a comment 👍 This issue has now been marked as stale and will be closed if no further activity occurs. Thank you for your contributions.

@github-actions github-actions bot added the stale label Feb 17, 2023
@codyc1515
Copy link

Still current

@github-actions github-actions bot removed the stale label Feb 17, 2023
@Hedda
Copy link
Contributor

Hedda commented Apr 14, 2023

FYI, Nordic Semi announced a new nRF54 MCU family which includes new "H series" with nRF54H20 802.15.4 radio SoC to be first:

https://www.cnx-software.com/2023/04/13/nrf54h20-cortex-m33-risc-v-wireless-soc-bluetooth-5-4-le-audio-bluetooth-mesh-thread-matter/

nRF54H20 will according to Nordic Semi be best-is-class and feature superior state-of-the-art in all functions categories:

https://www.youtube.com/watch?v=bPPm3fLiAfc&ab_channel=NordicSemiconductor

https://www.nordicsemi.com/News/2023/04/Nordic-Semiconductor-redefines-its-leadership-in-Bluetooth-Low-Energy-with-the-nRF54-Series

https://www.nordicsemi.com/Products/nRF54H20

PS: Bt the way, missed that Nordic Semi released nRF53 family, including nRF5340 SoC for Zigbee, Thread, and BLE back in 2019:

https://www.cnx-software.com/2019/11/17/nordic-semi-nrf5340-dual-arm-cortex-m33-soc-supports-bluetooth-5-1-mesh-nfc-thread-zigbee/

@DamKast
Copy link

DamKast commented May 10, 2023

Check this out! zigpy-zboss
I wrote the zigpy implementation for the nordic radio running the ZBOSS NCP sample (from the nRF Connect SDK). The package is called zigpy-zboss as you suggested, and it might be useful for esp-zigbee radio as well.
I based the implementation on the zigpy-znp and reused a lot of stuff from there.

Let me know what you think, and feel free to test it out on HA

@Hedda
Copy link
Contributor

Hedda commented May 10, 2023

Check this out! zigpy-zboss https://github.com/kardia-as/zigpy-zboss

I wrote the zippy implementation for the nordic radio running the ZBOSS NCP sample (from the nRF Connect SDK). The package is called zigpy-zboss as you suggested

That is awesome news! Hopefully more developers are interested to assist you now? -> https://github.com/kardia-as/zigpy-zboss

Any volunteers? @tomchy @MeisterBob @eexarevsky @codebullfrog @rbultman @codyc1515 @LuDuda @coderbyheart

Again, if this is made stable then it will be possible to use ZBOSS based Zigbee NCP adapters in Home Assistant's ZHA integration, Jeedom's Zigbee plugin, and Domoticz's Zigbee plugin, and well as others building Zigbee solutions in Python using zigpy.

Btw, what firmware image/version do you recommend for Nordic Semi's nRF52840 Dongle and are there Python scripts to flash it?

@MattWestb
Copy link
Contributor

This is very interesting !!!
Amazon Lab126 have Zigbee 3 certificated ERF32 in RCP mode running zboss but only for Zigbee 3 no thread supported https://csa-iot.org/csa_product/zigbee-3-0-platform-3/.

If implanting support for zboss its also open for 5th version of Zigbee of EFR32 chips.
NCP EZSP, Multi pan RCP Zigbee and Thread, RCP only Zigbee, RCP / NCP Thread / Zigbee and also RCP zboss Zigbee. Plus 3 OTBR RCPs versions from Silabs GSDK.

Perhaps one RCP with Zigbee / Thread is coming in the future from zboss so can running OTBR on the same chip on different hardware like EFR32 and Nordic (Nordic is having the reference design OTBR implementation).

@Hedda
Copy link
Contributor

Hedda commented May 10, 2023

it might be useful for esp-zigbee radio as well.

I guess that esp-zigbee should really be discussed in its own seperate discussion(?) but it will be really interesting to hear more later once ESPHome adds support to the new ESP32-C6 SoC/modules which requires upcoming Espressif's ESP IDF 5.1-> #783

Open discussion about possibility of an esp-zigbee radio library for zigpy -> #1052

ESP32-C6 Arduino support will require ESP IDF 5.1 framework which is still under development but the hardware is available:

espressif/arduino-esp32#7713

espressif/arduino-esp32#7852

espressif/esp-idf#10423

esp-zigbee could be very interesting for ESP32-based Zigbee gateway / remote adapter products, like ex. Tube's Zigbee Gateways:

https://github.com/tube0013/tube_gateways (and https://tubeszb.com )

Espressif's "esp-zigbee" solution is also based on ZBOSS Open Initiative (ZOI) and

https://dsr-zoi.com

Espressif already Zigbee certificated the ESP32-H2, so assume they will do the same for ESP32-C6 after ESP IDF 5.1 is released:

https://csa-iot.org/csa_product/esp32-h2/

https://docs.espressif.com/projects/esp-zigbee-sdk/en/latest/esp32/certification.html

https://api.knack.com/v1/applications/54e658034b4f44e42fb18201/download/asset/616f731cc3bc41001ec1b65f/docs080006070csgzigbee2015layerpicsandstackprofiles_esp32h2_oct_20.docx

esp-zigbee:

https://github.com/espressif/esp-zigbee-sdk

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

https://github.com/espressif/esp-zboss-lib/

https://components.espressif.com/components/espressif/esp-zboss-lib

https://github.com/espressif/esp-idf/tree/master/examples/zigbee/

https://github.com/espressif/esp-idf/blob/master/examples/zigbee/esp_zigbee_rcp

https://github.com/espressif/esp-idf/tree/master/examples/zigbee/esp_zigbee_gateway

ESP tools:

https://github.com/espressif/esptool

https://espressif.github.io/esp-protocols/

https://github.com/espressif/esp-protocols

https://github.com/espressif/esp-usb-bridge

https://github.com/espressif/openocd-esp32

@Hedda
Copy link
Contributor

Hedda commented May 10, 2023

By the way, could it be possible to try to update the old "zha-custom-radios" project (or fork @puddly's old custom component from older zigpy-znp revisions that were mentioned since the v0.0.10 release?) in order to make the zigpy-zboss radio library easier to install and test by pre-alpha testers as a custom component installable in Home Assistant from a custom repository via HACS (Home Assistant Community Store)?

https://github.com/zha-ng/zha-custom-radios

https://hacs.xyz/docs/faq/custom_repositories/

That (now obsolete) "zha-custom-radios" project was a custom component package for Home Assistant (with its ZHA component for zigpy integration) that allows users to test out new zigpy radio libraries and hardware modules before they have officially been integrated into ZHA. This enabled developers and testers to test new or updated zigpy radio modules without having to modify the ZHA component in the Home Assistant core source code.

Update! - Posted a separate discussion for that question here -> kardia-as/zigpy-zboss#2

@DamKast
Copy link

DamKast commented May 11, 2023

What firmware image/version do you recommend for Nordic Semi's nRF52840 Dongle and are they any Python scripts to flash it?

The firmware is built from the open nRF Connect SDK. I only changed memory configuration of the zboss stack in order to be able to build big zigbee networks (coordinator configuration). The SDK is built upon Zephyr RTOS.

Here can you find a firmware for the dongle that was built from the nRF Connect SDK v2.2.0.
I don't have a python script to flash the dongle but I am using the nordic programmer tool that comes with nRF Connect for Desktop.

@Hedda
Copy link
Contributor

Hedda commented May 16, 2023

Originally posted by @DamKast in kardia-as/zigpy-zboss#1 (comment)

Originally posted by @puddly in kardia-as/zigpy-zboss#1 (comment)

Does ZBOSS also successfully send any request to endpoint 0 and intercept the response? Or does it not allow the requests to be sent directly to endpoint 0 in the first place?

ZBOSS does actually send ZDO requests when using the APSDE data request command (I can see ZDO packets with the sniffer), but the response is intercepted and is not returned to zigpy. This is why we have to overwrite the Zdo class in order to redefine the request methods to use the specific ZBOSS commands.

Also, do you happen to have a link to the serial protocol documentation? I'm unable to find any of the commands within the ZBOSS source code, nor in Nordic's documentation.

I asked directly DSR and they sent me this documentation.

@DamKast Could you try to ask your contacts at DSR and/or Nordic Semiconductor if they are maybe willing to also add/share documentation on their public websites so that it could be added as a reference so all zigpy developers could reference that too?

https://github.com/kardia-as/zigpy-zboss/blob/main/README.md#external-links-documentation-and-other-development-references

(and #595)

@eexarevsky
Copy link

eexarevsky commented May 16, 2023

Hi!

See there https://cloud.dsr-corporation.com/index.php/s/BAn4LtRWbJjFiAm

Yes, ZBOSS supposes that application does not send ZDO commands as just APS data. Use ZDO API instead.

There are full sources for the host side of ZBOSS NCP there https://developer.nordicsemi.com/Zigbee/ncp_sdk_for_host/ncp_host_v2.2.1.zip

And, remind, Wireshark can parse ZBOSS NCP. But I am in doubt Nordic uses that feature.

@Hedda
Copy link
Contributor

Hedda commented Jul 21, 2023

Copy link

There hasn't been any activity on this issue recently. Due to the high number of incoming GitHub notifications, we have to clean some of the old issues, as many of them have already been resolved with the latest updates. Please make sure to update to the latest version and check if that solves the issue. Let us know if that works for you by adding a comment 👍 This issue has now been marked as stale and will be closed if no further activity occurs. Thank you for your contributions.

@github-actions github-actions bot added the stale label Jan 17, 2024
@Hedda
Copy link
Contributor

Hedda commented Jan 17, 2024

Can be closed if and when https://github.com/kardia-as/zigpy-zboss is moved to zigpy organization -> kardia-as/zigpy-zboss#17

@github-actions github-actions bot removed the stale label Jan 17, 2024
@codyc1515
Copy link

Is there a willingness from the maintainers to add this?

@Hedda
Copy link
Contributor

Hedda commented Jan 31, 2024

Can be closed if and when https://github.com/kardia-as/zigpy-zboss is moved to zigpy organization -> kardia-as/zigpy-zboss#17

@puddly would it be OK to move zigpy-zboss repository to zigpy organization if maintained there by @DamKast as a member?

Ownership and Maintainers of PyPI would also need to be transferred similarly:

You did write a comment in kardia-as/zigpy-zboss#2 that wanted to test it thoroughly first before including in the downstream ZHA component inside the Home Assistant core repo, but could it not be moved to the zigpy organization before that regardless?

It could be added as an "experimental" radio library in zigpy only, long before adding to ZHA integration (also as "experimental").

Again, it is likely to be discovered and tested by more people if added to zigpy organization and included in zigpy and on PyPI.

https://pypi.org/project/zigpy/

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

No branches or pull requests