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

Port cc-znp to communicate with TI CC253X / CC26X2R1 Zigbee Network Processor (ZNP) with Z-Stack firmware over UART serial port #85

Closed
Gamester17 opened this issue Sep 25, 2018 · 20 comments

Comments

@Gamester17
Copy link
Contributor

Gamester17 commented Sep 25, 2018

Would it be possible to port the cc-znp library (or the newer forks of it) from JavaScript to Python to use as a base in a radio module for Zigpy to communicate with cheap TI CC253X based USB dongles when they are flashed with the custom Z-Stack firmware that the Zigbee2mqtt project has developed?

Texas Instruments CC253X based dongles like the inexpensive CC2531 USB sniffer sticks you can buy from China for less than $9 including shipping are readily available hardware and recently been made very popular by the Zigbee2mqtt (Zigbee to MQTT bridge) project which made a custom Z-Stack firmware for have them which has full Zigbee 3.0 stack with coordinator functionality (the project provide both Z-Stack 1.2 and Z-Stack 3.0 coordinator firmware, and also repeater firmware as well).

cc-znp library which was written in JavaScript is an integration interface for a host to communicate with the Z-Stack firmware running on TI CC253X Zigbee Network Processor (ZNP) using a serial protocol over a serial port via TI Z-Stack Monitor and Test (MT) APIs upon a UART interface. This cc-znp libary was utilized by the original zigbee-shepherd project and now also in the newer zigbee-herdsman project as well as some other projects which makes use of the use of custom Z-Stack firmware on CC253X chips. Most of which are based on Texas Instruments Z-Stack SDK (like the custom Z-Stack firmware available from the Zigbee2mqtt project).

https://github.com/zigbeer/cc-znp
https://github.com/zigbeer/cc-znp/wiki

Note! Best would probably be to port the code from newer forks of the cc-znp library which contains updated code and are better maintained:

https://github.com/Koenkk/cc-znp
https://github.com/open-zigbee/zigbee-bridge-znp
https://github.com/Koenkk/zigbee-herdsman

Update!: FYI @sanyatuning started development on a cc-znp python port as a module for Zigpy here:

https://github.com/sanyatuning/zigpy-cc

Another update! FYI, Adminiuga & puddly started development zigpy-znp as a alternative module here:

https://github.com/zha-ng/zigpy-znp
and here:
https://github.com/puddly/zigpy-znp

FYI; ioBroker is another JavaScript based project which Zigbee via same custom Z-Stack by Koenkk (ioBroker Zigbee module is based on zigbee-herdsman library and their new converters database)

https://github.com/ioBroker/ioBroker.zigbee

ioBroker claim to not only support CC2531/CC2530 but also CC26x2R and CC2538 (+ CC2592 PA)

https://github.com/ioBroker/ioBroker.zigbee/blob/master/README.md

Update! Z-Stack firmware from @Koenkk now also has experimental support CC2652R / CC26X2R1 based USB sticks and he has added Zigbee 3.0 support in Z-Stack 3.0 firmware as well. CC2652R by Texas Instruments is a new high-performance Zigbee chip which is much faster and contains much more memory than the CC2530 and CC2531 chips, (bonus is that Texas Instruments LAUNCHXL-CC26X2R1 LaunchPad development kit board requires no additional flashing hardware is needed, as the board has an on-board programmer).

https://github.com/Koenkk/Z-Stack-firmware
https://github.com/Koenkk/zigbee2mqtt
https://www.zigbee2mqtt.io

Do you think that Zigpy support CC253x (like CC2531) chips with custom Z-Stack firmware could be achieved by porting cc-znp from the latest zigbee-shepherd and zigbee-herdsman by Zigbee2mqtt project?

As I understand it, that custom Z-Stack firmware could possibly also be made compatible with additional Zigbee USB sticks/boards, like those based on CC2530, CC2530EM, CC2538, CC2540, CC2630, CC2650, CC2590, CC2591, and CC2592 chips from Texas Instruments as well?

https://github.com/zigbeer/zigbee-shepherd/wiki
https://github.com/zigbeer/documents/tree/master/zigbee-shepherd

