FLiRS - flapping digital pins after wakeup

Discussion about Z-Uno product. Visit http://z-uno.z-wave.me for more details.
michap
Posts: 437
Joined: 26 Mar 2013 10:35
Contact:

Re: FLiRS - flapping digital pins after wakeup

Post by michap »

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
petergebruers
Posts: 255
Joined: 26 Jul 2015 17:29

Re: FLiRS - flapping digital pins after wakeup

Post by petergebruers »

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().
michap
Posts: 437
Joined: 26 Mar 2013 10:35
Contact:

Re: FLiRS - flapping digital pins after wakeup

Post by michap »

petergebruers wrote:
01 May 2018 19:17
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().
Yes, right - but for this test it was not needed ;)
I know the Z-Uno since the very first beginning :D

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
petergebruers
Posts: 255
Joined: 26 Jul 2015 17:29

Re: FLiRS - flapping digital pins after wakeup

Post by petergebruers »

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 :D
michap
Posts: 437
Joined: 26 Mar 2013 10:35
Contact:

Re: FLiRS - flapping digital pins after wakeup

Post by michap »

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
petergebruers
Posts: 255
Joined: 26 Jul 2015 17:29

Re: FLiRS - flapping digital pins after wakeup

Post by petergebruers »

Hah! the same relay :-)

Your project sounds interesting. I look forward to see your post!
Post Reply