Hey !
I have a problem with receiving from the controller Domoticz (V2.3799) the V_DISTANCE by gw.request()
MySensors is 1.5 - Latest Release.
I wrote a short test program that shows a problem.
#include <SPI.h>
#include <MySensor.h>
#define CHILD_ID 1 // Id of the sensor child
MySensor gw;
MyMessage msg(CHILD_ID, V_DISTANCE);
MyMessage msg2(CHILD_ID, V_VAR1);
unsigned long SEND_FREQUENCY = 3000; // 1 sekunda = 1000;
void setup()
{
gw.begin(incomingMessage);
gw.sendSketchInfo("Test", "1.1");
gw.present(CHILD_ID, S_DISTANCE);
}
void loop()
{
gw.process();
gw.request(CHILD_ID, V_DISTANCE, 0);
gw.request(CHILD_ID, V_VAR1, 0);
delay(2000);
gw.send(msg.set(0));
delay(2000);
gw.send(msg2.set(1));
delay(2000);
gw.sleep(SEND_FREQUENCY);
}
void incomingMessage(const MyMessage &message) {
if (message.type == V_VAR1) {
Serial.println("Received V_VAR1 from gw ");
}
if (message.type == V_DISTANCE) {
Serial.println("Received V_DISTANCE from gw ");
}
Serial.println("incomingMessage");
}
I do not know why I get message for V_VAR1 and didnt get for V_DISTANCE. ?
And short LOG from my node here:
Opening port
Port open
find parent
send: 255-255-255-255 s=255,c=3,t=7,pt=0,l=0,sg=0,st=bc:
read: 0-0-255 s=255,c=3,t=8,pt=1,l=1,sg=0:0
parent=0, d=1
req id
send: 255-255-0-0 s=255,c=3,t=3,pt=0,l=0,sg=0,st=ok:
read: 0-0-255 s=255,c=3,t=4,pt=0,l=2,sg=0:20
send: 20-20-0-0 s=255,c=0,t=17,pt=0,l=3,sg=0,st=fail:1.5
send: 20-20-0-0 s=255,c=3,t=6,pt=1,l=1,sg=0,st=ok:0
read: 0-0-20 s=255,c=3,t=6,pt=0,l=1,sg=0:M
id=20
send: 20-20-0-0 s=255,c=0,t=17,pt=0,l=3,sg=0,st=ok:1.5
send: 20-20-0-0 s=255,c=3,t=6,pt=1,l=1,sg=0,st=ok:0
read: 0-0-20 s=255,c=3,t=6,pt=0,l=1,sg=0:M
sensor started, id=20, parent=0, distance=1
send: 20-20-0-0 s=255,c=3,t=11,pt=0,l=4,sg=0,st=ok:Test
send: 20-20-0-0 s=255,c=3,t=12,pt=0,l=3,sg=0,st=ok:1.1
send: 20-20-0-0 s=1,c=0,t=15,pt=0,l=0,sg=0,st=ok:
send: 20-20-0-0 s=1,c=2,t=13,pt=0,l=0,sg=0,st=ok:
send: 20-20-0-0 s=1,c=2,t=24,pt=0,l=0,sg=0,st=ok:
send: 20-20-0-0 s=1,c=1,t=13,pt=2,l=2,sg=0,st=ok:0
send: 20-20-0-0 s=1,c=1,t=24,pt=2,l=2,sg=0,st=ok:1
read: 0-0-20 s=1,c=2,t=24,pt=0,l=0,sg=0:
Received V_VAR1 from gw
incomingMessage
send: 20-20-0-0 s=1,c=2,t=13,pt=0,l=0,sg=0,st=ok:
send: 20-20-0-0 s=1,c=2,t=24,pt=0,l=0,sg=0,st=ok:
send: 20-20-0-0 s=1,c=1,t=13,pt=2,l=2,sg=0,st=ok:0
send: 20-20-0-0 s=1,c=1,t=24,pt=2,l=2,sg=0,st=ok:1
read: 0-0-20 s=1,c=2,t=24,pt=0,l=1,sg=0:1
Received V_VAR1 from gw
incomingMessage
send: 20-20-0-0 s=1,c=2,t=13,pt=0,l=0,sg=0,st=ok:
send: 20-20-0-0 s=1,c=2,t=24,pt=0,l=0,sg=0,st=ok:
send: 20-20-0-0 s=1,c=1,t=13,pt=2,l=2,sg=0,st=ok:0
send: 20-20-0-0 s=1,c=1,t=24,pt=2,l=2,sg=0,st=ok:1
Port closed
I dont know why i get only message for V_VAR1 and I didnt get for V_DISTANCE. ?