Anyway, cc-znp, zigbee-shepherd, and zigbee-herdsman are all open-source software written in JavaScript. They support TI's CC253X wireless SoC as a zigbee network processor (ZNP) with custom Z-Stack firmware, and takes the ZNP approach with cc-znp to run the CC253X as a coordinator and to run zigbee-shepherd or zigbee-herdsman as the host.

@Koenkk who is the developer of zigbee2mqtt has most recently been developing zigbee-herdsman as a fork of zigbee-shepherd and is an improved replacement for zigbee-shepherd

https://github.com/Koenkk/zigbee-herdsman
https://github.com/Koenkk/zigbee-herdsman-converters

PS: Zigbee2mqtt also have source code as well as pre-built firmware for a custom Z-Stack firmware :

https://github.com/Koenkk/Z-Stack-firmware
https://github.com/Koenkk/Z-Stack-firmware/tree/master/coordinator
https://github.com/Koenkk/zigbee2mqtt/wiki/Getting-started
https://github.com/Koenkk/zigbee2mqtt

@Gamester17 Gamester17 changed the title Port cc-znp to communicate with TI CC253X Zigbee Network Processor(ZNP) over a serial port Port cc-znp to communicate with TI CC253X Zigbee Network Processor (ZNP) over UART serial port Dec 5, 2018
@Gamester17 Gamester17 changed the title Port cc-znp to communicate with TI CC253X Zigbee Network Processor (ZNP) over UART serial port Port cc-znp to communicate with TI CC253X Zigbee Network Processor (ZNP) with Z-Stack firmware over UART serial port Dec 5, 2018
@Gamester17
Copy link
Contributor Author

Gamester17 commented Jan 9, 2019

Please also see the updated znp forks that is used by then open-zigbee and zigbee2mqtt projects today:

@leobel96
Copy link

+1 for TI CC253X support

@highground88
Copy link

Also keen on testing with the Texas Instruments CC2531 in particular. Cheap device and very flexible.

@andriej
Copy link

andriej commented Mar 20, 2019

+1, would be superb

@sanyatuning
Copy link

+1

1 similar comment
@BurningC4
Copy link

+1

@Hedda
Copy link
Contributor

Hedda commented Oct 3, 2019

Has anyone made any progress with Zigpy for CC253x USB sticks with custom Z-Stack firmware?

https://www.zigbee2mqtt.io/getting_started/flashing_the_cc2531.html

https://github.com/Koenkk/Z-Stack-firmware

@Gamester17
Copy link
Contributor Author

Gamester17 commented Dec 12, 2019

FYI, it looks like the Z-Stack firmware from @Koenkk now also has experimental support CC2652R / CC26X2R1 based USB sticks and he has added Zigbee 3.0 support in Z-Stack 3.0 firmware as well

https://github.com/Koenkk/Z-Stack-firmware

CC2652R by Texas Instruments is a new high-performance Zigbee chip which is much faster and contains much more memory than the CC2530 and CC2531 chips

Koenkk posted some more information about CC2652R here Koenkk/zigbee2mqtt#1429

**_Notes

  • The device can be bought here: http://www.ti.com/tool/launchxl-cc26x2r1
  • No additional flashing hardware is needed, it has an on-board programmer (no CC debugger needed).
  • The board has +- the size of a Raspberry Pi
  • Zigbee 3.0!
  • Flash using Flash Programmer v2
  • Firmware can be found here in the bin folder: https://github.com/Koenkk/Z-Stack-firmware/tree/master/coordinator/Z-Stack_3.x.0
  • It's not possible to migrate your Zigbee 1.2 network (requires repairing)
  • The network restore trick that we used in Zigbee 1.2 doesn't work anymore (due to better security policies). A backup of the CC2652R is taken at every shutdown of zigbee2mqtt, file can be found under data/coordinator_backup.json. This backup is automatically restored when starting with a new flashed CC2652R._**

@Gamester17 Gamester17 changed the title Port cc-znp to communicate with TI CC253X Zigbee Network Processor (ZNP) with Z-Stack firmware over UART serial port Port cc-znp to communicate with TI CC253X / CC26X2R1 Zigbee Network Processor (ZNP) with Z-Stack firmware over UART serial port Dec 12, 2019
@Gamester17
Copy link
Contributor Author

