3

I want to make a system using NeoPixels, an Arduino and an ESP8266 module to ping IP addresses on my network to determine if certain people are on our Wi-Fi (I'll be pinging mobile phones).

I'm finding it hard to find any help as to how to ping IP addresses from an Arduino using the ESP8266 module. I did find the ICMP Ping library, but it uses the Ethernet shield, and I'm quite new to Arduino so I don't even know if I could modify the library in any way.

If anyone could help me on my way, that'd be great!

2

3 Answers 3

2

From what I could find, it seems theres a command for pinging a server. It returns the number of milliseconds taken for the server to respond. The command is: AT+PING="web site" or AT+PING=<ip addr>, from 2 separate sources. You'll have to test them to see which (if not both) is correct.

2

This answer does not answer your question, but it implements the device you are describing. Unfortunately I don't have enough reputation to comment, so I will post it as an answer.

As people said before, ping is not a reliable option to scan the network. On Linux you can use dedicated (software) tools to scan the network, but even they struggle to reliably detect (some) mobile devices. So I wanted my router to do the work for me (at least it should reliably know which devices are logged into the Wi-Fi, right?).

Fortunately I have a Fritz!Box that provides an API to communicate with. Based on that API and an ESP8266 I build such a device you described in your question: [15min] Weasley Clock / Who is Home Indicator - based on TR-064 (beta).

To do that I wrote a library for Arduino to uses that API: Aypac/Arduino-TR-064-SOAP-Library.

1
  • It's too long for a comment anyway. :) I think we'll let it stand.
    – Nick Gammon
    Commented Dec 10, 2016 at 8:54
1

Not all devices (including) phones respond to ICMP Ping. This may differ for each (mobile) OS and version and phone make and model. But assuming your phone does respond to ping...

If you use the ESP with just the default firmware (a waste of a perfectly capable microcontroller), then indeed use the AT+PING command from the other answers.

If you use the ESP directly, you may be out of luck. Both the nocemcu lua firmware and the arduino api for esp seem to lack icmp ping functionality.

Your Answer

By clicking “Post Your Answer”, you agree to our terms of service and acknowledge you have read our privacy policy.

Not the answer you're looking for? Browse other questions tagged or ask your own question.