Page 1 of 1

Behavior of RevPi DIO input nodes at turn on in a Node-Red setting

Posted: 24 Nov 2021, 08:10
by Daniele.tampieri
The title says all: I'd like to know if a message is generated at turn on to make a Node-Red system aware of the status of DIO inputs. I see that when an input changes, the associated payload property assumes a string value "1": however the other properties have an integer 0 or 1 value, thus I'd like to know if a message is generated even there's no input variation.

Re: Behavior of RevPi DIO input nodes at turn on in a Node-Red setting

Posted: 30 Nov 2021, 11:36
by crismancich
Hi Daniele,

use a start-up-trigger node with a RevPi get pin. Make sure you add some delay so that the pi is already botted up completely.
https://flows.nodered.org/node/node-red ... up-trigger

Image

Re: Behavior of RevPi DIO input nodes at turn on in a Node-Red setting

Posted: 02 Dec 2021, 14:57
by Daniele.tampieri
HI crismancich,
Thank you for the flow you suggested: do this implies that it is not possible to "take a picture" of all inputs jointly, for example by using some initial state of the node revpi-multiple-input? I mean, if I need to know the state of all inputs at a given time, possibly in the form of a JSON object

Code: Select all

{ "I_1" :  x1, ... "I_14" : x14 }
, should I acquire it by doing some kind of (triggered) ladder flow by using the

Code: Select all

revpi-getpin
node as you did?
crismancich wrote: 30 Nov 2021, 11:36 Hi Daniele,

use a start-up-trigger node with a RevPi get pin. Make sure you add some delay so that the pi is already botted up completely.
https://flows.nodered.org/node/node-red ... up-trigger

Image

Re: Behavior of RevPi DIO input nodes at turn on in a Node-Red setting

Posted: 18 Dec 2021, 21:01
by Daniele.tampieri
Hi crismancich,
I solved the problem by using your suggestion in a ladder structure, precisely the one shown in the picture below:
Schermata 2021-12-18 alle 18.25.57.png
Schermata 2021-12-18 alle 18.25.57.png (498.37 KiB) Viewed 4406 times
The input of this submodule is activated at start-up: the shown subflow then takes a screenshot of the input status and send it as a payload object wit the same structure as the `revpi-multiple-input` node payload, so I can use the same processing node downstream.