ENOENT ping command not found

#1

Hello
I have installed the ping contrib on my PLC running node red with the palette.
I get an error, even if the contrib is really installed.

ENOENT ping command not found

[{"id":"f2f9771f.7cb348","type":"ping","z":"dac4c565.6941f8","name":"","host":"www.google.com","timer":"20","x":158.51251220703125,"y":725.7249526977539,"wires":[["f66b7aef.64f8a8"]]}]
What can it be?

#2

And did you really restart node-red ?

#3

Yes, I really rebooted my PLC.
I wrote 'really' because the ping node appears correctly in the list of the nodes, and I got a retunr message after install that he node was added.

#4

Have you noted the limitations? Do any of them apply to your platform?

This node actually spawns a system command "ping" so if your OS doesn't have that command available, it wont work.

#5

As pointed out the underlying operating system needs to have a ping command available. If not there by default it may be possible to install one.

#6

Hello

The ping work fine in the command line.

It also worked fine when nodered was started a riot. But if I start it as admin, it tells me that ping command is not found.

Envoyé de mon iPhone

#7

Well, for starters, it isn't recommended to run Node-RED (or much else for that matter) as admin/root unless you absolutely have to. There are few, if any reasons to do so with Node-RED.

This is absolutely why ping is failing since the command shell that is spawned won't have the right settings such as paths.

#8

Hello
My $PAT is actually like this :slight_smile
/opt/plcnext/appshome/data/60002172000051/bin:/opt/plcnext/apps/60002172000051/o pt/node-v10.15.3-linux-armv7l/bin:/usr/local/bin:/usr/bin:/bin:/usr/local/sbin:/ usr/sbin:/sbin:/opt/plcnext/appshome/bin
what would be missing so that the generated shell car run the command PING?

PING is a native function, so, what would be the reason why it is not accessible by any user?

#9

Is it? It certainly isn't part of BASH. On my Windows Linux Subsystem (Ubuntu), it resides as a binary command:

$ whereis ping
ping: /bin/ping /usr/share/man/man8/ping.8.gz
$ ls -la /bin/ping
-rwxr-xr-x 1 root root 63K Mar  9  2017 /bin/ping*

I would run some other commands from the exec node to identify what you are actually getting from whatever environment exec is inheriting.

#10

Following up on @TotallyInformation's comment, I would run the following commands, first from the command line then from the exec node.

$ echo $PATH
$ whoami
$ which ping

Any differences should give you a clue. You mention using node-red-node-ping but haven't said whether the ping command works from the exec node.

1 Like