-
Notifications
You must be signed in to change notification settings - Fork 88
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 driver #1280
base: master
Are you sure you want to change the base?
Zstack driver #1280
Conversation
Signed-off-by: Chris Jackson <[email protected]>
Signed-off-by: Chris Jackson <[email protected]>
Signed-off-by: Chris Jackson <[email protected]>
Signed-off-by: Chris Jackson <[email protected]>
Signed-off-by: Chris Jackson <[email protected]>
Signed-off-by: Chris Jackson <[email protected]>
Signed-off-by: Chris Jackson <[email protected]>
Signed-off-by: Chris Jackson <[email protected]>
Signed-off-by: Chris Jackson <[email protected]>
Signed-off-by: Chris Jackson <[email protected]>
Nice! Are you testing with Koenkk's firmware images from "develop" branch or "master" branch (currently "20210708"), or other? 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 FYI, 20211114 currently in develop branch is based on TI SDK 5.30.00.56 comparing to it should in practice only have bug fixes. |
@Hedda 20210708 as written in the PR description. |
@t-8ch Hi, could you explain how did you test the code? I have a CC2562P with ZSTACK 3.X.0 and a zigbee thermostat; would like to test the code to it. Edit: I forgot to add what I tried: Cloned the repository, run mvn clean install and it gives me error regarding missing headers(?) (also: where did you find informations regarding ZStack Booting and startup sequence? Can't understand what changes between 1.2 to 3.X.0) |
@Aimen-Hammou This should be explained in the docs. You should probably wait with enduser-testing until it is confirmed that it works in general. |
@t-8ch Tried the DOCS, nothing. Even the main repository doesn't work tbh |
@Aimen-Hammou Then it would be best to open a new ticket for that and describe the issue in more detail there. |
@t-8ch Ok, thank you. Out of curiosity: where did you find informations regarding ZStack 3.X.0 and the startup process? |
@Aimen-Hammou The schematics show that RTS and DTR of the USB-UART adapter are wired to Reset and BOOTLOADER_ENABLE of the CC2652. So what this does is: Assert BOOTLOADER_ENABLE and force reset the CC2652 which will then bypass the bootloader. |
FYI, the latest versions of TI Z-Stack SDK documentation looks to be available from the official Texas Instruments source here: https://dev.ti.com/tirex/explore/node?node=AGfGICF0XoQz0l9l-rT2Qg__BSEc4rl__LATEST "SimpleLink CC13xx CC26xx SDK" (version 5.30.00 and later) covers CC2652 and CC1352 which are used for TI Zigbee Coordinator: https://www.ti.com/tool/SIMPLELINK-CC13XX-CC26XX-SDK PS: The very latest is TI SimpleLink CC13xx and CC26xx SDK version 5.30.00.56 which was released on the 27th of October 2021. |
Thanks @t-8ch Regarding the firmware that is being used for testing - is this a "standard" TI version? ie there's nothing too much different - just tweaking table sizes etc? I would just like that this conforms to the standard API and doesn't rely on anything from other projects that is non-standard. Regarding the reset - again - is this standard on all devices, or is this somehow implementation specific. If it's implementation specific (as I suspect?) then it would be good to make this configurable so that it's not locked to the hardware you use. In the Ember driver I have a I think you know what you're doing here so probably you don't need me, but if there's anything you want me to answer or help with, just shout. @Aimen-Hammou as I have said a few times now, if you have questions, then please open a ticket and I can try and help, however this project does compile just fine, so I'm not sure why you are getting errors. Please though, let's discuss separately. |
@cdjackson This should be the difference to the vanilla Zstack firmware from TI: https://github.com/Koenkk/Z-Stack-firmware/blob/master/coordinator/Z-Stack_3.x.0/firmware.patch A resetprovider looks reasonable. I will try to refactor that part during the cleanup phase. As I got to it to generally recognize the Aqara Button I am confident in both the hardware and your existing code.
Thanks, will do. |
The patch that Koen applies to each of his builds can be found in that same repo with a changelog and steps on how it's compiled: https://github.com/Koenkk/Z-Stack-firmware/blob/develop/coordinator/Z-Stack_3.x.0/COMPILE.md @Koenkk Perhaps you would be willing to futher summarize how your Z-Stack 3.x.0 coordinator FW builds differ from TI's default? Summary from changelog shortened:
|
This pull request introduces 7 alerts when merging 7dd394a into 2318aa5 - view on LGTM.com new alerts:
|
FYI, the latest firmware from Koenkk's develop branch contains a fix for newer Aqara E1 / Xiaomi E1 devices + TI's upstream fixes: https://github.com/Koenkk/Z-Stack-firmware/tree/develop/coordinator/Z-Stack_3.x.0/bin Update! Z-Stack 3.x.0 20211217 release has now been copied to their master branch and as such should be seen as stable: https://github.com/Koenkk/Z-Stack-firmware/tree/master/coordinator/Z-Stack_3.x.0/bin Note however that new firmware does however not specifically mention the even newer Aqara T1 / Xiaomi T1 series of devices. PS: Regardless, Aqara and Xiaomi devices (as well as Tuya manufactured Zigbee devices) do not make for a good reference as they are infamously known for deviating from standard Zigbee Cluster Library specification causing interoperability/compatibility issues. |
I'm interested in this PR. Has there been any more progress? |
@t-8ch Any news/updates on this PR for Z-Stack 3.0 Zigbee Coordinator driver support (to be used in openHAB ZigBee Binding)? |
This issue has been automatically marked as stale because it has not had recent activity. It will be closed if no further activity occurs. Thank you for your contributions. |
@t-8ch Any chance to get this merged? |
FYI; @leonschenk posted now in OpenHAB community forum here 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/4 that he now picked up the development where @t-8ch left it, forking his branch of the zstack driver with Z-Stack 3 support to https://github.com/leonschenk/com.zsmartsystems.zigbee/tree/zstack/initial in order to continue the work of adding initial support for CC2652/CC1352 based adapters with Z-Stack 3.x.0 Zigbee Coordinator firmware https://github.com/Koenkk/Z-Stack-firmware/tree/master/coordinator/Z-Stack_3.x.0/bin so hopefully once he feels it works good enough for review he will create a new pull request to the com.zsmartsystems.zigbee ZigBee Cluster Library Java framework//libraries that OpenHAB's ZigBee Binding and other projects depend on https://github.com/zsmartsystems/com.zsmartsystems.zigbee |
@Hedda there is no real need to cross post this everywhere. I'm in discussion about this already and we don't really need spam posts everywhere which doesn't add anything! |
@NathanSweet I have a working development going on in #1352 |
@leonschenk Thanks for the ping. While I'd love to be able to interface with ZB directly using Java, it's so low level that for me it would need to work out of the box. I ended up using zigbee2mqtt, which has been working very well and has good support. It's a little annoying to run a node process but at least the API via MQTT makes interfacing with it very easy. |
This issue has been automatically marked as stale because it has not had recent activity. It will be closed if no further activity occurs. Thank you for your contributions. |
@@ -85,6 +85,16 @@ public interface ZigBeePort { | |||
*/ | |||
void purgeRxBuffer(); | |||
|
|||
/** |
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
These methods should not be added here. This interface is not specific to a serial port - that is implemented in the ZigBeeSerialPort
class. Here we need to keep it more abstract as there are other implementations of this such as an SPI implementation.
@@ -273,19 +273,21 @@ public void purgeRxBuffer() { | |||
} | |||
} | |||
|
|||
public boolean setDtr(boolean state) { | |||
@Override |
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
These methods should not be changed. They can't be defined in the interface as per the other comment, so th @Override
should be removed, and my preference would be not to change the return statement as I don't know if this is used by other users. If it is, it will be a breaking change that I would prefer to avoid.
@@ -111,5 +111,13 @@ public boolean open(int baudRate, FlowControl flowControl) { | |||
@Override | |||
public void purgeRxBuffer() { | |||
} | |||
|
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
As per other comments this probably needs to be removed.
@@ -202,6 +202,14 @@ public boolean open(int baudRate, FlowControl flowControl) { | |||
public void purgeRxBuffer() { | |||
} | |||
|
|||
@Override | |||
public void setDtr(boolean state) { |
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
Likewise - should be removed.
@@ -206,6 +206,14 @@ public boolean open(int baudRate, FlowControl flowControl) { | |||
public void purgeRxBuffer() { | |||
} | |||
|
|||
@Override |
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
Please remove
outputWithLinebreak(out, "", structure.description); | ||
out.println(" * <p>"); | ||
} | ||
out.println(" * Note that this code is autogenerated. Manual changes may be overwritten."); |
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
I'd suggest to remove the @author tag below and instead add the @Generated
annotation.
@Generated(value = "com.zsmartsystems.zigbee.autocode.ZigBeeCodeGenerator", date = "2020-12-25T10:11:19Z")
As discussed in #1226
This is a rebased version of your zstack_driver branch.
Most of the patches are 1:1 rebases of yours.
Beginning from my patches:
My setup:
Current status: