How to read the previous state of the pins after restart or deploy on raspberry

After deploy output pin change state. Why?
How to make sure this doesn't happen


After deploy.

[{"id":"7bbf6c01.b26624","type":"tab","label":"Flow 1","disabled":false,"info":""},{"id":"407a809e.71686","type":"rpi-gpio in","z":"7bbf6c01.b26624","name":"","pin":"37","intype":"up","debounce":"25","read":false,"x":140,"y":140,"wires":[["384d8adf.464636"]]},{"id":"5efa9c17.e96944","type":"rpi-gpio in","z":"7bbf6c01.b26624","name":"","pin":"35","intype":"up","debounce":"25","read":false,"x":140,"y":200,"wires":[["384d8adf.464636"]]},{"id":"db5c91e3.4380c","type":"function","z":"7bbf6c01.b26624","name":"","func":"if (msg.payload[\"pi/35\"] == 1 && msg.payload[\"pi/37\"] == 1){\nmsg.payload = 1;\nreturn msg;\n}\nelse{\n msg.payload = 0;\nreturn msg;\n}\n\n ","outputs":1,"noerr":0,"x":490,"y":140,"wires":[["8c2e7942.8a9ef8","943f9a00.b4e478"]]},{"id":"8c2e7942.8a9ef8","type":"debug","z":"7bbf6c01.b26624","name":"","active":true,"tosidebar":true,"console":false,"tostatus":false,"complete":"payload","targetType":"msg","x":650,"y":140,"wires":[]},{"id":"384d8adf.464636","type":"join","z":"7bbf6c01.b26624","name":"test","mode":"custom","build":"object","property":"payload","propertyType":"msg","key":"topic","joiner":"\\n","joinerType":"str","accumulate":true,"timeout":"","count":"2","reduceRight":false,"reduceExp":"","reduceInit":"1","reduceInitType":"num","reduceFixup":"","x":330,"y":140,"wires":[["11365f4b.9ab771","db5c91e3.4380c"]]},{"id":"11365f4b.9ab771","type":"debug","z":"7bbf6c01.b26624","name":"","active":true,"tosidebar":true,"console":false,"tostatus":false,"complete":"payload","targetType":"msg","x":410,"y":220,"wires":[]},{"id":"943f9a00.b4e478","type":"rpi-gpio out","z":"7bbf6c01.b26624","name":"","pin":"33","set":true,"level":"0","freq":"","out":"out","x":640,"y":180,"wires":[]}]

you have set the out pin to set itself to 0 - so it has done as you asked...

And on the input side you haven't told the pins to do an initial read... so they haven't...

After deploy, condition in a function is not true
input pins is 1 but output pin is 0.
diference between pics.
differentiation between pics.

In the GPIO-out node, you initialize the pin to '0'.

Screen Shot 2020-02-03 at 8.48.59 AM
Untill you pass some msg's thru the flow, that is what it till be.

Read initial state of pin on deploy/restart?
No one to read this !!! Thanks.
I fill checkbox before Read initial state of pin on deploy/restart? and everything is ok.

This topic was automatically closed 14 days after the last reply. New replies are no longer allowed.