# GPIOs initialize not as expected

**URL:** <https://discourse.nodered.org/t/gpios-initialize-not-as-expected/59042>\
**Category:** General\
**Created:** [26 February 2022 22:03 UTC](https://discourse.nodered.org/t/gpios-initialize-not-as-expected/59042 "2022-02-26T22:03:56Z")\
**Posts on this page:** 20\
**Page:** 1

<div class="post-metadata">

**Author:** ![Hoinz](https://avatars.discourse-cdn.com/v4/letter/h/f17d59/32.png) [@Hoinz](https://discourse.nodered.org/u/Hoinz)\
**Post date:** [26 February 2022 22:03 UTC](https://discourse.nodered.org/t/gpios-initialize-not-as-expected/59042/1 "2022-02-26T22:03:56Z")

</div>

Hello, All,

kindly asking you for support on this matter:

I have a Raspi3B and Node Red running on it.

2 GPIOs are currently used as input (GPIO 18 and 27) and read the state of 2 water detectors.

These inputs drive a Trigger node which then triggers another GPIO (17) to activate some relays for 1 minute.

 ![grafik](https://us1.discourse-cdn.com/flex026/uploads/nodered/original/3X/0/c/0ce053ade14c0db3377c8527904350d56719d9af.png)

All of the above runs fine, BUT

After each deployment, the relays are triggered once, and it is sure, that this comes from node red, because after a reboot the relays do not activate, but some seconds later they do.

So, each and every tiny change I do in node red and deploy it, makes my family crazy, as they see the alarm flashing, and think there is a real alarm 😉

I checked my GPIO 18 and 27 in detail - they initalize as "0" after reboot.  
In node red, when I debug them, they both show "0" (inside the "rpi-gpio in" Node, I initialized them both as "pull-down")

So, despite they are supposed to be 0, they seem to get a "1" somewhere(obviously very shortly, as the debug node sees them as "0" as expected), so each time node red is started or any changes are deployed, the relay activate erroneously.  
I tried to set the "debounce" value to 1000ms which did not help either.

Any hints about this behavior? Did anyone experience this issue and knows how to avoid this?

Thanks!

Hoinz

---

<div class="post-metadata">

**Author:** ![Andrei](https://sea2.discourse-cdn.com/flex026/user_avatar/discourse.nodered.org/andrei/32/10446_2.png) [@Andrei](https://discourse.nodered.org/u/Andrei)\
**Post date:** [27 February 2022 01:36 UTC](https://discourse.nodered.org/t/gpios-initialize-not-as-expected/59042/2 "2022-02-27T01:36:52Z")

</div>

The relay is ultimately activated by the trigger node. Perhaps it is worth to have a close look on this node. Can you possibly share a screenshot of the trigger node configuration ?

You did well checking the state of GPIOs under initialization. Indeed those two pins are initialized with pull down. [Reference.](https://www.raspberrypi.com/documentation/computers/configuration.html#device-pins-during-boot-sequence)

---

<div class="post-metadata">

**Author:** ![Colin](https://sea2.discourse-cdn.com/flex026/user_avatar/discourse.nodered.org/colin/32/17040_2.png) [@Colin](https://discourse.nodered.org/u/Colin)\
**Post date:** [27 February 2022 07:07 UTC](https://discourse.nodered.org/t/gpios-initialize-not-as-expected/59042/3 "2022-02-27T07:07:21Z")

</div>

Set the debug nodes to output to the console then restart node red in a terminal using  
`node-red-stop`  
`node-red-start`  
And you will see what comes out of the gpio node on startup. Copy/paste the full output log text here if you don't think it is right.

**[Edit]** Also add debug nodes that output to the console on the outputs of the trigger nodes so you can see what is being sent to the relay pins on startup.

---

<div class="post-metadata">

**Author:** ![Hoinz](https://avatars.discourse-cdn.com/v4/letter/h/f17d59/32.png) [@Hoinz](https://discourse.nodered.org/u/Hoinz)\
**Post date:** [27 February 2022 10:54 UTC](https://discourse.nodered.org/t/gpios-initialize-not-as-expected/59042/4 "2022-02-27T10:54:45Z")

</div>

Hello, Andrei,  
thanks for your input.  
I tested the following: I removed the connections between the GPIO-in nodes and the Trigger nodes, but left the other connection between Trigger node and the GPIO-out node(finally the darlington array and the relay bihind).  
After deploying, the relay did NOT activate, no alarm flashing as it did before that change.  
Therefore, I conclude, that in fact, it is not the trigger node which behaves wrongly, or?

---

<div class="post-metadata">

**Author:** ![Hoinz](https://avatars.discourse-cdn.com/v4/letter/h/f17d59/32.png) [@Hoinz](https://discourse.nodered.org/u/Hoinz)\
**Post date:** [27 February 2022 10:59 UTC](https://discourse.nodered.org/t/gpios-initialize-not-as-expected/59042/5 "2022-02-27T10:59:21Z")

</div>

Hello, Colin,  
thank you too for the hints. Unfortunately I failed to follow your instruction. With "Terminal", you mean the putty-console, is that right?  
I clicked "output to console" inside the Debug node.  
But where should the output appear? I tried to find anything in /var/log/syslog, but did not find any related output? (didn't find any sensible /var/log/nodered-\*whatever entry)  
Thanks again for your help.  
Hoinz

---

<div class="post-metadata">

**Author:** ![Colin](https://sea2.discourse-cdn.com/flex026/user_avatar/discourse.nodered.org/colin/32/17040_2.png) [@Colin](https://discourse.nodered.org/u/Colin)\
**Post date:** [27 February 2022 11:23 UTC](https://discourse.nodered.org/t/gpios-initialize-not-as-expected/59042/6 "2022-02-27T11:23:40Z")

</div>

> [@Hoinz](#):
>
> where should the output appear?

When you run  
`node-red-stop`  
`node-red-start`  
The output should appear in the the putty window. If putty-console is how you access the device then yes, in there.

**[Edit]** Also show us how you have configured the Trigger node. You can paste a screenshot here.

---

<div class="post-metadata">

**Author:** ![Hoinz](https://avatars.discourse-cdn.com/v4/letter/h/f17d59/32.png) [@Hoinz](https://discourse.nodered.org/u/Hoinz)\
**Post date:** [27 February 2022 12:00 UTC](https://discourse.nodered.org/t/gpios-initialize-not-as-expected/59042/7 "2022-02-27T12:00:34Z")

</div>

OK, got it now 😉 thanks!

Here is the output of "node-red-start"  
Some statements are in German, I hope its not hiding important information though.

```auto
27 Feb 12:55:48 - [info]

Willkommen bei Node-RED!
===================

27 Feb 12:55:48 - [info] Node-RED Version: v1.1.3
27 Feb 12:55:48 - [info] Node.js Version: v12.22.7
27 Feb 12:55:48 - [info] Linux 5.10.63-v7+ arm LE
27 Feb 12:55:50 - [info] Paletten-Nodes werden geladen
27 Feb 12:55:51 - [debug] Module: node-red-contrib-bme280 1.0.0
27 Feb 12:55:51 - [debug] /home/pi/.node-red/node_modules/node-red-contrib-bme280
27 Feb 12:55:51 - [debug] Module: node-red-contrib-bsb-lan 1.0.1
27 Feb 12:55:51 - [debug] /home/pi/.node-red/node_modules/node-red-contrib-bsb-lan
27 Feb 12:55:51 - [debug] Module: node-red-contrib-device-manager 1.0.4
27 Feb 12:55:51 - [debug] /home/pi/.node-red/node_modules/node-red-contrib-device-manager
27 Feb 12:55:51 - [debug] Module: node-red-contrib-dht-sensor 1.0.4
27 Feb 12:55:51 - [debug] /home/pi/.node-red/node_modules/node-red-contrib-dht-sensor
27 Feb 12:55:51 - [debug] Module: node-red-contrib-heater-controller 1.2.2
27 Feb 12:55:51 - [debug] /home/pi/.node-red/node_modules/node-red-contrib-heater-controller
27 Feb 12:55:51 - [debug] Module: node-red-contrib-hunterio 2.0.1
27 Feb 12:55:51 - [debug] /home/pi/.node-red/node_modules/node-red-contrib-hunterio
27 Feb 12:55:51 - [debug] Module: node-red-contrib-i2c 0.7.5
27 Feb 12:55:51 - [debug] /home/pi/.node-red/node_modules/node-red-contrib-i2c
27 Feb 12:55:51 - [debug] Module: node-red-contrib-knx-easy 0.3.3
27 Feb 12:55:51 - [debug] /home/pi/.node-red/node_modules/node-red-contrib-knx-easy
27 Feb 12:55:51 - [debug] Module: node-red-contrib-knx-ultimate 1.1.82
27 Feb 12:55:51 - [debug] /home/pi/.node-red/node_modules/node-red-contrib-knx-ultimate
27 Feb 12:55:51 - [debug] Module: node-red-contrib-multipart-stream-decoder 0.0.4
27 Feb 12:55:51 - [debug] /home/pi/.node-red/node_modules/node-red-contrib-multipart-stream-decoder
27 Feb 12:55:51 - [debug] Module: node-red-contrib-onvif 1.0.1
27 Feb 12:55:51 - [debug] /home/pi/.node-red/node_modules/node-red-contrib-onvif
27 Feb 12:55:51 - [debug] Module: node-red-contrib-pid 1.1.6
27 Feb 12:55:51 - [debug] /home/pi/.node-red/node_modules/node-red-contrib-pid
27 Feb 12:55:51 - [debug] Module: node-red-contrib-play-audio 2.5.0
27 Feb 12:55:51 - [debug] /home/pi/.node-red/node_modules/node-red-contrib-play-audio
27 Feb 12:55:51 - [debug] Module: node-red-contrib-ramp-thermostat 0.8.2
27 Feb 12:55:51 - [debug] /home/pi/.node-red/node_modules/node-red-contrib-ramp-thermostat
27 Feb 12:55:51 - [debug] Module: node-red-contrib-sensor-htu21d 1.0.1
27 Feb 12:55:51 - [debug] /home/pi/.node-red/node_modules/node-red-contrib-sensor-htu21d
27 Feb 12:55:51 - [debug] Module: node-red-contrib-toggle 0.1.1
27 Feb 12:55:51 - [debug] /home/pi/.node-red/node_modules/node-red-contrib-toggle
27 Feb 12:55:51 - [debug] Module: node-red-contrib-ui-led 0.4.11
27 Feb 12:55:51 - [debug] /home/pi/.node-red/node_modules/node-red-contrib-ui-led
27 Feb 12:55:51 - [debug] Module: node-red-contrib-ui-multistate-switch 1.2.1
27 Feb 12:55:51 - [debug] /home/pi/.node-red/node_modules/node-red-contrib-ui-multistate-switch
27 Feb 12:55:51 - [debug] Module: node-red-contrib-webduino 0.0.15
27 Feb 12:55:51 - [debug] /home/pi/.node-red/node_modules/node-red-contrib-webduino
27 Feb 12:55:51 - [debug] Module: node-red-dashboard 2.23.2
27 Feb 12:55:51 - [debug] /home/pi/.node-red/node_modules/node-red-dashboard
27 Feb 12:55:51 - [debug] Module: node-red-node-email 1.8.0
27 Feb 12:55:51 - [debug] /home/pi/.node-red/node_modules/node-red-node-email
27 Feb 12:55:51 - [debug] Module: node-red-node-pi-gpio 2.0.1
27 Feb 12:55:51 - [debug] /home/pi/.node-red/node_modules/node-red-node-pi-gpio
27 Feb 12:55:51 - [debug] Module: node-red-node-ping 0.2.1
27 Feb 12:55:51 - [debug] /home/pi/.node-red/node_modules/node-red-node-ping
27 Feb 12:55:51 - [debug] Module: node-red-node-random 0.2.0
27 Feb 12:55:51 - [debug] /home/pi/.node-red/node_modules/node-red-node-random
27 Feb 12:55:51 - [debug] Module: node-red-node-serialport 0.11.0
27 Feb 12:55:51 - [debug] /home/pi/.node-red/node_modules/node-red-node-serialport
27 Feb 12:55:51 - [debug] Module: node-red-node-smooth 0.1.2
27 Feb 12:55:51 - [debug] /home/pi/.node-red/node_modules/node-red-node-smooth
27 Feb 12:55:51 - [debug] Module: node-red-node-ui-webcam 0.3.0
27 Feb 12:55:51 - [debug] /home/pi/.node-red/node_modules/node-red-node-ui-webcam
27 Feb 12:55:51 - [debug] Module: red-contrib-shutter-controller 0.1.0
27 Feb 12:55:51 - [debug] /home/pi/.node-red/node_modules/red-contrib-shutter-controller
27 Feb 12:55:51 - [debug] Module: node-red-node-rbe 0.2.9
27 Feb 12:55:51 - [debug] /usr/lib/node_modules/node-red/node_modules/node-red-node-rbe
27 Feb 12:55:51 - [debug] Module: node-red-node-tail 0.1.1
27 Feb 12:55:51 - [debug] /usr/lib/node_modules/node-red/node_modules/node-red-node-tail
[info] "2022-02-27T11:55:54.820Z" 'Loading knx: KNXnet/IP protocol implementation for Node(>=4.x), version: 2.3.3'
[info] "2022-02-27T11:55:56.959Z" 'Loading knxultimate-api: node-red-contrib-KNX-Ultimate KNX API (https://flows.nodered.org/node/node-red-contrib-knx-ultimate), version: 2.3.23'
27 Feb 12:55:57 - [info] Dashboard version 2.23.2 started at /ui
27 Feb 12:55:59 - [info] Einstellungsdatei: /home/pi/.node-red/settings.js
27 Feb 12:55:59 - [info] Kontextspeicher: 'default' [module=memory]
27 Feb 12:55:59 - [info] Benutzerverzeichnis: /home/pi/.node-red
27 Feb 12:55:59 - [warn] Projekte inaktiviert: editorTheme.projects.enabled=false
27 Feb 12:55:59 - [info] Flow-Datei: /home/pi/.node-red/start
27 Feb 12:55:59 - [info] Neue flow-Datei wird erstellt
27 Feb 12:55:59 - [debug] loaded flow revision: d751713988987e9331980363e24189ce
27 Feb 12:55:59 - [debug] red/runtime/nodes/credentials.load : no user key present
27 Feb 12:55:59 - [debug] red/runtime/nodes/credentials.load : using default key
27 Feb 12:55:59 - [debug] red/runtime/nodes/credentials.load : keyType=system
27 Feb 12:55:59 - [warn]

---------------------------------------------------------------------
Die Datei mit den Datenflowberechtigungsnachweisen wird mit einem vom System generierten Schlüssel verschlüsselt.

Wenn der vom System generierte Schlüssel aus irgendeinem Grund verloren geht, werden Ihre Berechtigungsnachweise
Die Datei kann nicht wiederhergestellt werden. Sie müssen sie löschen und erneut eingeben.
Ihre Berechtigungsnachweise.

Sie sollten Ihren eigenen Schlüssel mit Hilfe der Option 'credentialSecret' in
Ihre Einstellungsdatei. Node-RED wird dann Ihre Berechtigungsnachweise erneut verschlüsseln.
Datei mit dem ausgewählten Schlüssel beim nächsten Deployen einer Änderung verwenden.
---------------------------------------------------------------------

27 Feb 12:55:59 - [info] Flows starten
27 Feb 12:55:59 - [debug] red/nodes/flows.start : starting flow : global
27 Feb 12:55:59 - [info] Flows gestartet
27 Feb 12:55:59 - [error] Zuhören auf http://127.0.0.1:1890/ nicht möglich.
27 Feb 12:55:59 - [error] Fehler: Port wird verwendet

```

---

<div class="post-metadata">

**Author:** ![Hoinz](https://avatars.discourse-cdn.com/v4/letter/h/f17d59/32.png) [@Hoinz](https://discourse.nodered.org/u/Hoinz)\
**Post date:** [27 February 2022 12:01 UTC](https://discourse.nodered.org/t/gpios-initialize-not-as-expected/59042/8 "2022-02-27T12:01:26Z")

</div>

And here is the configuration of the Trigger Node:

 ![grafik](https://us1.discourse-cdn.com/flex026/uploads/nodered/original/3X/9/c/9c11f6f032065f6a5e1027c3de6460d08652357c.png)

---

<div class="post-metadata">

**Author:** ![Hoinz](https://avatars.discourse-cdn.com/v4/letter/h/f17d59/32.png) [@Hoinz](https://discourse.nodered.org/u/Hoinz)\
**Post date:** [27 February 2022 12:02 UTC](https://discourse.nodered.org/t/gpios-initialize-not-as-expected/59042/9 "2022-02-27T12:02:28Z")

</div>

The idea of the trigger node was just to avoid an endless alarm. So after 1 Minute it sends "false" to the GPIO-out node to stop the flashing.

---

<div class="post-metadata">

**Author:** ![Hoinz](https://avatars.discourse-cdn.com/v4/letter/h/f17d59/32.png) [@Hoinz](https://discourse.nodered.org/u/Hoinz)\
**Post date:** [27 February 2022 12:12 UTC](https://discourse.nodered.org/t/gpios-initialize-not-as-expected/59042/10 "2022-02-27T12:12:33Z")

</div>

And here is one of the GPIO-in nodes

 ![grafik](https://us1.discourse-cdn.com/flex026/uploads/nodered/original/3X/5/2/524ac9e373095eb89d2c86c96e1b9f04bf3105bb.png)

---

<div class="post-metadata">

**Author:** ![Hoinz](https://avatars.discourse-cdn.com/v4/letter/h/f17d59/32.png) [@Hoinz](https://discourse.nodered.org/u/Hoinz)\
**Post date:** [27 February 2022 12:20 UTC](https://discourse.nodered.org/t/gpios-initialize-not-as-expected/59042/11 "2022-02-27T12:20:28Z")

</div>

GPIO-out configuration:

 ![grafik](https://us1.discourse-cdn.com/flex026/uploads/nodered/original/3X/3/9/3944df41e51ce985b2dad59ef048d6d8d0402b5b.png)

---

<div class="post-metadata">

**Author:** ![Colin](https://sea2.discourse-cdn.com/flex026/user_avatar/discourse.nodered.org/colin/32/17040_2.png) [@Colin](https://discourse.nodered.org/u/Colin)\
**Post date:** [27 February 2022 12:29 UTC](https://discourse.nodered.org/t/gpios-initialize-not-as-expected/59042/12 "2022-02-27T12:29:57Z")

</div>

> [@Hoinz](#):
>
> ` Zuhören auf http://127.0.0.1:1890/ nicht möglich.`

That means that it has not started properly as it cannot gain access to port 1890. That suggests that you already have node-red running. Did you run `node-red-stop` first.

> [@Hoinz](#):
>
> `Flow-Datei: /home/pi/.node-red/start`

I think you ran  
`node-red start`  
not  
`node-red-start`  
It is important to get the details correct.

Is there a reason you are running on a non-standard port?

Looking at your trigger node you have said that when it receives any input (whether it is a 0 or a 1) that it should send true and then false. On startup the gpio pin will send its initial state, so whatever that state is it will always activate the trigger node.

---

<div class="post-metadata">

**Author:** ![edje11](https://sea2.discourse-cdn.com/flex026/user_avatar/discourse.nodered.org/edje11/32/572_2.png) [@edje11](https://discourse.nodered.org/u/edje11)\
**Post date:** [27 February 2022 12:58 UTC](https://discourse.nodered.org/t/gpios-initialize-not-as-expected/59042/13 "2022-02-27T12:58:15Z")

</div>

> [@Hoinz](#):
>
> So, each and every tiny change I do in node red and deploy it, makes my family crazy, as they see the alarm flashing, and think there is a real alarm 😉

Try deploying only the modified nodes.

[![](https://us1.discourse-cdn.com/flex026/uploads/nodered/original/2X/6/6cbf80d4388f57fbd7a24aaaa9d0d8948e2c578e.png) ](https://us1.discourse-cdn.com/flex026/uploads/nodered/original/2X/6/6cbf80d4388f57fbd7a24aaaa9d0d8948e2c578e.png)

---

<div class="post-metadata">

**Author:** ![Colin](https://sea2.discourse-cdn.com/flex026/user_avatar/discourse.nodered.org/colin/32/17040_2.png) [@Colin](https://discourse.nodered.org/u/Colin)\
**Post date:** [27 February 2022 13:22 UTC](https://discourse.nodered.org/t/gpios-initialize-not-as-expected/59042/14 "2022-02-27T13:22:24Z")

</div>

That is a valid point, but it just covers up the fundamental problem, that the relay should not be triggered on startup.

---

<div class="post-metadata">

**Author:** ![Andrei](https://sea2.discourse-cdn.com/flex026/user_avatar/discourse.nodered.org/andrei/32/10446_2.png) [@Andrei](https://discourse.nodered.org/u/Andrei)\
**Post date:** [27 February 2022 19:55 UTC](https://discourse.nodered.org/t/gpios-initialize-not-as-expected/59042/15 "2022-02-27T19:55:54Z")

</div>

Exactly ! I am wondering what could be done do discard that first trigger on startup. 🧐

---

<div class="post-metadata">

**Author:** ![Hoinz](https://avatars.discourse-cdn.com/v4/letter/h/f17d59/32.png) [@Hoinz](https://discourse.nodered.org/u/Hoinz)\
**Post date:** [27 February 2022 20:07 UTC](https://discourse.nodered.org/t/gpios-initialize-not-as-expected/59042/16 "2022-02-27T20:07:05Z")

</div>

> [@Colin](#):
>
> Looking at your trigger node you have said that when it receives any input (whether it is a 0 or a 1) that it should send true and then false. On startup the gpio pin will send its initial state, so whatever that state is it will always activate the trigger node.

OK, this makes perfectly sense then. As the GPIO-in node initializes with 0, this initiates the following nodes. Then I really mis-understood the function of this Trigger node 🫢  
... I thought a "1" is needed to trigger this node.

---

<div class="post-metadata">

**Author:** ![Hoinz](https://avatars.discourse-cdn.com/v4/letter/h/f17d59/32.png) [@Hoinz](https://discourse.nodered.org/u/Hoinz)\
**Post date:** [27 February 2022 20:09 UTC](https://discourse.nodered.org/t/gpios-initialize-not-as-expected/59042/17 "2022-02-27T20:09:50Z")

</div>

> [@Andrei](#):
>
> Exactly ! I am wondering what could be done do discard that first trigger on startup. 🧐

An I am keen on any improving idea aswell ...

---

<div class="post-metadata">

**Author:** ![Andrei](https://sea2.discourse-cdn.com/flex026/user_avatar/discourse.nodered.org/andrei/32/10446_2.png) [@Andrei](https://discourse.nodered.org/u/Andrei)\
**Post date:** [27 February 2022 20:12 UTC](https://discourse.nodered.org/t/gpios-initialize-not-as-expected/59042/18 "2022-02-27T20:12:18Z")

</div>

I am thinking in a "gate" controlled by a context variable. The gate would allow messages only when it is explicitly opened by the logic in your flow. I use this artifact from times to times. I just can´t recall that config right now.

---

<div class="post-metadata">

**Author:** ![Andrei](https://sea2.discourse-cdn.com/flex026/user_avatar/discourse.nodered.org/andrei/32/10446_2.png) [@Andrei](https://discourse.nodered.org/u/Andrei)\
**Post date:** [27 February 2022 20:16 UTC](https://discourse.nodered.org/t/gpios-initialize-not-as-expected/59042/19 "2022-02-27T20:16:42Z")

</div>

Something like this flow or similar... where the gate node would replace of the trigger node in your flow. The switch node(gate) would forward the message when the rule is true. It will only be true when the logic of your flow says so.

```auto
[{"id":"425f1b19.e495e4","type":"inject","z":"a87c60a2.f4723","name":"","repeat":"1","crontab":"","once":false,"onceDelay":0.1,"topic":"","payload":"","payloadType":"date","x":150,"y":240,"wires":[["7d43ff77.ab17a"]]},{"id":"7d43ff77.ab17a","type":"switch","z":"a87c60a2.f4723","name":"gate","property":"gate","propertyType":"flow","rules":[{"t":"true"}],"checkall":"true","repair":false,"outputs":1,"x":330,"y":240,"wires":[["348a76cb.c3f58a"]]},{"id":"d37f58de.700ea8","type":"inject","z":"a87c60a2.f4723","name":"","repeat":"","crontab":"","once":false,"onceDelay":0.1,"topic":"","payload":"true","payloadType":"bool","x":130,"y":120,"wires":[["e52c9aa2.853468"]]},{"id":"24ff0bad.72aaf4","type":"inject","z":"a87c60a2.f4723","name":"","repeat":"","crontab":"","once":false,"onceDelay":0.1,"topic":"","payload":"false","payloadType":"bool","x":130,"y":160,"wires":[["e52c9aa2.853468"]]},{"id":"348a76cb.c3f58a","type":"debug","z":"a87c60a2.f4723","name":"","active":true,"tosidebar":true,"console":true,"tostatus":true,"complete":"payload","x":520,"y":240,"wires":[]},{"id":"e52c9aa2.853468","type":"change","z":"a87c60a2.f4723","name":"","rules":[{"t":"set","p":"gate","pt":"flow","to":"payload","tot":"msg"}],"action":"","property":"","from":"","to":"","reg":false,"x":290,"y":140,"wires":[["72c0c4cf.d5ebec"]]},{"id":"e05c34c2.97e3a8","type":"comment","z":"a87c60a2.f4723","name":"Simple gate using a flow variable","info":"","x":190,"y":60,"wires":[]},{"id":"72c0c4cf.d5ebec","type":"debug","z":"a87c60a2.f4723","name":"","active":true,"tosidebar":true,"console":false,"tostatus":false,"complete":"false","x":530,"y":140,"wires":[]}]

```

---

<div class="post-metadata">

**Author:** ![Colin](https://sea2.discourse-cdn.com/flex026/user_avatar/discourse.nodered.org/colin/32/17040_2.png) [@Colin](https://discourse.nodered.org/u/Colin)\
**Post date:** [27 February 2022 20:20 UTC](https://discourse.nodered.org/t/gpios-initialize-not-as-expected/59042/20 "2022-02-27T20:20:47Z")

</div>

Perhaps all you need is a Switch node before the trigger, configured to only pass payload values of 1.

[Next page](https://discourse.nodered.org/t/gpios-initialize-not-as-expected/59042.md?page=2)