FYI, Tasmota is another popular project that makes use of the Z-Stack-firmware from Koenkk

https://github.com/arendst/Tasmota/wiki/Zigbee

Z2T (Zigbee to Tasmota) concept allows you to make your own Zigbee to WiFi bridge by combining Z-Stack-firmware on CC2530 and Tasmota firmware on ESP8266 / ESP82xx hardware.

@sanyatuning
Copy link

FYI
I started working on this :)

@Hedda
Copy link
Contributor

Hedda commented Jan 3, 2020

@sanyatuning Awesome that you started on this! I for one will now be ordering a CC2531 USB sniffer and keep an eye on your repository at https://github.com/sanyatuning/zigpy-cc

@Gamester17
Copy link
Contributor Author

@sanyatuning Very cool! Which version of Z-Stack firmware are you testing? It's from Koenkk or?

https://github.com/Koenkk/Z-Stack-firmware

Z-Stack 3 (3.x) supports the full Zigbee 3.0 specification according to these discussions here:

Koenkk/zigbee2mqtt#1429
Koenkk/zigbee2mqtt#1568

FYI, this Z-Stack 3.0 and later firmware has experimental support in Zigbee2mqtt dev branch.

@Gamester17
Copy link
Contributor Author

Gamester17 commented Jan 13, 2020

FYI; ioBroker is another JavaScript based project which Zigbee via same custom Z-Stack by Koenkk

https://github.com/ioBroker/ioBroker.zigbee

ioBroker claim to not only support CC2531/CC2530 but also CC26x2R and CC2538 (+ CC2592 PA)

https://github.com/ioBroker/ioBroker.zigbee/blob/master/README.md

ioBroker Zigbee module is based on zigbee-herdsman library and their new converters database

@sanyatuning
Copy link

@Gamester17 my port is based on zigbee herdsman. I'm testing with z-stack 1, but it can be compatible with v3.
I would like to continue developing it this week.

@dzungpv
Copy link

dzungpv commented Jan 17, 2020

@sanyatuning Great effort! I use zigbee2mqtt for year, but native component for HA always the best.

@Gamester17
Copy link
Contributor Author

Gamester17 commented Feb 2, 2020

@sanyatuning see that @puddly now submitted a pull request for CC26X2R1 support to your zigpy-cc

zigpy/zigpy-cc#8

FYI, in related news I also that "zig-a-zig-ah" ("zzh" for short) USB-stick form-factor dev board based on CC2652R / CC2652P has been announced as an open-source hardware design by Electrolama ( @omerk and friends ) under open source Solderpad Hardware Licence Version 2.0

https://github.com/electrolama/zig-a-zig-ah/

https://github.com/electrolama/docs/blob/master/docs/projects/zig-a-zig-ah.md

"Assembled versions of zig-a-zig-ah! will be made available on Tindie when it is ready"

https://electrolama.com/projects/zig-a-zig-ah

https://electrolama.com/_assets/zzh-RevA-Draft1-010220.pdf

https://twitter.com/OmerK

@Gamester17
Copy link
Contributor Author

Gamester17 commented Feb 13, 2020

FYI, looks like @sanyatuning has now submitted initial (“Beta”) support for Home Assistant integration:

home-assistant/core#31621

home-assistant/home-assistant.io#12051

@Hedda
Copy link
Contributor

Hedda commented Mar 25, 2020

FYI, it looks like Adminiuga (and puddly via a fork) started on zigpy-znp as an alternative to zigpy-cc

It has not been updated by Adminiuga in about 4-months but puddly continues in his fork here:

Neither of those projects has yet been announced so are still both very early work in progress.

@puddly
Copy link
Collaborator

puddly commented Mar 25, 2020

I'm pretty close to getting zigpy-znp running. I'm just waiting for a second TI radio so that my entire house is not unusable while I fix bugs.

@Adminiuga
Copy link
Collaborator

There's https://github.com/zigpy/zigpy-cc and work being done in https://github.com/zha-ng/zigpy-znp

Can continue discussions in those repos.

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

10 participants