# \`ping\` node error. Can someone make sense of it?

**URL:** <https://discourse.nodered.org/t/ping-node-error-can-someone-make-sense-of-it/37782>\
**Category:** General\
**Created:** [20 December 2020 03:25 UTC](https://discourse.nodered.org/t/ping-node-error-can-someone-make-sense-of-it/37782 "2020-12-20T03:25:22Z")\
**Posts on this page:** 9\
**Page:** 2

<div class="post-metadata">

**Author:** ![Trying\_to\_learn](https://sea2.discourse-cdn.com/flex026/user_avatar/discourse.nodered.org/trying_to_learn/32/28400_2.png) [@Trying\_to\_learn](https://discourse.nodered.org/u/Trying_to_learn)\
**Post date:** [26 December 2020 10:05 UTC](https://discourse.nodered.org/t/ping-node-error-can-someone-make-sense-of-it/37782/21 "2020-12-26T10:05:42Z")

</div>

Oh, you scoller! 😉

I think I did that, and I lost information. Can't be sure. But it had me spinning for a while and then I realised (bad use of words I know) that I had to make it as I have it so it is _compatible_ with the code I had already written for the `advanced-ping` node. Though had to change `msg.host` to `msg.payload` for the new ping node.

That had me stumped for a while too.

When I was not getting anything out of the `ping` node, I looked at the messages and saw they were sending it as `msg.host`.

I changed it to `msg.payload` and things started to work, but then other wheels fell off with missing message parts - which lead to me asking.

I may have to try it again tomorrow and see what I get.  
Push coming to shove, if I get enough of the right data out, I will modify the other code. Obviously.

Thanks.

I'll report back with results when I get into it in the next session.

---

<div class="post-metadata">

**Author:** ![Trying\_to\_learn](https://sea2.discourse-cdn.com/flex026/user_avatar/discourse.nodered.org/trying_to_learn/32/28400_2.png) [@Trying\_to\_learn](https://discourse.nodered.org/u/Trying_to_learn)\
**Post date:** [26 December 2020 21:45 UTC](https://discourse.nodered.org/t/ping-node-error-can-someone-make-sense-of-it/37782/22 "2020-12-26T21:45:34Z")

</div>

I have just made the test flow as shown.

Now the only problem is I can't resolve the actual `ping` result.  
Usually the PING time or `false` if not contactable.

Where is that part?  
(I need to _go to spec' savers!_)

---

<div class="post-metadata">

**Author:** ![Paul-Reed](https://sea2.discourse-cdn.com/flex026/user_avatar/discourse.nodered.org/paul-reed/32/66906_2.png) [@Paul-Reed](https://discourse.nodered.org/u/Paul-Reed)\
**Post date:** [26 December 2020 21:52 UTC](https://discourse.nodered.org/t/ping-node-error-can-someone-make-sense-of-it/37782/23 "2020-12-26T21:52:31Z")

</div>

> [@Trying\_to\_learn](#):
>
> Where is that part?

Isn't it the `msg.payload`?

---

<div class="post-metadata">

**Author:** ![Trying\_to\_learn](https://sea2.discourse-cdn.com/flex026/user_avatar/discourse.nodered.org/trying_to_learn/32/28400_2.png) [@Trying\_to\_learn](https://discourse.nodered.org/u/Trying_to_learn)\
**Post date:** [26 December 2020 21:55 UTC](https://discourse.nodered.org/t/ping-node-error-can-someone-make-sense-of-it/37782/24 "2020-12-26T21:55:22Z")

</div>

I was editing the reply. (Didn't think I'd get a reply that quick.)

No. Alas in my code it was `addr`. I changed it to `payload` that didn't work.

But looking at what @Steve-Mcl said: It has to be `host`.  
I'll confirm that beyond belief but that seems a bit inconsistent with how the node expects inputs.  
Changing from `payload` to `hosts`.

---

<div class="post-metadata">

**Author:** ![Trying\_to\_learn](https://sea2.discourse-cdn.com/flex026/user_avatar/discourse.nodered.org/trying_to_learn/32/28400_2.png) [@Trying\_to\_learn](https://discourse.nodered.org/u/Trying_to_learn)\
**Post date:** [26 December 2020 21:55 UTC](https://discourse.nodered.org/t/ping-node-error-can-someone-make-sense-of-it/37782/25 "2020-12-26T21:55:52Z")

</div>

In the returned `msg.payload` I just get (got) `false` to everything.

---

<div class="post-metadata">

**Author:** ![Trying\_to\_learn](https://sea2.discourse-cdn.com/flex026/user_avatar/discourse.nodered.org/trying_to_learn/32/28400_2.png) [@Trying\_to\_learn](https://discourse.nodered.org/u/Trying_to_learn)\
**Post date:** [26 December 2020 21:58 UTC](https://discourse.nodered.org/t/ping-node-error-can-someone-make-sense-of-it/37782/26 "2020-12-26T21:58:02Z")

</div>

I just checked.

Yes, if sending an array it must be `host` to get a `ping` reply.

ARGH!

It is `payload` but it is `payload.host` I think.

I have it working now.

Thanks.  
I originally didn't have the `host` part in the message I was sending.

---

<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:** [26 December 2020 22:16 UTC](https://discourse.nodered.org/t/ping-node-error-can-someone-make-sense-of-it/37782/27 "2020-12-26T22:16:25Z")

</div>

> [@Trying\_to\_learn](#):
>
> if sending an array it must be `host` to get a `ping` reply

Not really. It can be a string **or** an object in the array. but if you send an object, then the node needs to know what you want to ping. It just so happens to want you to put the host name or IP in the property `host`

 ![image](https://us1.discourse-cdn.com/flex026/uploads/nodered/original/3X/a/5/a5a2205143a467b0b4fd600111a16c0aece560be.png)

---

<div class="post-metadata">

**Author:** ![Trying\_to\_learn](https://sea2.discourse-cdn.com/flex026/user_avatar/discourse.nodered.org/trying_to_learn/32/28400_2.png) [@Trying\_to\_learn](https://discourse.nodered.org/u/Trying_to_learn)\
**Post date:** [26 December 2020 22:19 UTC](https://discourse.nodered.org/t/ping-node-error-can-someone-make-sense-of-it/37782/28 "2020-12-26T22:19:37Z")

</div>

Yeah... (You know.....) Silly me.

I am now rolling that out to the 4 machines I have online now and shall get around to rolling it out to all machines soon.

I just want to get that other problem I have fixed first. (That's another story)

Thanks though. I really need to learn to read everything and actually understand it.  
There are times when I can look but not see.

---

<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:** [9 January 2021 22:19 UTC](https://discourse.nodered.org/t/ping-node-error-can-someone-make-sense-of-it/37782/29 "2021-01-09T22:19:46Z")

</div>

Closed on 9 January 2021 22:19 UTC

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

[Previous page](https://discourse.nodered.org/t/ping-node-error-can-someone-make-sense-of-it/37782.md?page=1)
