Page 1 of 1

Problem with binary after upgrade (beta 3475)

Posted: Monday 26 October 2015 20:58
by SQ9MDD
After latest upgrades i have new option in mysensors called "settings".
But i cant send commands to my binary outputs anymore.
I can see temperature, lux sensors even motion sensors but binary outputs not responding.
Before upgrade, domoticz was send for example:

Code: Select all

11;1;1;0;2;1
11;1;1;0;2;0
And now i get only error:

Code: Select all

Error sending switch command, check device/hardware !
Any idea?

Re: Problem with binary after upgrade (beta 3475)

Posted: Tuesday 27 October 2015 7:14
by gizmocuz
Domoticz is now using the ACK option when sending out binary commands (lights/switches)
This was a request for a long time, and have also been tested, see

viewtopic.php?f=42&t=7839

i have also tested this with a mysensors switch sketch (and serial debug logging), it should work....

Re: Problem with binary after upgrade (beta 3475)

Posted: Tuesday 27 October 2015 8:53
by SQ9MDD
Yeah i'm fixed my sketch and now is working...
I'm glad to see this ACK stuff like an option with checkbox in settings -> hardware tab. It's possible?
Are you planning this for another type of messages? For example HVAC setpoints?

Re: Problem with binary after upgrade (beta 3475)

Posted: Tuesday 27 October 2015 9:29
by gizmocuz
It is also done for setpoints and ir codes, basically all SET commands to a node.
What did you fix in the sketch ? this might help others too

Re: Problem with binary after upgrade (beta 3475)

Posted: Wednesday 28 October 2015 11:14
by newFarmer
Hi,

First thank you all for all the amazing work. I've just started to use domoticz with mysensors on a test environment.

I'm using latest Beta and my switches stopped working returning "Error sending switch command, check device/hardware !" every time I try to change state.

After this i've uploaded the latest GatewaySerial to my arduino UNO thinking that I would fix this (After seeing something about ACK changes). My switches still had the same error.

I've also tried this new change to sketc relaybuttonactuator example trying to define ACK in the present: present(CHILD_ID, S_LIGHT, "Bedroom light", 1);

I can switch the light with the button and it changes the state on the web interface but when i try to change on the web interface the error returns.

All my other sensors are reporting correct values.

Can you please help me?

Here is a log.

Code: Select all

Starting...
send: 3-3-1-0 s=255,c=0,t=18,pt=0,l=3,sg=0,st=ok:1.6
send: 3-3-1-0 s=255,c=3,t=6,pt=1,l=1,sg=0,st=ok:1
send: 3-3-1-0 s=255,c=3,t=11,pt=0,l=16,sg=0,st=ok:Relay Bedroom
send: 3-3-1-0 s=255,c=3,t=12,pt=0,l=3,sg=0,st=ok:1.0
send: 3-3-1-0 s=1,c=0,t=3,pt=0,l=21,sg=0,st=ok:Bedroom light
repeater started, id=3, parent=1, distance=2
read: 0-1-3 s=1,c=0,t=3,pt=0,l=21,sg=0:Bedroom light
This is an ack from gateway
send: 3-3-1-0 s=1,c=1,t=2,pt=2,l=2,sg=0,st=ok:0
read: 0-1-3 s=1,c=1,t=2,pt=2,l=2,sg=0:0
This is an ack from gateway
Incoming change for sensor:1, New status: 0
send: 3-3-1-0 s=1,c=1,t=2,pt=2,l=2,sg=0,st=ok:1
read: 0-1-3 s=1,c=1,t=2,pt=2,l=2,sg=0:1
This is an ack from gateway
Incoming change for sensor:1, New status: 1
read: 0-1-3 s=1,c=1,t=2,pt=0,l=1,sg=0:0
send: 3-3-1-0 s=1,c=1,t=2,pt=0,l=1,sg=0,st=ok:0
Incoming change for sensor:1, New status: 0
send: 3-3-1-0 s=1,c=1,t=2,pt=2,l=2,sg=0,st=ok:1
read: 0-1-3 s=1,c=1,t=2,pt=2,l=2,sg=0:1
This is an ack from gateway
Incoming change for sensor:1, New status: 1
read: 0-1-3 s=1,c=1,t=2,pt=0,l=1,sg=0:0
send: 3-3-1-0 s=1,c=1,t=2,pt=0,l=1,sg=0,st=ok:0
Incoming change for sensor:1, New status: 0
send: 3-3-1-0 s=1,c=1,t=2,pt=2,l=2,sg=0,st=fail:1
send: 3-3-1-0 s=1,c=1,t=2,pt=2,l=2,sg=0,st=fail:1
 

Re: Problem with binary after upgrade (beta 3475)

Posted: Wednesday 28 October 2015 11:52
by NewFolk
Are youe node on 1.5 ?

Could you post log from GW?

Code: Select all

repeater started
It`s look like you node is repeater. And mb in this case it does not return ACK.
If i don`t mistake mysensors library does not recommend to use repeater as node, atm.

