Scan Network for Connected Arduinos

Hi all,

I did a search but couldn't find a similar topic. I am wondering how I can scan my network from a PC or other device and find all the Arduinos that would be connected via wi-fi or ethernet. If I look at my router, it looks like they appear as 0.0.0.0 on the network, though I know they have IP's because they report it back via serial and I can transfer data via UDP back and forth to them.

Basically, I want to know how to find the Arduinos, determine their IP's without having to hook them up to a serial port and determine it before hand.

Any suggestions or help is appreciated!

Thanks,
Lenny

I never tried that with an Arduino but in theory you could send a UDP packet to the broadcast address of your local network and all devices listening to UDP messages on that port on the network shoud receive it and may answer with an appropriate return packet. This return packet will contain the IP address of the sending device as well as any other information your sketch writes to it.

If I look at my router, it looks like they appear as 0.0.0.0 on the network

0.0.0.0 means that the IP address is not known to your router. The reason for this depends a lot on the type of router you're using.

With my router (I use dd-wrt on it) I can see the active DHCP leases on the status page.

I can see all my Arduino boards, with their IP number in my router.
Something must be wrong if you see 0.0.0.0, because if they really would be 0.0.0.0 they would not work.
Every Arduino must have a unique mac address, and I give each of them a static IP number in the router. That way I can have bookmarks in my computers to connect to the right Arduino with the static IP address.

You can always connect a piezo beeper and morse-code the IP number or add a display to show it on :stuck_out_tongue:

Pylon,

I never considered sending a broadcast message that only the Arduinos would respond to, that's a great idea, thank you!

Caltoa,

I'll even setup a microphone on the computer to automatically decode the morse code. No sense in making any more manual labor for me typing in numbers! :smiley:

Pylon/Caltoa,

I agree its weird that my router reports connected devices with 0.0.0.0. The Arduino and wifi shield definitely have a valid IP from DHCP as it responds when I transfer UPD messages between it and my computer. I double checked the network messages using Wireshark, end everyone looks happy. Right now I verify I have the correct IP address from the serial port. Luckily it hasn't changed from connection to connection.

For what its worth, my Router is a D-Link DIR-857.