Hello, thank you for your reply. You are right, it works fine without debug.
Thanks again
Hello, thank you for your reply. You are right, it works fine without debug.
Thanks again
Hello @sundberg84,
I already considered this idea but my node have been running perfectly for two days before failed. So I think, power consideration are not the problem. I can trigg on and off my shutters many and many times without problem.
Hello all,
At the end, I choose to do a software reset every 24 hours. This solution is very bad for me but it works !!
bye
Hello @flopp ,
Sorry I was myself focus on this second problem that's interesting to solve too ?
At the end twice aren't solve !
Hello AWI,
Thanks for your reply, yes my node trigs 5 triacs. I use snubber, regulator, capacitor. And ond the other hand, all commands to the node work properly ? just battery level doesn't work and after several hours NRF24L01 stop to work.
I would like to reset NRF24L01 but with MySensors we don't have direct access to it anymore. Perhaps there is a way to reset the sketch globaly ?
thanks for your help
My real problem is not to send battery level. I try to do that because after 24 or 48 hours my node stop sending messages . So, I hoped that was a way to make it awake !
my loop(){}
// the loop routine runs over and over again forever:
void loop() {
// Process incoming messages (like config from server)
gw.process();
//---------------Lecture des ouvertures de porte------------------
doorOpenOffState = digitalRead(HALLOFFICEDOOR); // lecture à chaque cycle (urgence)
if (doorOpenOffState != doorOpenOffChange){
gw.send(msgDoorOffice.setSensor(OFFICEDOOR).set(doorOpenOffState));
doorOpenOffChange = doorOpenOffState;
}
doorOpenBedState = digitalRead(HALLBEDROOMDOOR); // lecture à chaque cycle (urgence)
if (doorOpenBedState != doorOpenBedChange){
gw.send(msgDoorBedroom.setSensor(BEDROOMDOOR).set(doorOpenBedState));
doorOpenBedChange = doorOpenBedState;
}
if (digitalRead(ECLEXT) != oldInterExt){
oldInterExt = !oldInterExt;
eclState = !eclState;
gw.send(msgLightSwitch.set(eclState));
}
//---------------Envoi du niveau de batterie !! pour rester eveillé------------------
/*if ((millis() - myTime) > 10000) { // toutes les dix secondes
myTime = millis();
gw.sendBatteryLevel(97,1);
} else {
if ((millis() - myTime) < 0) {
myTime = millis();
}
}*/
gw.sendBatteryLevel(97,1);
// ---------------Traitement volet 1-----------------
analogUpV1 = analogRead(UPV1);
if ((analogUpV1 <25) && !manOnV1) { //analogUp proche de zéro et ancienne valeur niveau haut (en l'air)
digitalWrite(TRIAC5, HIGH);
digitalWrite(TRIAC2, LOW);
triacTempoV1 = millis();
triacManPriorityV1 = true;
manOnV1 = true;
memoStopV1 = false;
} else {
analogDownV1 = analogRead(DOWNV1);
if ((analogDownV1 <25) && !manOnV1) { //proche de zéro
digitalWrite(TRIAC5, LOW);
digitalWrite(TRIAC2, HIGH);
triacTempoV1 = millis();
triacManPriorityV1 = true;
manOnV1 = true;
memoStopV1 = false;
} else {
if (analogUpV1 > 800 && analogDownV1 > 800 && !memoStopV1){ // les deux fils en l'air
digitalWrite(TRIAC5, LOW);
digitalWrite(TRIAC2, LOW);
triacManPriorityV1 = false;
manOnV1 = false;
memoStopV1 = true;
} else {
if (!triacManPriorityV1){
if (shutterOff1State && shutterOff2State) {
shutterOff1State = false;
shutterOff2State = false;
digitalWrite(TRIAC5, LOW);
digitalWrite(TRIAC2, LOW);
} else {
if (shutterOff1State) {
shutterOff1State = false;
digitalWrite(TRIAC5, HIGH);
digitalWrite(TRIAC2, LOW);
triacTempoV1 = millis();
} else {
if (shutterOff2State) {
shutterOff2State = false;
digitalWrite(TRIAC5, LOW);
digitalWrite(TRIAC2, HIGH);
triacTempoV1 = millis();
}
}
}
}
}
}
}
if (((triacTempoV1 + TEMPOOPENV1) < millis())) {
digitalWrite(TRIAC5, LOW);
digitalWrite(TRIAC2, LOW);
triacManPriorityV1 = false;
}
// --------------------------Traitement volet 2------------------------
analogUpV2 = analogRead(UPV2);
if ((analogUpV2 <25) && !manOnV2) { //analogUp proche de zéro et ancienne valeur niveau haut (en l'air)
digitalWrite(TRIAC3, HIGH);
digitalWrite(TRIAC4, LOW);
triacTempoV2 = millis();
triacManPriorityV2 = true;
manOnV2 = true;
memoStopV2 = false;
} else {
analogDownV2 = analogRead(DOWNV2);
if ((analogDownV2 <25) && !manOnV2) { //proche de zéro
digitalWrite(TRIAC3, LOW);
digitalWrite(TRIAC4, HIGH);
triacTempoV2 = millis();
triacManPriorityV2 = true;
manOnV2 = true;
memoStopV2 = false;
} else {
if (analogUpV2 > 800 && analogDownV2 > 800 && !memoStopV2){ // les deux fils en l'air
digitalWrite(TRIAC3, LOW);
digitalWrite(TRIAC4, LOW);
//triac3 = false;
//triac4 = false;
triacManPriorityV2 = false;
manOnV2 = false;
memoStopV2 = true;
} else {
if (!triacManPriorityV2){
if (shutterBed1State && shutterBed2State) {
shutterBed1State = false;
shutterBed2State = false;
digitalWrite(TRIAC3, LOW);
digitalWrite(TRIAC4, LOW);
} else {
if (shutterBed1State) {
shutterBed1State = false;
digitalWrite(TRIAC3, HIGH);
digitalWrite(TRIAC4, LOW);
triacTempoV2 = millis();
} else {
if (shutterBed2State) {
shutterBed2State = false;
digitalWrite(TRIAC3, LOW);
digitalWrite(TRIAC4, HIGH);
triacTempoV2 = millis();
}
}
}
}
}
}
}
if (((triacTempoV2 + TEMPOOPENV2) < millis())) {
digitalWrite(TRIAC3, LOW);
digitalWrite(TRIAC4, LOW);
triacManPriorityV2 = false;
}
}
hello,
here is logs from gateway
2;4;1;1;3;70;0;3;0;9;send: 0-0-2-2 s=4,c=1,t=3,pt=0,l=1,sg=0,st=fail:7
Finished
0;0;3;0;18;PINGFinished
2;4;1;1;3;70;0;3;0;9;send: 0-0-2-2 s=4,c=1,t=3,pt=0,l=1,sg=0,st=fail:7
0;0;3;0;9;read: 1-1-0 s=255,c=3,t=0,pt=1,l=1,sg=0:97
0;0;3;0;9;send: 0-0-1-1 s=255,c=3,t=0,pt=1,l=1,sg=0,st=ok:97
1;255;3;0;0;97
Finished
0;0;3;0;18;PING0;0;3;0;9;read: 65-65-0 s=255,c=3,t=0,pt=1,l=1,sg=0:99
0;0;3;0;9;send: 0-0-65-65 s=255,c=3,t=0,pt=1,l=1,sg=0,st=fail:99
65;255;3;0;0;99
0;0;3;0;9;read: 1-1-0 s=255,c=3,t=0,pt=1,l=1,sg=0:97
0;0;3;0;9;send: 0-0-1-1 s=255,c=3,t=0,pt=1,l=1,sg=0,st=ok:97
1;255;3;0;0;97
Finished
Is there a documentation to understand better ?
thanks
hello @AWI,
is there a way to verify if my sensor send a newx value ? because I can't use terminal with debug informations, I use Rx / Tx for an other purpose !
thanks
Hello @flopp,
I'll try this evening to remove all the code but gw.sendbattery...
I think there isn't problem with { or }, perhaps you don't like my way to write code
thanks
hello,
thanks for your answer. For me 97,1 means 97% and acknowledge. And the same code work properly with my other nodes with temperature sensors !
Any other ideas ?