Triggering / Injecting a command as soon as Node Red is up

800 views
Skip to first unread message

Matrod

unread,
Jul 3, 2016, 4:06:04 PM7/3/16
to Node-RED
Hi everyone,

I was wondering if there´s a way to activate an inject node as soon as Node-Red instance is up and running in Linux (i.e. after stopping / re-starting it or a reboot). Is there something a la "autoexec.bat" used back in the old DOS days?

My goal is to change a LED color to know my Node-Red install is running properly.

My current set-up: Raspberry Pi with Ninja Cape (Arduino) running Node Red 0.13

Any help would be greatly appreciated.

Thanks!

Nicholas O'Leary

unread,
Jul 3, 2016, 4:07:25 PM7/3/16
to Node-RED Mailing List
The Inject node has an option to 'inject once on start' which is what you want.

Nick

--
http://nodered.org
 
Join us on Slack to continue the conversation: http://nodered.org/slack
---
You received this message because you are subscribed to the Google Groups "Node-RED" group.
To unsubscribe from this group and stop receiving emails from it, send an email to node-red+u...@googlegroups.com.
To post to this group, send email to node...@googlegroups.com.
Visit this group at https://groups.google.com/group/node-red.
For more options, visit https://groups.google.com/d/optout.

Matrod

unread,
Jul 3, 2016, 4:21:52 PM7/3/16
to Node-RED
Hi Nick,

Thanks for your answer. That´s what I thought, nonetheless, the documentation says:

The Inject once at start option actually waits a short interval before firing to give other nodes a chance to instantiate properly.


I tried checking this at the Inject node and it did not work. I need it to fire once as soon the Node-Red instance is started, not to be triggered manually (pushing the button).


Any ideas would be appreciated.


Take care!

Nicholas O'Leary

unread,
Jul 3, 2016, 4:24:03 PM7/3/16
to Node-RED Mailing List
That 'short interval' is 100ms... is that really not sufficient?

Matrod

unread,
Jul 3, 2016, 5:16:17 PM7/3/16
to Node-RED
Hi again,

The time interval should be enough, but for some reason, it is not working. Any ideas?

I checked the option, restarted the Pi and still does not work.

Thanks again.

Dave C-J

unread,
Jul 3, 2016, 5:41:58 PM7/3/16
to node...@googlegroups.com

Is this feeding into a good pin node ? If so they do take a long time to initialise (hence why they have their own set initial state option). If not try adding a delay node after the inject... 0.5 sec or whatever makes sense/works.

Reply all
Reply to author
Forward
0 new messages