Something is not working. Advanced Ping, replies, and status.

69 views
Skip to first unread message

shykitten55

unread,
May 22, 2018, 7:49:51 PM5/22/18
to Node-RED
A while back I asked for help with pinging devices and determining their status.

It worked.

This is part of the flow.

But now the Modem is being marked as OFF-LINE, when it isn't.

The "gateway" is the mode, and the "uplink" is that the ADSL part is working.

This sends back that the modem is offline.

I'm at a loss to what is going on, as I am sure it used to work.


This is from the CLI:
 ping 192.168.0.254
PING 192.168.0.254 (192.168.0.254) 56(84) bytes of data.
64 bytes from 192.168.0.254: icmp_seq=1 ttl=64 time=0.592 ms
64 bytes from 192.168.0.254: icmp_seq=2 ttl=64 time=0.633 ms
^C
--- 192.168.0.254 ping statistics ---
2 packets transmitted, 2 received, 0% packet loss, time 1031ms
rtt min/avg/max/mdev = 0.592/0.612/0.633/0.032 ms

So the PING does work.





[{"id":"68960bfe.f514ac","type":"inject","z":"2d44537.f26082c","name":"Scan for machine status","topic":"","payload":"true","payloadType":"bool","repeat":"","crontab":"","once":false,"onceDelay":"","x":170,"y":390,"wires":[["427f0a88.bfbc3c"]]},{"id":"427f0a88.bfbc3c","type":"function","z":"2d44537.f26082c","name":"check list","func":"var checks = [\n    {'topic':'Gateway',  'addr': \"192.168.0.254\"},\n    {'topic':'UpLink',  'addr': \"144.130.209.209\"},\n    {'topic':'Network',  'addr': \"192.168.1.14\"},\n];\n\nfor ( var i in checks ) {\n    node.send({\n        \"topic\" : checks[i].topic,\n        \"host\"  : checks[i].addr,\n    });\n}","outputs":1,"noerr":0,"x":380,"y":390,"wires":[["da22d100.d67a98"]]},{"id":"da22d100.d67a98","type":"adv ping","z":"2d44537.f26082c","name":"","host":"","x":548.2222595214844,"y":390.3333435058594,"wires":[["4aaeb766.08ffd8"]]},{"id":"4aaeb766.08ffd8","type":"function","z":"2d44537.f26082c","name":"msg","func":"if (msg.payload===false){\n    //if its false the its off-line\n    msg.payload=msg.topic+\" Off-line\";\n}else{\n    //If its not false then it must be true / on-line\n    msg.payload=msg.topic+\" On-line\";\n}  \nreturn msg;\n\n","outputs":1,"noerr":0,"x":260,"y":500,"wires":[["d1ffc44f.4ef1c","f02a8396.875f88"]]},{"id":"f02a8396.875f88","type":"debug","z":"2d44537.f26082c","name":"Topic","active":true,"tosidebar":true,"console":false,"tostatus":false,"complete":"topic","x":430,"y":500,"wires":[]},{"id":"d1ffc44f.4ef1c","type":"debug","z":"2d44537.f26082c","name":"Message","active":true,"tosidebar":true,"console":false,"tostatus":false,"complete":"payload","x":440,"y":534,"wires":[]}]



5/23/2018, 9:44:02 AMnode: Message144.130.209.209 : msg.payload : string[23]
"144.130.209.209 On-line"
5/23/2018, 9:44:02 AMnode: Topic144.130.209.209 : msg.topic : string[15]
"144.130.209.209"
5/23/2018, 9:44:05 AMnode: Message192.168.0.254 : msg.payload : string[22]
"192.168.0.254 Off-line"
5/23/2018, 9:44:05 AMnode: Topic192.168.0.254 : msg.topic : string[13]
"192.168.0.254"
5/23/2018, 9:44:05 AMnode: Message192.168.1.14 : msg.payload : string[21]
"192.168.1.14 Off-line"
5/23/2018, 9:44:05 AMnode: Topic
192.168.1.14 : msg.topic : string[12]
"192.168.1.14"

shykitten55

unread,
May 22, 2018, 8:04:16 PM5/22/18
to Node-RED
Slight update:  (Not good)

I tried attacking the problem another way:

I changed the flow to this:

[{"id":"e51b8fc7.3495e8","type":"adv ping","z":"2d44537.f26082c","name":"","host":"192.168.0.99","x":370,"y":510,"wires":[["64f1bcff.b40354","5c76d67b.d966d"]]},{"id":"615b4f45.865558","type":"inject","z":"2d44537.f26082c","name":"Scan for machine status","topic":"","payload":"true","payloadType":"bool","repeat":"","crontab":"","once":false,"onceDelay":"","x":150,"y":510,"wires":[["e51b8fc7.3495e8"]]},{"id":"64f1bcff.b40354","type":"debug","z":"2d44537.f26082c","name":"Topic","active":true,"tosidebar":true,"console":false,"tostatus":false,"complete":"topic","x":560,"y":510,"wires":[]},{"id":"5c76d67b.d966d","type":"debug","z":"2d44537.f26082c","name":"Message","active":true,"tosidebar":true,"console":false,"tostatus":false,"complete":"payload","x":570,"y":550,"wires":[]}]


And changing the IP address for each try.   Result:

5/23/2018, 10:01:28 AMnode: Topic192.168.0.254 : msg.topic : string[13]
"192.168.0.254"
5/23/2018, 10:01:28 AMnode: Message192.168.0.254 : msg.payload : boolean
false
5/23/2018, 10:01:48 AMnode: Topic192.168.0.99 : msg.topic : string[12]
"192.168.0.99"
5/23/2018, 10:01:48 AMnode: Message192.168.0.99 : msg.payload : number
0.314




Hmmmmm.....    Strange.

As I said, the modem IS online and from the CLI/Terminal, it replies to the PING.



shykitten55

unread,
May 22, 2018, 8:08:24 PM5/22/18
to Node-RED
Sorry folks.

I screwed up.

Apologies.

Simon Walters

unread,
May 23, 2018, 4:51:19 AM5/23/18
to Node-RED
JFI

The new place to post requests for help is over on  


Simon
Reply all
Reply to author
Forward
0 new messages