Path problem with Node-red as service

Hello, I work on a project using node-red to command vlc media server on a raspberry pi.
When I start node-red from the command line ('node-red') and start vlc also from the command line, there is no problem, all is working well and I can stop/play, change file etc. from node-red.
If I use Node-red as a service, the commands are not working. Perhaps I have to change the address of vlc? Or change the path of the files?
Yhat is very misterious for me.
I will try to post some screen captures.
Thank you,
Jacques

You need to make sure that you are using absolute file paths and not relative ones. When starting as a service, you almost certainly do not have a full set of environment variables so Linux cannot "find" things if you don't specify the full path.

If it isn't that, then are you using an exec node to run VLC? If so then add debug nodes to all outputs of the exec node and set them to output full message, and check for any errors there.
You should probably be using cvlc.

I found the solution for this problem:
To contact VLC, I need 3 variables:

  • port
  • password
  • address
    and for address I wrote 'localhost'
    that work with node-red from command line but not for node-red as service.
    Changing the address to the numbered IP, now it works with both.
    Thank you for your help.
    Jacques

Hello,
Finally I solved some of my problems, it was a problem of operations order.

– first node-red is starting too quickly the "start vlc", so I changed the "on start" inject time from 0.1 to 30 sec.
– then I think that node-red service is starting too quickly after boot, so I disable it and I made a .display file in autostart folder running node-red.
Now all is going perfectly. I can run 5 raspberry outputing 5 synched (not to the frame) videos.
Thank you for help,
Jacques

1 Like

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