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

Zstack 3.x.0 support for TI CC2652 chip #1352

Open
wants to merge 36 commits into
base: master
Choose a base branch
from

Conversation

leonschenk
Copy link

I have been developing this. I have tested with my Sonoff chip, I have no other devices to test.
What needs to be done:

  • bootloader/flashing capability
  • use the device as a router/endpoint capability
  • error handling (unexpected reset)
  • initialization issues (cause not yet investigated)

cdjackson and others added 17 commits September 10, 2022 08:52
Signed-off-by: Chris Jackson <chris@cd-jackson.com>
Signed-off-by: Chris Jackson <chris@cd-jackson.com>
Signed-off-by: Chris Jackson <chris@cd-jackson.com>
Signed-off-by: Chris Jackson <chris@cd-jackson.com>
Signed-off-by: Chris Jackson <chris@cd-jackson.com>
Signed-off-by: Chris Jackson <chris@cd-jackson.com>
Signed-off-by: Chris Jackson <chris@cd-jackson.com>
Signed-off-by: Chris Jackson <chris@cd-jackson.com>
Signed-off-by: Chris Jackson <chris@cd-jackson.com>
Signed-off-by: Chris Jackson <chris@cd-jackson.com>
@CLAassistant
Copy link

CLAassistant commented Sep 26, 2022

CLA assistant check
All committers have signed the CLA.

@lgtm-com
Copy link
Contributor

lgtm-com bot commented Sep 26, 2022

This pull request introduces 8 alerts when merging 0c093ae into 1938be0 - view on LGTM.com

new alerts:

  • 4 for Spurious Javadoc @param tags
  • 3 for Dereferenced variable may be null
  • 1 for Useless comparison test

@lgtm-com
Copy link
Contributor

lgtm-com bot commented Sep 27, 2022

This pull request introduces 8 alerts when merging 8e040ae into 1938be0 - view on LGTM.com

new alerts:

  • 4 for Spurious Javadoc @param tags
  • 3 for Dereferenced variable may be null
  • 1 for Useless comparison test

@lgtm-com
Copy link
Contributor

lgtm-com bot commented Sep 28, 2022

This pull request introduces 6 alerts when merging d22fb76 into 1938be0 - view on LGTM.com

new alerts:

  • 3 for Dereferenced variable may be null
  • 2 for Spurious Javadoc @param tags
  • 1 for Useless comparison test

Update README.md for Z-Stack 3 ZNP
@Hedda
Copy link
Contributor

Hedda commented Sep 28, 2022

What needs to be done:

  • bootloader/flashing capability

@leonschenk You might already be aware but FYI, many other projects depend on cc2538-bsl (Python cross-platform script) by JelmerT to upload firmware via the serial boot loader onto the CC13xx, CC2538 and CC26xx SoC. -> https://github.com/JelmerT/cc2538-bsl (and note it also have old versions but not the newer versions published via PyPI here -> https://pypi.org/project/cc2538/).

And FYI, another related tool is zigpy-cli -> https://github.com/zigpy/zigpy-cli as it can be used to backup the Zigbee network before flashing new firmware and then restoring such Zigbee network backups, and interestingly it saves the backups using the "Open ZigBee Coordinator Backup Format" -> https://github.com/zigpy/open-coordinator-backup which I understand is a unified format which supported under the hood by both Zigbee2MQTT and the ZHA integration in Home Assistant which technically could, in theory, make migration of a Zigbee network possible from one application to another (like from Zigbee2MQTT to OpenHAB ZigBee binding or vice versa).

@cdjackson
Copy link
Member

@Hedda this project also supports firmware updates, and also supports coordinator backups. Ideally these features will be available for all coordinators within this project so that all systems using it have such support. This isn't really an issue for Home Assistant, or any other system (openHAB etc) - this is a low level library only!

@cdjackson
Copy link
Member

