pimatic / homeduino

Arduino library for home control
GNU General Public License v3.0
47 stars 40 forks source link

Signal reception after sending #28

Open rspaargaren opened 7 years ago

rspaargaren commented 7 years ago

When I switch a lamp via the homeduino RF module, it sends out the RF signal but also receives the same signal. This can cause a loop in for example the HAP module. Issue #39 knows what is happening here? Hardware or Software related?

14:58:49 debug [pimatic-homeduino]: pir5: { id: 1337110, all: false, presence: false, unit: 1 } 14:58:49 debug [pimatic-homeduino]: switch1: { id: 1337110, all: false, state: false, unit: 1 } 14:58:49 debug [pimatic-homeduino]: received: [ 224, 356, 1244, 2580, 10188 ] 131012101210121012101212101012121010121012101212101210101210121210121012101012101210121210101212101210101210121012101210121012121014 14:58:49 debug [pimatic-homeduino]: data: "RF receive 356 2580 224 1244 10188 0 0 0 010203020302030203020303020203030202030203020303020302020302030302030203020203020302030302020303020302020302030203020302030203030204"

----> Same signal is received another time no manual switching here 2nd time?

14:58:49 debug [pimatic-homeduino]: data: "ACK" 14:58:48 debug [pimatic-homeduino]: Sending Protocol: switch1 id:1337110 unit:1 all:false state:false Pin:4 Repeats:7

--> Switching LAMP OFF (BUT NO MANUAL ACTION HERE 2nd time?)

14:58:48 debug [pimatic-homeduino]: contact1: { id: 1337110, all: false, contact: true, unit: 1 } 14:58:48 debug [pimatic-homeduino]: pir5: { id: 1337110, all: false, presence: false, unit: 1 } 14:58:48 debug [pimatic-hap]: switching device Lamp Televisie to false 14:58:48 debug [pimatic-homeduino]: switch1: { id: 1337110, all: false, state: false, unit: 1 } 14:58:48 debug [pimatic-homeduino]: received: [ 217, 364, 1236, 2568, 10172 ] 131012101210121012101212101012121010121012101212101210101210121210121012101012101210121210101212101210101210121012101210121012121014 14:58:48 debug [pimatic-homeduino]: data: "RF receive 364 2568 217 1236 10172 0 0 0 010203020302030203020303020203030202030203020303020302020302030302030203020203020302030302020303020302020302030203020302030203030204"

----> Same signal is received

14:58:48 debug [pimatic-homeduino]: data: "ACK" 14:58:48 debug [pimatic-homeduino]: Sending Protocol: switch1 id:1337110 unit:1 all:false state:false Pin:4 Repeats:7

_--> Switching LAMP OFF _

14:58:45 warn [pimatic-fritz]: Re-establishing session at http://fritz.box 14:58:45 debug [pimatic-homeduino]: contact1: { id: 1337110, all: false, contact: false, unit: 1 } 14:58:45 debug [pimatic-homeduino]: pir5: { id: 1337110, all: false, presence: true, unit: 1 } 14:58:45 debug [pimatic-homeduino]: switch1: { id: 1337110, all: false, state: true, unit: 1 } 14:58:45 debug [pimatic-homeduino]: received: [ 216, 364, 1237, 2572, 10176 ] 131012101210121012101212101012121010121012101212101210101210121210121012101012101210121210101212101210101210121210101210121012121014 14:58:45 debug [pimatic-homeduino]: data: "RF receive 364 2572 216 1237 10176 0 0 0 010203020302030203020303020203030202030203020303020302020302030302030203020203020302030302020303020302020302030302020302030203030204"

----> Same signal is received as well for second time?

14:58:45 debug [pimatic-homeduino]: data: "ACK" 14:58:44 debug [pimatic-homeduino]: Sending Protocol: switch1 id:1337110 unit:1 all:false state:true Pin:4 Repeats:7

--> Switching LAMP ON 2nd time no manual action here?

