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

Digi Xbee support #41

Closed
andreasfedermann opened this issue Mar 8, 2019 · 17 comments
Closed

Digi Xbee support #41

andreasfedermann opened this issue Mar 8, 2019 · 17 comments
Assignees
Labels
enhancement New feature or request

Comments

@andreasfedermann
Copy link
Contributor

Hi there,

do you plan to support the digi Xbee device too? Looking at #29 you will. But is there a timeline when you will begin implementing it?
Really great work so far guys!

Let me know if you need help.

@Mr-Markus
Copy link
Owner

Hi Andreas,

yes there are plans to implement the XBee hardware as next step, too. But we do not have a timeline for this, yet.
It should easily possible to do this, because the library is already designed for hardware seperation.

At the moment we don't have any hardware, yet so this would be the first step. We thought about buying the XStick, but until now we are not sure which hardware specific differences are between the XBee devices and what it means for the implementation.

Do you already have one and can tell us something about them?

Thanks

@andreasfedermann
Copy link
Contributor Author

I own an S2C device with the XB24C product family and form factor TH (Through Hole). I use it in conjunction with a waveshare arpi600 board which extends my Raspberry PI 3B+. I don't know what the exact differences between the XStick and Xbee devices are either. I tested the Xbee device with the X-CTU from digi to control my philips hue. That already worked. But because of the lack of existing .net libraries I paused my project some months ago.
But now its worth it to reactivate my project and test your lib. Maybe I could try to implement the Xbee hardware if you agree with it.

@Mr-Markus
Copy link
Owner

Ok, I understand.

I would appreciate if you would try to implement it and would help you at any time if you need help.

As I told before the libary is still designed for further hardware implementation. Your main entry point would be a Manager or dongle class that implements the IZigBeeTransportTransmit interface.

As an example you can use the ZigBeeDongleTiCc2531 class.
It would also be helpful for you to look here:
https://github.com/zsmartsystems/com.zsmartsystems.zigbee/tree/master/com.zsmartsystems.zigbee.dongle.xbee
https://github.com/zsmartsystems/com.zsmartsystems.zigbee/tree/master/com.zsmartsystems.zigbee.dongle.xbee.autocode

The architecture at this repo is very well and the abstraction is implemented very well too, so that we created this repo with .netstandard technology and translated it mostly from java to c#
So it should be much easier for you to understand it. Otherwise don't hesitate in contacting me 😊

@Mr-Markus Mr-Markus added the enhancement New feature or request label Mar 9, 2019
@Mr-Markus
Copy link
Owner

Mr-Markus commented Mar 9, 2019

Here the project structure I would suggest for your implementation:

image

We use Shared Projects for the implementation in the src folder and create a specific target framework project in targets folder which references to it, so that we can support muliptle plattfroms

@andreasfedermann
Copy link
Contributor Author

I really like that shared project approach. I only used linked files until now. But I have one question. What about other product families which are not a dongle. Shall these products be supported in the future too? Maybe they are already supported with the reference (java) implementation. I am struggling a bit with the naming of the class. The word dongle in the class name is maybe not sufficient enough. Shouldn't the name be more neutral? Maybe ZigBeeDigiXBee?
I want to provide unit tests as well. Do you prefer any unit test framework?

@Mr-Markus
Copy link
Owner

Yes, I would like to get this library as flexible as possible. I already saw IP Gateways from Digi for example and it would be great if they would also be supported. Did you mean that?

I am not really sure about Xbee plattform and it's protocol but if the only difference would be the transmit then the "Dongle" class should be named more natural.

We already talked about Unit tests and prefered XUnit in issue #20 but haven't realised them until now :-)

@Mr-Markus
Copy link
Owner

@andreasfedermann
How is the current status for the implementation?

Please see #44 for important changes to the project structure

@andreasfedermann
Copy link
Contributor Author

andreasfedermann commented Apr 3, 2019

Hi Markus,

I’m currently working on the auto code project which is based on system codedom. I created a fork for that. When do you think is it appropriate to create a pull request? Should I finish the complete implementation including the digi xbee stack first?

I’ll merge the latest changes into my fork as soon as possible.

@Mr-Markus
Copy link
Owner

Sounds great!

I think that it would be the best way to create a PR if all work is done. Otherwise we have not-runnable code in the master branch

A short tip for the change from shared project to netstandard:
I created a new netstandard library in another directory with same name as the shared library project, copied only the new *.csproj into the same directory as the *.shproj file and replaced the reference via editor in the sln file with the new *.csproj file and removed the old *.shproj files from the project.
And that's it 😊

@nicolaiw
Copy link
Contributor

nicolaiw commented Apr 9, 2019

@andreasfedermann
First at all...thank you for your effort! I just had a look at your work and just in case you didn't noticed...could you please shift your ZigBeeNet.Digi.XBee.CodeGenerator project to the src folder before sending a PR ?

Again.. Thank you!

@nicolaiw nicolaiw changed the title Digi Xbee support [WIP] Digi Xbee support Apr 29, 2019
@Mr-Markus
Copy link
Owner

Hi @andreasfedermann ,
I took a look on your fork and it's code and it looks great. How much work do you think is still needed for a PR?

One thing: The path ZigbeeNet/targets/ZigBeeNet.Hardware.Digi.XBee.core2.2/ and it's content looks like remains from the old shared project structure. Please remove it before you create a PR

Many thanks!!!

@andreasfedermann
Copy link
Contributor Author

Hi @Mr-Markus,
I’m almost done. I extended the playground project to be able to choose the dongle by arguments. I will commit and sync this soon. This week for sure. I already tested the digi xbee device but I still have some problems. If I start my coordinator and then switch on a router device (hue bulb) I get notified. My nodes get updated also. But if I try to switch off the light it is not working yet because of missing endpoint information. I think it is an configuration thing but I’m not sure. So I think the PR will be soon.
I will remove the old structure immediately too.

Best regards!

@andreasfedermann
Copy link
Contributor Author

Hello @Mr-Markus,

I tested my device and it works now. I found out that the reason it didn't work was the fact that the deserialization method of the ZdoCommand was commented out. The uncommenting was done with commit 5c401b2. If I commented this line in again, it worked for me. Can you please tell me why the uncommenting was done? Nevertheless i will create a PR.

@Mr-Markus
Copy link
Owner

Hi @andreasfedermann
the uncommenting was done because of a bug in the CC2531 implementation. It is fixed in commit 481a6a5. Thanks for your tip.
I will check the PR and will merge or comment it if there are any questions

@Mr-Markus Mr-Markus changed the title [WIP] Digi Xbee support Digi Xbee support May 5, 2019
@nicolaiw
Copy link
Contributor

nicolaiw commented May 5, 2019

@andreasfedermann
Thank you very much for your work! Could you tell us which devices and commands you successfully tested with the Digi Xbee Hardware so we can adjust the readme and wiki pls?

Thank you

Best Regards

@andreasfedermann
Copy link
Contributor Author

Hey there,
the port of the code was really fun. And I will participate in the future too. So please let me know if help is needed.
I will leave a comment regarding the tested device on the foreseen issue.
I will close this issue if this is ok for you.

@nicolaiw
Copy link
Contributor

nicolaiw commented May 7, 2019

I think it's ok to close this issue.

Thank you!

Mr-Markus added a commit that referenced this issue Jun 27, 2019
- See #47 for supported devices
- NetworkSerialization #34
- XBee implemented #41
- Updated bind request to return #51
- .editorconfig added #57
- UnitTests added #20
- ZigBeeNet with auto generated cluster classes
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
enhancement New feature or request
Projects
None yet
Development

No branches or pull requests

3 participants