@leonschenk please can you also address the issues raised by lgtm. Also, as per our other discussion, please just let me know when you think this is ready for review (ie you're happy that it has reasonable support for errors etc during initialisation).

@leonschenk
Copy link
Author

@cdjackson It will take some time for me to work it out, I will take a look at lgtm.
@Hedda do you have a device/setup with which you can test the produced library?

@Hedda
Copy link
Contributor

Hedda commented Oct 28, 2022

@leonschenk which firmware build/version are you by the way using for testing? Guessing Z-Stack_3.x.0 20220219 from Koenkk?

https://github.com/Koenkk/Z-Stack-firmware/tree/master/coordinator/Z-Stack_3.x.0/bin

https://github.com/Koenkk/Z-Stack-firmware/tree/develop/coordinator/Z-Stack_3.x.0/bin

@Hedda do you have a device/setup with which you can test the produced library?

Sorry I do not, suggest you perhaps ask for help with testing in openHAB Zigbee Binding request here:

openhab/org.openhab.binding.zigbee#605

and/or maybe also in the openHAB community forum in these two threads:

https://community.openhab.org/t/discussion-about-texas-instruments-z-stack-3-0-and-cc2652-and-cc1352-zigbee-coordinator-adapters-with-openhab-zigbee-binding/129385

https://community.openhab.org/t/iteads-sonoff-zigbee-3-0-usb-dongle-plus-model-zbdongle-p-based-on-texas-instruments-cc2652p-20dbm-radio-mcu-now-sold-for-19-99/126738

@leonschenk
Copy link
Author

@Hedda thank you for your suggestions.
About bootloading capability: I will not be implementing this in the initial setup. If requested, I might implement this later.
About "Open ZigBee Coordinator Backup Format": In this project the backup is independent with the 'dongle' firmware.
I will upload a 'kar' file for testing in the openhab forum. I use version Z-Stack_3.x.0 20220219 from koenkk.

@lgtm-com
Copy link
Contributor

lgtm-com bot commented Nov 2, 2022

This pull request introduces 1 alert when merging 0fc54f8 into 89b7540 - view on LGTM.com

new alerts:

  • 1 for Implicit conversion from array to string

@leonschenk
Copy link
Author

@cdjackson I have some trouble with the discovery of my test device. The device is discovered, but it takes some time before the discovery is complete. This is due to the device which goes to sleep very soon. But is discovery always 'slow' (because I expected a discovery attempt directly after a 'DATA REQUEST', but this is not what I see). Is there any delay, or is it a bug in the Zstack implementation? If you would like to, I am able to send you a wireshark capture.

@leonschenk leonschenk mentioned this pull request Nov 5, 2022
@leonschenk
Copy link
Author

@cdjackson the dongle works very well.
I have been testing it with 3 different devices for a week now. It has not crashed and works very stable. I have addressed all issues that I had previously.
I hope you will merge my pull request and release a new version.
I will be committed to the work of any bugs or improvements that pop up.

@Hedda
Copy link
Contributor

Hedda commented Feb 3, 2023

@leonschenk
Copy link
Author

@cdjackson
Copy link
Member

@leonschenk Please can you take a look at the comments I made on #1280 which I reviewed by mistake. These mostly relate to the changes to the ZigBeePort interface and implementations would unless there's a really good reason should not be changed. I think the only other comment I had was around the code generator - just to remove the @author tag and add the @Generated annotation.

I've not reviewed everything - I'm not sure if there's anything specifically you want me to look at (eg areas where you've made large changes from my original code)? I'm been through all the changed code (eg in common parts of the library and other than the serial interface changes I think it looks ok so would be happy to merge.

@Hedda
Copy link
Contributor

Hedda commented Apr 18, 2023

@leonschenk Please can you take a look at the comments I made on #1280 which I reviewed by mistake. These mostly relate to the changes to the ZigBeePort interface and implementations would unless there's a really good reason should not be changed. I think the only other comment I had was around the code generator - just to remove the @author tag and add the @Generated annotation.

I've not reviewed everything - I'm not sure if there's anything specifically you want me to look at (eg areas where you've made large changes from my original code)? I'm been through all the changed code (eg in common parts of the library and other than the serial interface changes I think it looks ok so would be happy to merge.

@leonschenk and @t-8ch Do you have any updates on/for this PR for Z-Stack 3 driver?

@Hedda
Copy link
Contributor

Hedda commented Oct 24, 2023

@leonschenk and @t-8ch Do you have any updates on/for this PR for Z-Stack 3 driver?

cdjackson posted in the forum that this needs to be updated or else it will probably not work:

https://community.openhab.org/t/discussion-about-texas-instruments-z-stack-3-0-and-cc2652-and-cc1352-zigbee-coordinator-adapters-with-openhab-zigbee-binding/129385/11

"Probably the version from November will not work any more - unless you use an old version of OH as well."

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

Successfully merging this pull request may close these issues.

None yet

5 participants