14:58:44 debug [pimatic-homeduino]: contact1: { id: 1337110, all: false, contact: false, unit: 1 } 14:58:44 debug [pimatic-homeduino]: pir5: { id: 1337110, all: false, presence: true, unit: 1 } 14:58:44 debug [pimatic-hap]: switching device Lamp Televisie to true 14:58:44 debug [pimatic-homeduino]: switch1: { id: 1337110, all: false, state: true, unit: 1 } 14:58:44 debug [pimatic-homeduino]: received: [ 216, 364, 1236, 2568, 10176 ] 131012101210121012101212101012121010121012101212101210101210121210121012101012101210121210101212101210101210121210101210121012121014 14:58:44 debug [pimatic-homeduino]: data: "RF receive 364 2568 216 1236 10176 0 0 0 010203020302030203020303020203030202030203020303020302020302030302030203020203020302030302020303020302020302030302020302030203030204"

-----> Signal is received

14:58:44 debug [pimatic-homeduino]: data: "ACK" 14:58:43 debug [pimatic-homeduino]: Sending Protocol: switch1 id:1337110 unit:1 all:false state:true Pin:4 Repeats:7

----> Switching LAMP ON

rspaargaren commented 7 years ago

Same test no with HAP disabled, Now there is no ECHO of the ON and OFF swiching....? But the signal is still received after sending.

debug [pimatic-homeduino]: contact1: { id: 1337110, all: false, contact: true, unit: 1 } 15:49:59 debug [pimatic-homeduino]: pir5: { id: 1337110, all: false, presence: false, unit: 1 } 15:49:59 debug [pimatic-homeduino]: switch1: { id: 1337110, all: false, state: false, unit: 1 } 15:49:59 debug [pimatic-homeduino]: received: [ 216, 364, 1236, 2560, 10176 ] 131012101210121012101212101012121010121012101212101210101210121210121012101012101210121210101212101210101210121012101210121012121014 15:49:59 debug [pimatic-homeduino]: data: "RF receive 364 2560 216 1236 10176 0 0 0 010203020302030203020303020203030202030203020303020302020302030302030203020203020302030302020303020302020302030203020302030203030204" ---> And receiving again 15:49:59 debug [pimatic-homeduino]: data: "ACK" 15:49:58 debug [pimatic-homeduino]: Sending Protocol: switch1 id:1337110 unit:1 all:false state:false Pin:4 Repeats:7 --> Second time OFF Switch 15:49:53 debug [pimatic-homeduino]: contact1: { id: 1337110, all: false, contact: false, unit: 1 } 15:49:53 debug [pimatic-homeduino]: pir5: { id: 1337110, all: false, presence: true, unit: 1 } 15:49:53 debug [pimatic-homeduino]: switch1: { id: 1337110, all: false, state: true, unit: 1 } 15:49:53 debug [pimatic-homeduino]: received: [ 215, 365, 1235, 2560, 10176 ] 131012101210121012101212101012121010121012101212101210101210121210121012101012101210121210101212101210101210121210101210121012121014 15:49:53 debug [pimatic-homeduino]: data: "RF receive 365 2560 215 1235 10176 0 0 0 010203020302030203020303020203030202030203020303020302020302030302030203020203020302030302020303020302020302030302020302030203030204" --> Receiving again 15:49:53 debug [pimatic-homeduino]: data: "ACK" 15:49:53 debug [pimatic-homeduino]: Sending Protocol: switch1 id:1337110 unit:1 all:false state:true Pin:4 Repeats:7 -> second try manual ON Switch 15:48:57 debug [pimatic-homeduino]: contact1: { id: 1337110, all: false, contact: true, unit: 1 } 15:48:57 debug [pimatic-homeduino]: pir5: { id: 1337110, all: false, presence: false, unit: 1 } 15:48:57 debug [pimatic-homeduino]: switch1: { id: 1337110, all: false, state: false, unit: 1 } 15:48:56 debug [pimatic-homeduino]: received: [ 214, 365, 1236, 2560, 10176 ] 131012101210121012101212101012121010121012101212101210101210121210121012101012101210121210101212101210101210121012101210121012121014 15:48:56 debug [pimatic-homeduino]: data: "RF receive 365 2560 214 1236 10176 0 0 0 010203020302030203020303020203030202030203020303020302020302030302030203020203020302030302020303020302020302030203020302030203030204" --> And receiving the signal 15:48:56 debug [pimatic-homeduino]: data: "ACK" 15:48:56 debug [pimatic-homeduino]: Sending Protocol: switch1 id:1337110 unit:1 all:false state:false Pin:4 Repeats:7 ---> Switching OFF manually 15:48:50 debug [pimatic-homeduino]: contact1: { id: 1337110, all: false, contact: false, unit: 1 } 15:48:50 debug [pimatic-homeduino]: pir5: { id: 1337110, all: false, presence: true, unit: 1 } 15:48:50 debug [pimatic-homeduino]: switch1: { id: 1337110, all: false, state: true, unit: 1 } 15:48:50 debug [pimatic-homeduino]: received: [ 216, 364, 1236, 2560, 10172 ] 131012101210121012101212101012121010121012101212101210101210121210121012101012101210121210101212101210101210121210101210121012121014 15:48:50 debug [pimatic-homeduino]: data: "RF receive 364 2560 216 1236 10172 0 0 0 010203020302030203020303020203030202030203020303020302020302030302030203020203020302030302020303020302020302030302020302030203030204" --> Receiving the signal again? 15:48:50 debug [pimatic-homeduino]: data: "ACK" 15:48:49 debug [pimatic-homeduino]: Sending Protocol: switch1 id:1337110 unit:1 all:false state:true Pin:4 Repeats:7 ---> Switching ON

