# Raspberry Pi Led turns on on every deployment

**URL:** <https://discourse.nodered.org/t/raspberry-pi-led-turns-on-on-every-deployment/22478>\
**Category:** General\
**Created:** [2 March 2020 08:16 UTC](https://discourse.nodered.org/t/raspberry-pi-led-turns-on-on-every-deployment/22478 "2020-03-02T08:16:21Z")\
**Posts on this page:** 8\
**Page:** 1

<div class="post-metadata">

**Author:** ![Furkanos](https://avatars.discourse-cdn.com/v4/letter/f/bbce88/32.png) [@Furkanos](https://discourse.nodered.org/u/Furkanos)\
**Post date:** [2 March 2020 08:16 UTC](https://discourse.nodered.org/t/raspberry-pi-led-turns-on-on-every-deployment/22478/1 "2020-03-02T08:16:21Z")

</div>

Hey

i started to work with node-red on a raspberry and for tests i just conneted an LED. My goal is to send a value through a switch button with a broker to the node red on the raspberry. It works perfectly but every time i add something on the flow of my raspberry the led turns on automaticly even if the switch is still turned off.

---

<div class="post-metadata">

**Author:** ![cymplecy](https://sea2.discourse-cdn.com/flex026/user_avatar/discourse.nodered.org/cymplecy/32/2773_2.png) [@cymplecy](https://discourse.nodered.org/u/cymplecy)\
**Post date:** [2 March 2020 08:20 UTC](https://discourse.nodered.org/t/raspberry-pi-led-turns-on-on-every-deployment/22478/2 "2020-03-02T08:20:40Z")

</div>

Hi and weclome to the forum

Can you paste your flow here for us to look at?

---

<div class="post-metadata">

**Author:** ![Furkanos](https://avatars.discourse-cdn.com/v4/letter/f/bbce88/32.png) [@Furkanos](https://discourse.nodered.org/u/Furkanos)\
**Post date:** [2 March 2020 08:25 UTC](https://discourse.nodered.org/t/raspberry-pi-led-turns-on-on-every-deployment/22478/3 "2020-03-02T08:25:01Z")

</div>

![image](https://us1.discourse-cdn.com/flex026/uploads/nodered/original/3X/b/b/bb69b41127c66c8c58feb05c4b1dbe3b8b923196.png)

its basically just this on my flow on my pc with default setting switch on true value switch off false value. On the raspbarry its just an mqtt out connected to a pin

---

<div class="post-metadata">

**Author:** ![kuema](https://sea2.discourse-cdn.com/flex026/user_avatar/discourse.nodered.org/kuema/32/6542_2.png) [@kuema](https://discourse.nodered.org/u/kuema)\
**Post date:** [2 March 2020 08:33 UTC](https://discourse.nodered.org/t/raspberry-pi-led-turns-on-on-every-deployment/22478/4 "2020-03-02T08:33:00Z")

</div>

Which deploy mode are you using? If using "Full" deploy, every node will get restarted, even if they are unchanged.

![image](https://us1.discourse-cdn.com/flex026/uploads/nodered/original/3X/a/e/aeb186f98875cb43c23f5e05310b6ff6fb94f0a8.png)

---

<div class="post-metadata">

**Author:** ![Furkanos](https://avatars.discourse-cdn.com/v4/letter/f/bbce88/32.png) [@Furkanos](https://discourse.nodered.org/u/Furkanos)\
**Post date:** [2 March 2020 08:35 UTC](https://discourse.nodered.org/t/raspberry-pi-led-turns-on-on-every-deployment/22478/5 "2020-03-02T08:35:22Z")

</div>

yes that was it thanks

---

<div class="post-metadata">

**Author:** ![kuema](https://sea2.discourse-cdn.com/flex026/user_avatar/discourse.nodered.org/kuema/32/6542_2.png) [@kuema](https://discourse.nodered.org/u/kuema)\
**Post date:** [2 March 2020 08:38 UTC](https://discourse.nodered.org/t/raspberry-pi-led-turns-on-on-every-deployment/22478/6 "2020-03-02T08:38:50Z")

</div>

You're welcome!

The "Modified Nodes" mode should be sufficient most of the time.

---

<div class="post-metadata">

**Author:** ![cymplecy](https://sea2.discourse-cdn.com/flex026/user_avatar/discourse.nodered.org/cymplecy/32/2773_2.png) [@cymplecy](https://discourse.nodered.org/u/cymplecy)\
**Post date:** [2 March 2020 08:47 UTC](https://discourse.nodered.org/t/raspberry-pi-led-turns-on-on-every-deployment/22478/7 "2020-03-02T08:47:26Z")

</div>

You might want to consider setting your MQTT out node to retain the message. That way - your receiving MQTT node on your Pi, should always track the last state of your switch

---

<div class="post-metadata">

**Author:** ![system](https://us1.discourse-cdn.com/flex026/uploads/nodered/original/1X/d073cd938eafa2e558d7c2cd59003b3ef4963033.png) [@system](https://discourse.nodered.org/u/system)\
**Post date:** [1 May 2020 08:47 UTC](https://discourse.nodered.org/t/raspberry-pi-led-turns-on-on-every-deployment/22478/8 "2020-05-01T08:47:29Z")

</div>

Closed on 1 May 2020 08:47 UTC

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