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

How to get Echonet Lite node value when it change #11

Open
CuongNXV opened this issue Apr 28, 2020 · 3 comments
Open

How to get Echonet Lite node value when it change #11

CuongNXV opened this issue Apr 28, 2020 · 3 comments

Comments

@CuongNXV
Copy link

I only get device value one time when it registers with Home Gateway, after that i do not receive any packet from it. I want to know whether value of a node changed, can you show me how to do that.

@sowd
Copy link
Member

sowd commented Apr 28, 2020

Spontaneous notification of value change is mandatory for very few important properties in Echonet Lite to support low power device/narrow network bandwidth (though not prohibited.)
Please check the latest appendix sheet.

https://echonet.jp/spec_object_rl_en/

Currently, only 3 properties in the super class require announcement, while air conditioner has 2 additions.

@CuongNXV
Copy link
Author

Because I want to get value of device continuously. So I use While(true) to loop for requesting and then receiving the message from devices. But I must create a lot of separate threads for each device. How can I request and get device information continuously without using while(true)? Because I want to use a single thread for one class code device.
image

@sowd
Copy link
Member

sowd commented May 3, 2020

Because of the protocol spec, the only way to trace value change of non-announcing properties is to use 'polling' technique.
It is essentially the same as your while(true) loop. You have to send requests multiple times and check the responses (as frequent as you want, but don't put too much pressure on low-power devices.)

Using multiple threads is a good idea, but be careful not to send many packets to one device at once, because it causes packet loss (because you are using UDP) or overwork of devices with small network capacity.

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

2 participants