Android Question Identifying a device connected to a router

rodmcm

Active Member
Licensed User
I am venturing into an area that I am trying to learn about, so sorry I might be asking the most basic of questions.

I have a field device that automatically connects to a local router.

I have an app on a phone that is connected to the same router.

I can scan the router through the App and list the IP and mac addresses of all connected devices. But the app of course cannot know in advance the IP address the router assigns to positively identify the field device.

Also, as I understand, if there are several field devices connected with the same sending processor the mac addresses would be the same, ie linked to the manufacturer and the processor, so this is not unique to the device either.

So what other mechanisms are available to positively identify an individual device from or after the scan?
 

emexes

Well-Known Member
Licensed User
I can scan the router through the App and list the IP and mac addresses of all connected devices. But the app of course cannot know in advance the IP address the router assigns to positively identify the field device.
Are there any benign queries that you can send to the device, eg, retrieve firmware version, serial number, model number, perform a reading? If you get a valid response, then it is probably your device.

Or, have you decided upon a random (non-standard) port number for your device to communicate through? If so, then just getting any response on that port will filter out most other devices and thus increase the likelihood of this device being one of yours. Although some firewalls get a bit narky about non-standard port numbers, so that might be opening a new can of worms :-/

It sounded like you might be querying the router for a list of attached devices. This won't work on every router. Two other approaches are:
1/ transmit a broadcast packet (usually IP address 0.0.0.0 or 255.255.255.255) to which your device can respond with "here I am" (or perhaps: "here weIare"...)
2/ scan through the other 253 addresses (excluding x.x.x.0, the router address and your address) and see if you can get a valid response from your device
 
Last edited:

rodmcm

Active Member
Licensed User
Thanks for that
How does the IDE bridge identify my tablet or cell phone by name, also I note some IP scanner apps identify AppleTV etc What is this mechanism or where can I research it.
 

emexes

Well-Known Member
Licensed User
Thanks for that
How does the IDE bridge identify my tablet or cell phone by name, also I note some IP scanner apps identify AppleTV etc What is this mechanism or where can I research it.
Hmm. Windows SMB networking had names, I've never thought about what IP does. DNS links names and IP addresses, but individual devices like an AppleTV aren't going to be listed in that. My first guesses would be:

- probe the device with a variety of common requests, see if it responds to any of them - I am guessing that Apple have a standard identity-enquiry command implemented on all their networkable devices, especially those where the firmware can be updated over the network
- MAC addresses assigned in blocks to manufacturers? (similar to IP geolocation)
 

emexes

Well-Known Member
Licensed User
How does the IDE bridge identify my tablet or cell phone by name ... What is this mechanism or where can I research it.
First promising result (Great minds think alike ;-)

https://www.lifehacker.com.au/2018/...ces-on-your-network-easily-with-the-fing-app/

Fing also attempts to figure out your connected devices' brands and models - a lookup technique ... devices' IP addresses and MAC addresses sent to the app's "Fingpedia" service ... tap on any specific device in your list, Fing lets you add a specific name, a description of what the device is
 
Last edited:

emexes

Well-Known Member
Licensed User

Didier9

Active Member
Licensed User
if there are several field devices connected with the same sending processor the mac addresses would be the same, ie linked to the manufacturer and the processor, so this is not unique to the device either.
This is incorrect. MAC addresses are supposed to be unique. Manufacturers buy series of MAC addresses (for Ethernet, it's the IEEE that sells them, or at least used to) and program unique addresses in their devices.

The only case where you may find non-unique addresses is in hobby kits if the seller does not bother to obtain and program unique addresses.

If you build your own device from scratch, you can buy devices that contain a unique MAC address such as those from Microchip:
https://www.microchip.com/design-centers/memory/serial-eeprom/mac-address-and-unique-id-eeproms

I build WiFi and Bluetooth enabled devices and I always come across the issue of a series of devices looking the same when scanning so the first thing I do is change the name by adding the last 4 digits of the MAC address. For instance, when using the ubiquitous HC-05 Bluetooth module, I change the name from HC-05 to HC05-XXXX where XXXX are the last 4 digits of the MAC address and I put a label on the device itself with that number. That name is not unique (it does not have to be, only the full 32 bits MAC address needs to be) but unique enough to allow me to select one HC-05 among a number of them that are linked to my phone.
 
Top