Didn't know about the delay in older versions - have tried before with smaller values in delay, without success....
with higher values it seems to work (BTW: I'm on 2.13 ...)
Right, the "old state" in setup I had removed - because for my understanding the setup will be called only once - after that the setter / getter.
And yes, this maybe bad for the "flapping" - but it does not help "Flapping" wanted to ignore in this case for shorter code.
Thanks for the hint about the delay value in loop!
Michael
FLiRS - flapping digital pins after wakeup
-
- Posts: 255
- Joined: 26 Jul 2015 17:29
Re: FLiRS - flapping digital pins after wakeup
Glad I could help.
I think you underestimate how many times setup() gets called... it is each time the device wakes up, and there are many reasons. It will wake up, for instance, when you "poll" the device because that is a radio transmission. so that will reset the pins and run setup().
I think you underestimate how many times setup() gets called... it is each time the device wakes up, and there are many reasons. It will wake up, for instance, when you "poll" the device because that is a radio transmission. so that will reset the pins and run setup().
Meet me here: https://forum.fibaro.com/index.php?/pro ... rgebruers/ or here: memberlist.php?mode=viewprofile&u=564463
Re: FLiRS - flapping digital pins after wakeup
Yes, right - but for this test it was not neededpetergebruers wrote: ↑01 May 2018 19:17I think you underestimate how many times setup() gets called... it is each time the device wakes up, and there are many reasons. It will wake up, for instance, when you "poll" the device because that is a radio transmission. so that will reset the pins and run setup().
I know the Z-Uno since the very first beginning
Anyway, I now understand, why my solar based water valve for irrigation is working fine - there is a delay in loop by design
"FLAPPING" is still a problem (for other projects)
Michael
-
- Posts: 255
- Joined: 26 Jul 2015 17:29
Re: FLiRS - flapping digital pins after wakeup
I did not want to insult you... It is difficult to get to know each other from a few posts.
I fully agree, the flapping is an issue! Not for this simple LED, but imagine you want to drive a relay, to switch an appliance...
I would work around it this way: first use a bistable relay with 2 coils. Then connect 3k3 resistors to ground on two output pins. This will make sure reset or wake up does not pull those pins "high". Then use mosfets to drive the 2 relay coils. This device could be battery powered because it only consumes energy when changing state. It is just an idea, I have all the parts but I do not need such a device
I fully agree, the flapping is an issue! Not for this simple LED, but imagine you want to drive a relay, to switch an appliance...
I would work around it this way: first use a bistable relay with 2 coils. Then connect 3k3 resistors to ground on two output pins. This will make sure reset or wake up does not pull those pins "high". Then use mosfets to drive the 2 relay coils. This device could be battery powered because it only consumes energy when changing state. It is just an idea, I have all the parts but I do not need such a device
Meet me here: https://forum.fibaro.com/index.php?/pro ... rgebruers/ or here: memberlist.php?mode=viewprofile&u=564463
Re: FLiRS - flapping digital pins after wakeup
My solar based water valve for irrigation is working is working with such a relay
There are no problems at all.
But I set the pins to LOW again after the delay to save energy - tried at first with wakeUp - but no stable success.
The pin initialisation will be done only if the pin for the coil will be needed - so the "flap" is not a problem.
But I have found pins without this issue (for current firmware) - so it is save.
I will show the project in next days - irrigation will be interesting now for users
Michael
There are no problems at all.
But I set the pins to LOW again after the delay to save energy - tried at first with wakeUp - but no stable success.
The pin initialisation will be done only if the pin for the coil will be needed - so the "flap" is not a problem.
But I have found pins without this issue (for current firmware) - so it is save.
I will show the project in next days - irrigation will be interesting now for users
Michael
-
- Posts: 255
- Joined: 26 Jul 2015 17:29
Re: FLiRS - flapping digital pins after wakeup
Hah! the same relay
Your project sounds interesting. I look forward to see your post!
Your project sounds interesting. I look forward to see your post!
Meet me here: https://forum.fibaro.com/index.php?/pro ... rgebruers/ or here: memberlist.php?mode=viewprofile&u=564463