It looks like it is not domoticz issue. Post this on mysensors forum.

Re: Problem with binary after upgrade (beta 3475)

Posted: Wednesday 28 October 2015 14:52
by newFarmer
Thanks.

I will try to remove the repeater and also change present(CHILD_ID, S_LIGHT, "Bedroom light", 1) to present(CHILD_ID, S_LIGHT, "Bedroom light", true)

Also will move to mysensors forum if not solved ;)

Re: Problem with binary after upgrade (beta 3475)

Posted: Wednesday 28 October 2015 15:52
by newFarmer
Ok I've removed the repeater.

Gateway response when i press switch button is

(clicking on button once)
Gateway

Code: Select all

0;0;3;0;9;read: 3-1-0 s=1,c=1,t=2,pt=2,l=2,sg=0:0
0;0;3;0;9;send: 0-0-1-3 s=1,c=1,t=2,pt=2,l=2,sg=0,st=ok:0
3;1;1;0;2;0
Node:

Code: Select all

send: 3-3-1-0 s=1,c=1,t=2,pt=2,l=2,sg=0,st=ok:0
read: 0-1-3 s=1,c=1,t=2,pt=2,l=2,sg=0:0
This is an ack from gateway
Incoming change for sensor:1, New status: 0
Clicking on button to again:
Gateway:

Code: Select all

0;0;3;0;9;read: 3-1-0 s=1,c=1,t=2,pt=2,l=2,sg=0:1
0;0;3;0;9;send: 0-0-1-3 s=1,c=1,t=2,pt=2,l=2,sg=0,st=ok:1
3;1;1;0;2;1
node:

Code: Select all

send: 3-3-1-0 s=1,c=1,t=2,pt=2,l=2,sg=0,st=ok:1
read: 0-1-3 s=1,c=1,t=2,pt=2,l=2,sg=0:1
This is an ack from gateway
Incoming change for sensor:1, New status: 1
Everything works fine. Light status is also updated on domoticz interface.

Clicking on the interface:
Gateway:

Code: Select all

0;0;3;0;9;send: 0-0-1-3 s=1,c=1,t=2,pt=0,l=1,sg=0,st=ok:0
0;0;3;0;9;read: 3-1-0 s=1,c=1,t=2,pt=0,l=1,sg=0:0
3;1;1;1;2;0
Node:

Code: Select all

read: 0-1-3 s=1,c=1,t=2,pt=0,l=1,sg=0:0
send: 3-3-1-0 s=1,c=1,t=2,pt=0,l=1,sg=0,st=ok:0
Incoming change for sensor:1, New status: 0
And error on web interface :(

Re: Problem with binary after upgrade (beta 3475)

Posted: Wednesday 28 October 2015 20:07
by SQ9MDD
gizmocuz wrote:It is also done for setpoints and ir codes, basically all SET commands to a node.
What did you fix in the sketch ? this might help others too
Thanx for answer Gizmocuz, and sorry for long delay... (job related issue).
I'm using rs485 and serial protocoll without gateway. (I hate radio solutions)
But if this can help, i can upload my code to the github. But i need to learn about. ;)

You can find my battle with code here: https://github.com/SQ9MDD/MDD665

Re: Problem with binary after upgrade (beta 3475)

Posted: Wednesday 28 October 2015 21:26
by NewFolk
newFarmer wrote: Clicking on the interface:
Gateway:

Code: Select all

0;0;3;0;9;send: 0-0-1-3 s=1,c=1,t=2,pt=0,l=1,sg=0,st=ok:0
0;0;3;0;9;read: 3-1-0 s=1,c=1,t=2,pt=0,l=1,sg=0:0
3;1;1;1;2;0
Node:

Code: Select all

read: 0-1-3 s=1,c=1,t=2,pt=0,l=1,sg=0:0
send: 3-3-1-0 s=1,c=1,t=2,pt=0,l=1,sg=0,st=ok:0
Incoming change for sensor:1, New status: 0
And error on web interface :(
As i can see node get new status and change the state ?
So the problem is only in domoticz error msg ?

it could happen in two cases
1) Deference between send and read on the GW more than 1200 sec. Could measure the time?

2) Another way it is a bug in domoticz. But I don`t see any.

Re: Problem with binary after upgrade (beta 3475)

Posted: Wednesday 28 October 2015 21:48
by newFarmer
Hi NewFolk, Thanks for all your replies :)
As i can see node get new status and change the state ?
Node only changes state the first time, and only when it's on ON state. After error on the interface nothing happens.

So the problem is only in domoticz error msg ?
Yes. the button i have attached to the arduino works fine. Even if I unplug gateway from the raspberry, the button works fine. Only have issues on the web interface.

it could happen in two cases
1) Deference between send and read on the GW more than 1200 sec. Could measure the time?
I didn't measure it but It's almost instantly. I'm also testing the node and gateway on the same room to avoid communication issues.
2) Another way it is a bug in domoticz. But I don`t see any.
I will try to re install domoticz and see of the error goes away ;)

