# Screen touchable nodes?

**URL:** https://discourse.nodered.org/t/screen-touchable-nodes/35963
**Category:** Dashboard
**Created:** [15 November 2020 17:33 UTC](https://discourse.nodered.org/t/screen-touchable-nodes/35963 "2020-11-15T17:33:11Z")
**Posts on this page:** 19
**Page:** 1

<div class="post-metadata">

### Author: ![RASelkirk](https://sea2.discourse-cdn.com/flex026/user_avatar/discourse.nodered.org/raselkirk/32/57425_2.png) [@RASelkirk](https://discourse.nodered.org/u/RASelkirk)
#### Post date: [15 November 2020 17:33 UTC](https://discourse.nodered.org/t/screen-touchable-nodes/35963/1 "2020-11-15T17:33:11Z")

</div>

Hi All,

My pi is gonna be locked away inside a plastic enclosure by the driveway, so I'm thinking about methods to reboot if needed. Can be done by command-line (normal) or GPIO pins if the pi is locked up. Either way, or both, would be good to have.

Is there a node that I can put on my dashboard that is touch-sensitive but not visible? That way I could intentionally do a reboot (from my phone) but others couldn't accidentally do it.

Russ

---

<div class="post-metadata">

### Author: ![Steve-Mcl](https://sea2.discourse-cdn.com/flex026/user_avatar/discourse.nodered.org/steve-mcl/32/4826_2.png) [@Steve-Mcl](https://discourse.nodered.org/u/Steve-Mcl)
#### Post date: [15 November 2020 18:06 UTC](https://discourse.nodered.org/t/screen-touchable-nodes/35963/2 "2020-11-15T18:06:57Z")

</div>

You could use a simple "reboot" button that asks for a password. If correct, it will reboot.

You can use ui\_notification or adapt [this](https://discourse.nodered.org/t/looking-for-a-text-input-dialog-popup-window-similar-to-notification-widget/23838/2)

---

<div class="post-metadata">

### Author: ![RASelkirk](https://sea2.discourse-cdn.com/flex026/user_avatar/discourse.nodered.org/raselkirk/32/57425_2.png) [@RASelkirk](https://discourse.nodered.org/u/RASelkirk)
#### Post date: [15 November 2020 22:37 UTC](https://discourse.nodered.org/t/screen-touchable-nodes/35963/3 "2020-11-15T22:37:07Z")

</div>

I've got the soft boot going!.Two large invisible buttons w/o focus in the lower LH and RH corners -\> JOIN node -\> (2) SWITCH nodes. JOIN combines button presses from both buttons, either ones or zeros for a total of four, then sends that string to each SWITCH node, which are set for different number sequences. With the correct number combo, that SWITCH triggers it's NOTIFICATION node, which then pops up with either "Soft Reboot" or "Hard Reboot". Pressing "Reboot" or "Cancel" -\> SWITCH node -\> EXEC node with "sudo shutdown" & "-r now". or otherwise for "Cancel". _I need to make that shutdown instead of hard boot though._

Still contemplating the shutdown, as it would take some effort to remove/restore physical power to the pi. I guess for the shutdown command, one _must_ remove and restore power? No other way?

If you try this, the buttonLeft & buttonRight backgrounds needs to be #000, I left them red for show.

Russ

```auto
[{"id":"e3729e2.ffb6d6","type":"ui_template","z":"c199b9b6.017a2","g":"7e4507b4.d3a11","group":"4ed5c42b.ce13dc","name":"ButtonLeft - 0","order":1,"width":3,"height":3,"format":"<button class=\"buttonLeft\" type=\"button\" ng-click=\"send({payload: 0})\">LEFT</button>","storeOutMessages":false,"fwdInMessages":false,"resendOnRefresh":false,"templateScope":"local","x":240,"y":660,"wires":[["2960ccbf.be310c"]]},{"id":"6fcc0177.b5dc68","type":"ui_template","z":"c199b9b6.017a2","g":"7e4507b4.d3a11","group":"40f30843.03128","name":"misc css","order":1,"width":0,"height":0,"format":"<style>\n\n/* sets font size for ALL text nodes label property */\n.nr-dashboard-theme .nr-dashboard-text .label {\n font-size: 24px;\n}\n\n/* sets font size for ALL text nodes .value property */\n.nr-dashboard-theme .nr-dashboard-text .value {\n font-size: 30px;\n }\n \n/* sets OPERATE button properties */ \n.button {\n display: inline-block; /* needed to set size/padding */\n padding: 15px 25px; /* spacing around button text */\n font-size: 36px;\n cursor: pointer;\n text-align: center;\n text-decoration: none;\n outline: none;\n color: #fff; /* button text color - white */\n background-color: #4CAF50; /* button body color - green */\n border: none;\n border-radius: 12px;\n box-shadow: 0 9px #3c6026; /* button up shadow color */\n}\n.button:active {\n background-color: #4CAF50;\n box-shadow: 0 5px #000; /* button down shadow color */\n transform: translateY(4px);\n}\n\n/* sets buttonLeft properties */ \n.buttonLeft {\n display: inline-block; /* needed to set size/padding */\n padding: 48px 24px; /* spacing around button text */\n font-size: 48px;\n cursor: pointer;\n text-align: center;\n border: none;\n color: #000; /* button text color - white */\n background-color: #c00; /* button body color - black */\n}\n\n.buttonLeft:focus {\n outline: none;\n box-shadow: none;\n}\n\n/* sets ButtonRight properties */ \n.buttonRight {\n display: inline-block; /* needed to set size/padding */\n padding: 48px 24px; /* spacing around button text */\n font-size: 48px;\n cursor: pointer;\n text-align: center;\n border: none;\n color: #000; /* button text color - white */\n background-color: #c00; /* button body color - black */\n}\n\n.buttonRight:focus {\n outline: none;\n box-shadow: none;\n}\n\n</style>\n","storeOutMessages":true,"fwdInMessages":true,"resendOnRefresh":false,"templateScope":"global","x":500,"y":640,"wires":[[]],"info":"NOTE: Do not add comments - everything breaks!"},{"id":"2960ccbf.be310c","type":"join","z":"c199b9b6.017a2","g":"7e4507b4.d3a11","name":"Add #s","mode":"custom","build":"string","property":"payload","propertyType":"msg","key":"topic","joiner":"","joinerType":"str","accumulate":false,"timeout":"3","count":"4","reduceRight":false,"reduceExp":"","reduceInit":"","reduceInitType":"num","reduceFixup":"","x":270,"y":720,"wires":[["d0dc4bf9.2fc","aeb00edb.b6a528"]]},{"id":"edac3f02.2edb38","type":"ui_template","z":"c199b9b6.017a2","g":"7e4507b4.d3a11","group":"4ed5c42b.ce13dc","name":"ButtonRight - 1","order":2,"width":3,"height":3,"format":"<button class=\"buttonRight\" type=\"button\" ng-click=\"send({payload: 1})\">RIGHT</button>","storeOutMessages":false,"fwdInMessages":false,"resendOnRefresh":false,"templateScope":"local","x":240,"y":780,"wires":[["2960ccbf.be310c"]]},{"id":"e96dd6d7.e57a28","type":"switch","z":"c199b9b6.017a2","g":"7e4507b4.d3a11","name":"Runs Command","property":"payload","propertyType":"msg","rules":[{"t":"eq","v":"Reboot","vt":"str"},{"t":"else"}],"checkall":"true","repair":false,"outputs":2,"x":490,"y":780,"wires":[["5d364351.5b309c"],[]]},{"id":"aeb00edb.b6a528","type":"switch","z":"c199b9b6.017a2","g":"7e4507b4.d3a11","name":"0001","property":"payload","propertyType":"msg","rules":[{"t":"eq","v":"0001","vt":"str"}],"checkall":"true","repair":false,"outputs":1,"x":420,"y":720,"wires":[["f1fe023d.1d5e4"]]},{"id":"d0dc4bf9.2fc","type":"switch","z":"c199b9b6.017a2","g":"7e4507b4.d3a11","name":"1001","property":"payload","propertyType":"msg","rules":[{"t":"eq","v":"1001","vt":"str"}],"checkall":"true","repair":false,"outputs":1,"x":420,"y":680,"wires":[["8ff5de7b.6299c"]]},{"id":"8ff5de7b.6299c","type":"change","z":"c199b9b6.017a2","g":"7e4507b4.d3a11","name":"blanker","rules":[{"t":"change","p":"payload","pt":"msg","from":"1001","fromt":"num","to":" ---- HARD Reboot ----","tot":"str"}],"action":"","property":"","from":"","to":"","reg":false,"x":550,"y":680,"wires":[["3b6a731.500c30c"]]},{"id":"f1fe023d.1d5e4","type":"change","z":"c199b9b6.017a2","g":"7e4507b4.d3a11","name":"blanker","rules":[{"t":"change","p":"payload","pt":"msg","from":"0001","fromt":"num","to":" ---- SOFT Reboot ----","tot":"str"}],"action":"","property":"","from":"","to":"","reg":false,"x":550,"y":720,"wires":[["425d72b.58de40c"]]},{"id":"3b6a731.500c30c","type":"ui_toast","z":"c199b9b6.017a2","g":"7e4507b4.d3a11","position":"dialog","displayTime":"10","highlight":"red","sendall":true,"outputs":1,"ok":"Reboot","cancel":"Cancel","raw":false,"topic":"","name":"hReboot","x":690,"y":680,"wires":[[]]},{"id":"425d72b.58de40c","type":"ui_toast","z":"c199b9b6.017a2","g":"7e4507b4.d3a11","position":"dialog","displayTime":"3","highlight":"","sendall":true,"outputs":1,"ok":"Reboot","cancel":"Cancel","raw":false,"topic":"","name":"sReboot","x":690,"y":720,"wires":[["e96dd6d7.e57a28"]]},{"id":"5d364351.5b309c","type":"exec","z":"c199b9b6.017a2","g":"7e4507b4.d3a11","command":"sudo shutdown","addpay":false,"append":" -r now","useSpawn":"true","timer":"","oldrc":false,"name":"Soft Reboot","x":690,"y":780,"wires":[[],[],[]]},{"id":"4ed5c42b.ce13dc","type":"ui_group","z":"","name":"Hidden Reboot Buttons","tab":"81831aab.f2f568","order":7,"disp":false,"width":"6","collapse":false},{"id":"40f30843.03128","type":"ui_group","z":"","name":"Button","tab":"81831aab.f2f568","order":5,"disp":false,"width":6,"collapse":false},{"id":"81831aab.f2f568","type":"ui_tab","z":"","name":"GTO-500 Gate Opener","icon":"dashboard","disabled":false,"hidden":false}]

```

Errr, forgot my screengrabs, one with colored buttons and one with black bg's:

 ![Screenshot_2020-11-15-13-29-45_resized](https://us1.discourse-cdn.com/flex026/uploads/nodered/original/3X/a/0/a039b6d4cf652ea5db843e81faced4c4bb24d619.png) ![Screenshot_2020-11-15-13-30-50_resized](https://us1.discourse-cdn.com/flex026/uploads/nodered/original/3X/0/a/0a050adae045dd3fa96226d9eba8cfaca3ec74f0.png)

---

<div class="post-metadata">

### Author: ![drmibell](https://sea2.discourse-cdn.com/flex026/user_avatar/discourse.nodered.org/drmibell/32/8424_2.png) [@drmibell](https://discourse.nodered.org/u/drmibell)
#### Post date: [16 November 2020 17:25 UTC](https://discourse.nodered.org/t/screen-touchable-nodes/35963/4 "2020-11-16T17:25:02Z")

</div>

> [@RASelkirk](#):
>
> I guess for the shutdown command, one _must_ remove and restore power? No other way?

Actually, with the pi shut down but connected to power, it is possible to restart it using a physical pushbutton. This involves connection to either the RUN or GLOBAL\_EN pins on the pc board. I have forgotten the exact recipe, and the pi 4 may be different from earlier models. (Do a Google search and try to filter out the obvious misinformation.) If you attach the button to the outside of the enclosure, you will have pay it a visit but you won't have to open it up.

---

<div class="post-metadata">

### Author: ![RASelkirk](https://sea2.discourse-cdn.com/flex026/user_avatar/discourse.nodered.org/raselkirk/32/57425_2.png) [@RASelkirk](https://discourse.nodered.org/u/RASelkirk)
#### Post date: [16 November 2020 19:12 UTC](https://discourse.nodered.org/t/screen-touchable-nodes/35963/5 "2020-11-16T19:12:26Z")

</div>

If I'm reading this [article](https://gilyes.com/pi-shutdown-button/) right, using a button click across pin 5 to grd will not only shut down pi, but a second click will restart it. This could be coded in as a software shutdown, but since the pi is "offline" code won't bring it back. As far as an external button goes, this solution seems more elegant than toggling pi's power source. Although in my case, I have a 12v -\> micro-USB adaptor than could have a switch spliced right off the 12v battery. I have a new pi case coming that has a fan, and I _think_ pins 1- 6 are blocked away for fan use from the 40p ribbon cable, which would force my hand...

Russ

---

<div class="post-metadata">

### Author: ![drmibell](https://sea2.discourse-cdn.com/flex026/user_avatar/discourse.nodered.org/drmibell/32/8424_2.png) [@drmibell](https://discourse.nodered.org/u/drmibell)
#### Post date: [17 November 2020 02:54 UTC](https://discourse.nodered.org/t/screen-touchable-nodes/35963/6 "2020-11-17T02:54:08Z")

</div>

I have not tried the method in that article or any of the others I have seen that involve the GPIO pins and additional software. What has worked for me on a pi 3 is to shut the pi down using `sudo shutdown` (either from the command line or an `exec` node) and then restarting it by shorting briefly between the RUN contact and the adjacent ground contact. These are located next to the 40-pin connector as indicated in red in this photo. Something very similar is possible with the pi 4, but I have not tried it.

 ![pi3-0](https://us1.discourse-cdn.com/flex026/uploads/nodered/original/3X/0/2/023ebd2bfcbe5728262a4fbca5f124f4b5101d76.jpeg)

---

<div class="post-metadata">

### Author: ![ozpos](https://avatars.discourse-cdn.com/v4/letter/o/278dde/32.png) [@ozpos](https://discourse.nodered.org/u/ozpos)
#### Post date: [17 November 2020 15:10 UTC](https://discourse.nodered.org/t/screen-touchable-nodes/35963/7 "2020-11-17T15:10:16Z")

</div>

This works however be careful how you attach to the contacts.

Some HATs like the UPS Pico HAT use gold plated spring loaded pins (like those used in manufacturing ATE equip) that extend the contacts so the UPS can do a power up. This is possible because this HAT has a micro that is kept alive on a few micro amps and does the shorting of the pins for you.

---

<div class="post-metadata">

### Author: ![RASelkirk](https://sea2.discourse-cdn.com/flex026/user_avatar/discourse.nodered.org/raselkirk/32/57425_2.png) [@RASelkirk](https://discourse.nodered.org/u/RASelkirk)
#### Post date: [17 November 2020 16:11 UTC](https://discourse.nodered.org/t/screen-touchable-nodes/35963/8 "2020-11-17T16:11:02Z")

</div>

Would SLCK (pin 23) do the same thing? It appears to be the clock pin for a different protocol. Not sure I'm up for a "test-run" without having someone with more knowledge step in...

Russ

---

<div class="post-metadata">

### Author: ![drmibell](https://sea2.discourse-cdn.com/flex026/user_avatar/discourse.nodered.org/drmibell/32/8424_2.png) [@drmibell](https://discourse.nodered.org/u/drmibell)
#### Post date: [17 November 2020 17:58 UTC](https://discourse.nodered.org/t/screen-touchable-nodes/35963/9 "2020-11-17T17:58:54Z")

</div>

> [@ozpos](#):
>
> gold plated spring loaded pins

Is this a good idea or a bad idea? I just solder a male header to those two pads and use jumper wires to connect to a push-button switch or logic circuit.

---

<div class="post-metadata">

### Author: ![ozpos](https://avatars.discourse-cdn.com/v4/letter/o/278dde/32.png) [@ozpos](https://discourse.nodered.org/u/ozpos)
#### Post date: [17 November 2020 18:21 UTC](https://discourse.nodered.org/t/screen-touchable-nodes/35963/10 "2020-11-17T18:21:49Z")

</div>

If the header is soldered from the underside then no problems as any spring loaded pin can still make contact with the soldered pads by pressing against the short end of the header. There are 90 degree headers that have a low profile and will easily fit on the underside of the pcb.

It is only a problem if you later wish to go with an intelligent HAT that acts as a watchdog and can do a power up of the pi.

Sorry for not chipping in before you soldered the wires.

If you would like to re-solder the wires I recommend un-soldering with either a solder sucker or some copper solder wick to clean the pad ready for re-soldering. If you are an experienced HW engineer then obviously you know all this.

P.S. If you are not an experienced HW engineer or not, always pre tin both sites before making the joint.

---

<div class="post-metadata">

### Author: ![drmibell](https://sea2.discourse-cdn.com/flex026/user_avatar/discourse.nodered.org/drmibell/32/8424_2.png) [@drmibell](https://discourse.nodered.org/u/drmibell)
#### Post date: [17 November 2020 18:24 UTC](https://discourse.nodered.org/t/screen-touchable-nodes/35963/11 "2020-11-17T18:24:51Z")

</div>

> [@RASelkirk](#):
>
> Would SLCK (pin 23) do the same thing?

I don't know what gives you that idea. As you say, [SCLK](https://www.raspberrypi.org/documentation/hardware/raspberrypi/spi/README.md) is the clock signal for the Serial Peripheral Interface (SPI). Unless you are implementing an SPI peripheral I wouldn't mess with it.

---

<div class="post-metadata">

### Author: ![drmibell](https://sea2.discourse-cdn.com/flex026/user_avatar/discourse.nodered.org/drmibell/32/8424_2.png) [@drmibell](https://discourse.nodered.org/u/drmibell)
#### Post date: [17 November 2020 18:27 UTC](https://discourse.nodered.org/t/screen-touchable-nodes/35963/12 "2020-11-17T18:27:31Z")

</div>

> [@ozpos](#):
>
> Sorry for not chipping in before you soldered the wires.

That's ok. You would have needed to speak up several years ago. I have never had much interest in third-party HAT's. They generally cost too much for functionality that I can build for myself without having to worry about the manufacturer going out of business.

---

<div class="post-metadata">

### Author: ![ozpos](https://avatars.discourse-cdn.com/v4/letter/o/278dde/32.png) [@ozpos](https://discourse.nodered.org/u/ozpos)
#### Post date: [17 November 2020 18:28 UTC](https://discourse.nodered.org/t/screen-touchable-nodes/35963/13 "2020-11-17T18:28:23Z")

</div>

When the Pi powers down it will only start up with a power disconnect and reconnect or by shorting these two pins.

---

<div class="post-metadata">

### Author: ![ozpos](https://avatars.discourse-cdn.com/v4/letter/o/278dde/32.png) [@ozpos](https://discourse.nodered.org/u/ozpos)
#### Post date: [17 November 2020 18:29 UTC](https://discourse.nodered.org/t/screen-touchable-nodes/35963/14 "2020-11-17T18:29:09Z")

</div>

Sound principle.

---

<div class="post-metadata">

### Author: ![drmibell](https://sea2.discourse-cdn.com/flex026/user_avatar/discourse.nodered.org/drmibell/32/8424_2.png) [@drmibell](https://discourse.nodered.org/u/drmibell)
#### Post date: [17 November 2020 18:29 UTC](https://discourse.nodered.org/t/screen-touchable-nodes/35963/15 "2020-11-17T18:29:23Z")

</div>

> [@ozpos](#):
>
> it will only start up with a power disconnect and reconnect or by shorting these two pins.

I think that's exactly what I said.

---

<div class="post-metadata">

### Author: ![ozpos](https://avatars.discourse-cdn.com/v4/letter/o/278dde/32.png) [@ozpos](https://discourse.nodered.org/u/ozpos)
#### Post date: [17 November 2020 18:32 UTC](https://discourse.nodered.org/t/screen-touchable-nodes/35963/16 "2020-11-17T18:32:03Z")

</div>

Sorry the reply was meant for @RASelkirk. And sorry but forums are a bit strange to me.

---

<div class="post-metadata">

### Author: ![drmibell](https://sea2.discourse-cdn.com/flex026/user_avatar/discourse.nodered.org/drmibell/32/8424_2.png) [@drmibell](https://discourse.nodered.org/u/drmibell)
#### Post date: [17 November 2020 18:33 UTC](https://discourse.nodered.org/t/screen-touchable-nodes/35963/17 "2020-11-17T18:33:34Z")

</div>

> [@ozpos](#):
>
> reply was meant for @RASelkirk

No worries. I was confused too.

---

<div class="post-metadata">

### Author: ![RASelkirk](https://sea2.discourse-cdn.com/flex026/user_avatar/discourse.nodered.org/raselkirk/32/57425_2.png) [@RASelkirk](https://discourse.nodered.org/u/RASelkirk)
#### Post date: [17 November 2020 18:35 UTC](https://discourse.nodered.org/t/screen-touchable-nodes/35963/18 "2020-11-17T18:35:09Z")

</div>

I'm just gonna interrupt the main power feed with a local switch. I may be able to do it with some spare contacts on my gate's MoBo, I'll have to check the manual and see if there's anything triggerable there.

Russ

---

<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: [17 December 2020 18:35 UTC](https://discourse.nodered.org/t/screen-touchable-nodes/35963/19 "2020-12-17T18:35:11Z")

</div>

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