Multi Button Relay switch
-
@quocanhcgd Homeseer
I have tested the sketch on vera Ui7 & Homeseer but I don't know why it takes a very long time for the sketch to send individual presentations of the relay to the controller. Sometimes it doesn't send it at all. I have changed power supply as @AWI suggested and the relays are not connected to the Arduino at this time. Still nothing. Anyone here knows what the fail messages are. Below is the serial messages I got....
repeater started, id 2
send: 2-2-0-0 s=255,c=0,t=18,pt=0,l=5,st=fail:1.4.1
send: 2-2-0-0 s=255,c=3,t=6,pt=1,l=1,st=fail:0
send: 2-2-0-0 s=255,c=3,t=11,pt=0,l=16,st=ok:MultiRelayButton
send: 2-2-0-0 s=255,c=3,t=12,pt=0,l=4,st=ok:0.9b
send: 2-2-0-0 s=0,c=1,t=2,pt=2,l=2,st=fail:1
send: 2-2-0-0 s=0,c=0,t=3,pt=0,l=5,st=fail:1.4.1
send: 2-2-0-0 s=1,c=1,t=2,pt=2,l=2,st=fail:1
send: 2-2-0-0 s=1,c=0,t=3,pt=0,l=5,st=fail:1.4.1
send: 2-2-0-0 s=2,c=1,t=2,pt=2,l=2,st=fail:1
send: 2-2-0-0 s=2,c=0,t=3,pt=0,l=5,st=fail:1.4.1
send: 2-2-0-0 s=3,c=1,t=2,pt=2,l=2,st=fail:0
send: 2-2-255-255 s=255,c=3,t=7,pt=0,l=0,st=fail:
send: 2-2-0-0 s=3,c=0,t=3,pt=0,l=5,st=fail:1.4.1 -
I have tested the sketch on vera Ui7 & Homeseer but I don't know why it takes a very long time for the sketch to send individual presentations of the relay to the controller. Sometimes it doesn't send it at all. I have changed power supply as @AWI suggested and the relays are not connected to the Arduino at this time. Still nothing. Anyone here knows what the fail messages are. Below is the serial messages I got....
repeater started, id 2
send: 2-2-0-0 s=255,c=0,t=18,pt=0,l=5,st=fail:1.4.1
send: 2-2-0-0 s=255,c=3,t=6,pt=1,l=1,st=fail:0
send: 2-2-0-0 s=255,c=3,t=11,pt=0,l=16,st=ok:MultiRelayButton
send: 2-2-0-0 s=255,c=3,t=12,pt=0,l=4,st=ok:0.9b
send: 2-2-0-0 s=0,c=1,t=2,pt=2,l=2,st=fail:1
send: 2-2-0-0 s=0,c=0,t=3,pt=0,l=5,st=fail:1.4.1
send: 2-2-0-0 s=1,c=1,t=2,pt=2,l=2,st=fail:1
send: 2-2-0-0 s=1,c=0,t=3,pt=0,l=5,st=fail:1.4.1
send: 2-2-0-0 s=2,c=1,t=2,pt=2,l=2,st=fail:1
send: 2-2-0-0 s=2,c=0,t=3,pt=0,l=5,st=fail:1.4.1
send: 2-2-0-0 s=3,c=1,t=2,pt=2,l=2,st=fail:0
send: 2-2-255-255 s=255,c=3,t=7,pt=0,l=0,st=fail:
send: 2-2-0-0 s=3,c=0,t=3,pt=0,l=5,st=fail:1.4.1 -
@jeylites I would suggest you take a closer look at the hardware. Almost all messages are failing and in most cases radio reception is the cause. Have you used capacitors on the radio's?
-
That there is an issue in the radio communication, and most probably the reason why it's taking so long, as all the failed transmissions will be retransmitted.
Like mentioned above (and on the webpage) you should install the capacitors on the radio.Check the decoupling capacitor part of this page how to do this :
http://www.mysensors.org/build/connect_radio -
Still get the same error message despite putting a 4.7uf cap across GND and VCC (3.3v) on the radio for both sensor and gateway. But I don't get any fail messages using a different My Sensor sketch. What is error message: "st=fail:1.4.1" suggesting?
repeater started, id 1
send: 1-1-0-0 s=255,c=0,t=18,pt=0,l=5,st=ok:1.4.1
send: 1-1-0-0 s=255,c=3,t=6,pt=1,l=1,st=ok:0
read: 0-0-1 s=255,c=3,t=6,pt=0,l=1:M
send: 1-1-0-0 s=255,c=3,t=11,pt=0,l=16,st=ok:MultiRelayButton
send: 1-1-0-0 s=255,c=3,t=12,pt=0,l=4,st=ok:0.9b
send: 1-1-0-0 s=0,c=1,t=2,pt=2,l=2,st=ok:0
send: 1-1-0-0 s=0,c=0,t=3,pt=0,l=5,st=fail:1.4.1
send: 1-1-0-0 s=1,c=1,t=2,pt=2,l=2,st=ok:0
send: 1-1-0-0 s=1,c=0,t=3,pt=0,l=5,st=fail:1.4.1
send: 1-1-0-0 s=2,c=1,t=2,pt=2,l=2,st=ok:0
send: 1-1-0-0 s=2,c=0,t=3,pt=0,l=5,st=ok:1.4.1
send: 1-1-0-0 s=3,c=1,t=2,pt=2,l=2,st=ok:1
send: 1-1-0-0 s=3,c=0,t=3,pt=0,l=5,st=fail:1.4.1
read: 0-0-1 s=2,c=1,t=2,pt=2,l=2:0
This is an ack from gateway -
Still get the same error message despite putting a 4.7uf cap across GND and VCC (3.3v) on the radio for both sensor and gateway. But I don't get any fail messages using a different My Sensor sketch. What is error message: "st=fail:1.4.1" suggesting?
repeater started, id 1
send: 1-1-0-0 s=255,c=0,t=18,pt=0,l=5,st=ok:1.4.1
send: 1-1-0-0 s=255,c=3,t=6,pt=1,l=1,st=ok:0
read: 0-0-1 s=255,c=3,t=6,pt=0,l=1:M
send: 1-1-0-0 s=255,c=3,t=11,pt=0,l=16,st=ok:MultiRelayButton
send: 1-1-0-0 s=255,c=3,t=12,pt=0,l=4,st=ok:0.9b
send: 1-1-0-0 s=0,c=1,t=2,pt=2,l=2,st=ok:0
send: 1-1-0-0 s=0,c=0,t=3,pt=0,l=5,st=fail:1.4.1
send: 1-1-0-0 s=1,c=1,t=2,pt=2,l=2,st=ok:0
send: 1-1-0-0 s=1,c=0,t=3,pt=0,l=5,st=fail:1.4.1
send: 1-1-0-0 s=2,c=1,t=2,pt=2,l=2,st=ok:0
send: 1-1-0-0 s=2,c=0,t=3,pt=0,l=5,st=ok:1.4.1
send: 1-1-0-0 s=3,c=1,t=2,pt=2,l=2,st=ok:1
send: 1-1-0-0 s=3,c=0,t=3,pt=0,l=5,st=fail:1.4.1
read: 0-0-1 s=2,c=1,t=2,pt=2,l=2:0
This is an ack from gateway@jeylites What I read from the log is that there seems to be a little problem with sending a bunch of messages after another. (intermittent failures) probably because the radio power supply is not keeping up. Possible solutions: hardware: increase the capacitor size (eg. 47 uF) ; software: avoid sending messages after another and put a delay in between (like the 250ms delay used in your original setup() code).
Fail:1..4.1 means that something went wrong in communication with MySensors version 1.4.1. The good news is that the number of fail messages is decreasing with respect to the earlier log :clap:
-
@AWI said:
sending messages after another
I have put a 47uf, 100V capacitor in parallel with GND and 3.3V on the radio side and needless to say, it did help in reducing the number of fails. I have yet to receive my 5V to 3.3 radio adapter from China so I'm currently running of a two 1.5Vdc battery wired in series to the NRF radio.
In addition, I've also put a 250ms delay between sending messages after another. With every precaution in place, I'm still getting these same messages. I'm only having this problem with this particular sketch.
repeater started, id 2
send: 2-2-0-0 s=255,c=0,t=18,pt=0,l=5,st=ok:1.4.1
send: 2-2-0-0 s=255,c=3,t=6,pt=1,l=1,st=ok:0
read: 0-0-2 s=255,c=3,t=6,pt=0,l=1:M
send: 2-2-0-0 s=255,c=3,t=11,pt=0,l=16,st=ok:MultiRelayButton
send: 2-2-0-0 s=255,c=3,t=12,pt=0,l=4,st=ok:0.9b
send: 2-2-0-0 s=0,c=1,t=2,pt=2,l=2,st=ok:0
send: 2-2-0-0 s=0,c=0,t=3,pt=0,l=5,st=fail:1.4.1
send: 2-2-0-0 s=1,c=1,t=2,pt=2,l=2,st=ok:0
send: 2-2-0-0 s=1,c=0,t=3,pt=0,l=5,st=fail:1.4.1
send: 2-2-0-0 s=2,c=1,t=2,pt=2,l=2,st=ok:1
send: 2-2-0-0 s=2,c=0,t=3,pt=0,l=5,st=fail:1.4.1
send: 2-2-0-0 s=3,c=1,t=2,pt=2,l=2,st=ok:1
send: 2-2-0-0 s=3,c=0,t=3,pt=0,l=5,st=fail:1.4.1 -
Maybe it worth a try, to remove the ACK requests? Remove the last 'true' from every gw.send line:
gw.send(msg[i].set(Relays[i].relayState? true : false) ) ;Some fake radios don't play well with ACK messages. At least it worked for me.
-
Maybe it worth a try, to remove the ACK requests? Remove the last 'true' from every gw.send line:
gw.send(msg[i].set(Relays[i].relayState? true : false) ) ;Some fake radios don't play well with ACK messages. At least it worked for me.
Ever since I removed ACK & true, I have not been having any fails at all.
Everything works and I have posted the final sketch in Array Relay Button Actuator as linked below... Hope it comes in handy. Thanks again MYS community!
http://forum.mysensors.org/topic/1299/array-relay-button-actuator/12