Thanks again for all your help and suggestions. I wil post an update as soon as I get the domoticz refreshed :ugeek:

Re: Problem with binary after upgrade (beta 3475)

Posted: Wednesday 28 October 2015 21:59
by NewFolk
As i can see node get new status and change the state ?
Node only changes state the first time, and only when it's on ON state. After error on the interface nothing happens.
I don`t understand you. :(
When you press button in Domoticz, did node change state ?
If i don`t mistake it should.
GW send - node read - node send (Change here) - GW read.

Gateway:
1)0;0;3;0;9;send: 0-0-1-3 s=1,c=1,t=2,pt=0,l=1,sg=0,st=ok:0
4)0;0;3;0;9;read: 3-1-0 s=1,c=1,t=2,pt=0,l=1,sg=0:0
3;1;1;1;2;0

Node:
2)read: 0-1-3 s=1,c=1,t=2,pt=0,l=1,sg=0:0
3)send: 3-3-1-0 s=1,c=1,t=2,pt=0,l=1,sg=0,st=ok:0
Incoming change for sensor:1, New status: 0


So the problem is only in domoticz error msg ?
Yes. the button i have attached to the arduino works fine. Even if I unplug gateway from the raspberry, the button works fine. Only have issues on the web interface.
That`s strange, node should not work without GW+controller. Except some info in EEPROM

Try to erase EEPROM.

Your case is really strange.

Re: Problem with binary after upgrade (beta 3475)

Posted: Wednesday 28 October 2015 22:38
by newFarmer
NewFolk wrote: I don`t understand you. :(
When you press button in Domoticz, did node change state ?
Yes. it's like this. I restart the node and press on the arduino button to switch the relay. Works great. Sometimes the node status is updated in domoticz when i'm pressing arduino button (still trying to find when and what's happening ) and sometimes it doesn't.

Then i try to do the same with web interface.
First time i do it it changes the relay state but when it's going to update the state on the web interface the error is thrown and no update is made on domoticz. After that i can change state on the arduino button but I can't change state on the web interface (in fact i can, i've just have to press the arduino button to match the same state of the web interface and then when i press the button on web interface same thing as described occurs).

That`s strange, node should not work without GW+controller. Except some info in EEPROM

Try to erase EEPROM.

Your case is really strange.
I will try to do that later. Still not able to try it out. I've updated domoticz to latest release a few minutes ago and the error is still present.

I will also try to change the MyMessage msg(CHILD_ID,V_LIGHT); to MyMessage msg(CHILD_ID,V_STATUS);

Build Changes:
"- Implemented: MySensors, renamed V_LIGHT to V_STATUS and V_DIMMER to V_PERCENTAGE to be compliant to the 1.5 API "

Re: Problem with binary after upgrade (beta 3475)

Posted: Thursday 29 October 2015 21:53
by newFarmer
Today i've tried to revert the domoticz to stable version. Everything worked as expected.

If i update to Beta, i cannot switch my relays :(

I think there might be a bug. Can anyone reproduce this bug?

Arduino mysensors: Latest on githug (1.6) (GatewaySerial.ino without modifications on a arduino uno, node with relaywithactuactor.ino example on mysensors folder)
Domoticz: V2.3493

Re: Problem with binary after upgrade (beta 3475)

Posted: Thursday 29 October 2015 22:12
by newFarmer
Even stranger. If i add the relay to a scene i can switch on and off without any issues.

Lua Script can also change them on or off but it does not change the state on DB (i have to press the button attached on my arduino so that the state change can be acknowledge by domoticz and then the script works again)

No error on the log

These are the responses:

Code: Select all

http://192.168.x.x/json.htm?type=command&param=switchlight&idx=23&switchcmd=On&level=0&passcode=
{
   "message" : "Error sending switch command, check device/hardware !",
   "status" : "ERROR",
   "title" : "SwitchLight"
}

Code: Select all


http://192.168.x.x/json.htm?type=command&param=switchscene&idx=1&switchcmd=Off&passcode=

{
   "status" : "OK",
   "title" : "SwitchScene"
}

Re: Problem with binary after upgrade (beta 3475)

Posted: Friday 30 October 2015 20:35
by newFarmer
Re-installed beta and everything works as expected :D Thank you all for your replies ;)

Re: Problem with binary after upgrade (beta 3475)

Posted: Monday 09 November 2015 8:18
by SQ9MDD
SQ9MDD wrote: I'm glad to see this ACK stuff like an option with checkbox in settings -> hardware tab. It's possible?

Code: Select all

Commits on Nov 9, 2015 
Implemented: MySensors, Option to Enable/Disable using ACK per Child sensor from the MySensors hardware setup page
Gizmocuz you are great!

EDIT:


One question about, how it works?
I'm changing option, setting ack checkbox off then update and see is still true not false.


Second Edit


I can change UseAck field in database manually (0 or 1), but my old node not working still (cant see why because is in my sister house 300km away).
From gui side i can change ack from false to true but from true to false not.