This page last changed on May 11, 2016 by rich.sperrin.

Hi

I have reserved IPs for a few devices and looking to test whether these devices are on-line. I can use "$sudo arp-scan IPaddr-IPaddr > [filename]" to generate a file with the result and planned to interogate the content to see if the IP is repeated in the file. Depending on whether the IP is found in the file will tell whats powered and online. Probably should add that the reason for this is because IP devices tend to have one IR command that toggles on-off and never know the current state. I also prefer to power devices down and not leave them in standby - this also means the $arp result is empty when powered down and off-line.

So 2 questions:-

1) Is this far too complicated test for powered/connected devices and is there a simpler method?

2) If it is feasable then can anyone one advise how to set up a shell execute command that will test the file content and return a boolean?

An example online/offline output file looks like this:-

$sudo arp-scan 192.168.0.5-192.168.0.5 > test
$nano test

Interface: eth0, datalink type: EN10MB (Ethernet)
Starting arp-scan 1.8.1 with 1 hosts (http://www.nta-monitor.com/tools/arp-scan/)

0 packets received by filter, 0 packets dropped by kernel
Ending arp-scan 1.8.1: 1 hosts scanned in 1.561 seconds (0.64 hosts/sec). 0 responded

$sudo arp-scan 192.168.0.12-192.168.0.12 > test
$nano test

Interface: eth0, datalink type: EN10MB (Ethernet)
Starting arp-scan 1.8.1 with 1 hosts (http://www.nta-monitor.com/tools/arp-scan/)
192.168.0.12 18:8e:d5:73:fd:f1 Philips Innovative Application NV

2 packets received by filter, 0 packets dropped by kernel
Ending arp-scan 1.8.1: 1 hosts scanned in 1.492 seconds (0.67 hosts/sec). 1 responded

thanks!

The way it works for me is to use ping shell command. More about it http://www.openremote.org/display/forums/Updates+on+ping+with+shell+command

Posted by aktur at May 12, 2016 10:12

Thanks Michal - only one issue with this is certain devices dont respond to a ping whether they are on or off - this is the case with Humax STB and AppleTV - however they do appear on ARP which i'm guessing is directed at the network/router and looking at connections information.

Posted by rich.sperrin at May 14, 2016 10:40

I don't know about Humax STB but Apple TV is OK. I have now APTV4 and it responds to ping when it is waked up. When it is in sleep mode then it does not, I must to wake it up with IR beforehand. The same was with my previous APTV2 device.

Posted by aktur at May 14, 2016 20:42

Thanks Michal - had another go and making progress now. The pings from the Raspberry work fine (seems windows10 doesnt always!) and I've got a script running that returns 1 or 0 in a file so reckon that will work with a sensor control.

....so what I've ended up with is a simple ping script that is run every 5 seconds and returns on or off. The sensor seems to like this and just have a label currently displaying the result. Eventually it will go into the rules to figure whats on and whats off and do some conditional stuff

However the label is steadily blinking between 'on' and 'N/A' in a 5 second cycle with 'N/A' appearing for about 1 second. Not sure what this is all about. The dev.log looks in order with no errors so not sure what to think at the moment. Thoughts?

Posted by rich.sperrin at May 17, 2016 20:07
Document generated by Confluence on Jun 05, 2016 09:29