Issue - Update device from api

Discussions about RaZberry - Z-Wave board for Raspberry computer
Isaksson
Posts: 133
Joined: 10 Apr 2013 09:43

Re: Issue - Update device from api

Post by Isaksson »

I have not heard anything about this?
Is someone working with this issue?
User avatar
PoltoS
Posts: 7571
Joined: 26 Jan 2011 19:36

Re: Issue - Update device from api

Post by PoltoS »

There is nothing to fix here - if you poll updates from Z-Way, you can loose changes that are faster than polling period. If you need instant update - use push methods like websocket.

Or I did missed something.
Isaksson
Posts: 133
Joined: 10 Apr 2013 09:43

Re: Issue - Update device from api

Post by Isaksson »

Yes i think you did :)

This is not me reading data from Zway - iam sending data.
Its not possible to send several Updates to /ZAutomation/api/v1/ at the same time.

example, its not possible to update two dummy devices at the same time from external system, this means that you have to handle this on the send part with delays and things like that, this should be handled on the receive part asynchronous.
Now it seems to be synchronous and block incoming requests while it handle the current one.
User avatar
PoltoS
Posts: 7571
Joined: 26 Jan 2011 19:36

Re: Issue - Update device from api

Post by PoltoS »

Now got you. Yes, v8 is synchronous - no way to fix this at all. But why doesn't they work one after another. The processing is so fast that sync way should not be visible.
Isaksson
Posts: 133
Joined: 10 Apr 2013 09:43

Re: Issue - Update device from api

Post by Isaksson »

We are talking about a delay over 1 second to be sure that it will process the next http request.
And this ofcource is causing a lote of issue with lost information between the systems.

I think that you should at least take a look at this, i thing there could still be some sort of bug causing this.
Isaksson
Posts: 133
Joined: 10 Apr 2013 09:43

Re: Issue - Update device from api

Post by Isaksson »

Same issue verified on Version 2.1.1 i dont think this is a V8 issue must be something in zway and how it handles incomming requests.
Isaksson
Posts: 133
Joined: 10 Apr 2013 09:43

Re: Issue - Update device from api

Post by Isaksson »

I have now made some more tests and this is absolutely not V8 issue.

This is how i made the test and the result:

I created 3 dummy devices added them to a dummy room with anonymous access.

In external program i added 3 web requests to the dummy devices
http://ip:8083/ZAutomation/api/v1/devic ... command/on
http://ip:8083/ZAutomation/api/v1/devic ... command/on
http://ip:8083/ZAutomation/api/v1/devic ... command/on

And if i send this 3 at the same time all dummy devices get turned on so the issue is not sending several request at once but, the issue is if i try to send command Off right after i have sent On then the system does not change the state of the dummy device.

Reproduce it like this.

Send request to http://ip:8083/ZAutomation/api/v1/devic ... command/on
dummy devices state change to On
wait 0.1 second
Send request to http://ip:8083/ZAutomation/api/v1/devic ... ommand/off
dummy device does not change state to Off

Working scenario:

Send request to http://ip:8083/ZAutomation/api/v1/devic ... command/on
dummy devices state change to On
wait 2 second
Send request to http://ip:8083/ZAutomation/api/v1/devic ... ommand/off
dummy devices state change to Off
User avatar
PoltoS
Posts: 7571
Joined: 26 Jan 2011 19:36

Re: Issue - Update device from api

Post by PoltoS »

I don't get. I tried this:
wget http://192.168.0.32:8083/ZAutomation/ap ... ommand/off;
wget http://192.168.0.32:8083/ZAutomation/ap ... command/on;
right in shell and light turned off and on - no problems;

Even:
wget http://192.168.0.32:8083/ZAutomation/ap ... ommand/off &
wget http://192.168.0.32:8083/ZAutomation/ap ... command/on
works ok (first works in background, so they are simultaneous).

May be you can run debugger and see who is occupying you for 1 second?
Isaksson
Posts: 133
Joined: 10 Apr 2013 09:43

Re: Issue - Update device from api

Post by Isaksson »

Hello.
Thanks for the test, this is working for me also, i have no problems with "real" device, but please make the same test with a dummydevice.
Isaksson
Posts: 133
Joined: 10 Apr 2013 09:43

Re: Issue - Update device from api

Post by Isaksson »

I would appreciate if someone would be able to verify this potential bug in your own systems.
I have tried it on both my production and development systems and same result on both.
Remember that this affects dummy devices, not real z-wave devices.
Post Reply