rspaargaren commented 7 years ago

More debugging: Now with the recieving part switched off in the config file:

As far as I can see the HAP Plugin does trigger the homeduino module again?

debug [pimatic-homeduino]: data: "ACK" 16:09:09 debug [pimatic-homeduino]: Sending Protocol: switch1 id:43962 unit:9 all:false state:false Pin:4 Repeats:7 --> Switch light OFF Based on HAP Feedback....? 16:09:09 debug [pimatic-hap]: switching device Lamp Kast to false 16:09:09 debug [pimatic-homeduino]: data: "ACK" 16:09:08 debug [pimatic-homeduino]: Sending Protocol: switch1 id:43962 unit:9 all:false state:false Pin:4 Repeats:7 --> Switch Light OFF 16:09:07 debug [pimatic-homeduino]: data: "ACK" 16:09:06 debug [pimatic-homeduino]: Sending Protocol: switch1 id:43962 unit:9 all:false state:true Pin:4 Repeats:7 --> Switch light ON again based on HAP feedback....? 16:09:06 debug [pimatic-hap]: switching device Lamp Kast to true 16:09:06 debug [pimatic-homeduino]: data: "ACK" 16:09:05 debug [pimatic-homeduino]: Sending Protocol: switch1 id:43962 unit:9 all:false state:true Pin:4 Repeats:7 --> Switch light ON

mwittig commented 7 years ago

Which version of pimatic do you use?

rspaargaren commented 7 years ago

Pimatic version is 0.9 and update to the latest version. Pimatic-homeduino: current version is 0.9.9, (which is not the latest according to update) Pimatic-Hap is 0.8 the queue branch for testing purposes

mwittig commented 7 years ago

When I switch a lamp via the homeduino RF module, it sends out the RF signal but also receives the same signal.

I don't think this behaviour is caused by homeduino. I haven't been able to reproduce it, at least. Maybe it is the Switch relaying the message?! Well, rather unlikely as these switch are normally just receiving devices. Do you have a 433 Mhz signal repeater, or may be your neighbour has?

To work-around the issue you can try the following: With pimatic-homeduino 0.9.9 the HomeduinoRFSwitch has an optional forceSend configuration property. Set forceSend to falseand try again. This should avoid the loops. See also https://github.com/pimatic/pimatic-homeduino/blob/v0.9.x/device-config-schema.coffee#L84-L87

rspaargaren commented 7 years ago

To my knowledge there is no repeater here and also not at my neighbours. Otherwise I should most probably also receive other signals from contact multiple times...if they are not fast enough. I have emptied my config file but no help still sending and receiving at the same time....:-( The double sending as one in my earlier post has most probably to do with the HAP plugin.

rspaargaren commented 7 years ago

I have recompiled the latest homeduino sketch and uploaded this to the Nano and it looks like that this has helped...No more receiving after sending. The original sketch has already been there for quite a few version so maybe something has changed? Now we still have the effect that if I switch something within Pimatic the sending gets triggered twice after feedback from the Hap plugin.

mwittig commented 7 years ago

No more receiving after sending.

Great

The original sketch has already been there for quite a few version so maybe something has changed?

I am not sure. Possibly this commit: https://github.com/pimatic/RFControl/commit/3b9cf94f459fc25b4c4065c876399661f2afffdb