local-devices icon indicating copy to clipboard operation
local-devices copied to clipboard

Get device's name

Open fishfitz opened this issue 5 years ago • 9 comments

My use case is the following: I'm trying to auto-detect my camera when it is connected to the local network. Working from a w10 computer.

In my physical router interface, I can see it displayed over the name of LUMIX, which is something I could definitely work with.

But when I run the package, the only name I get is "?". Actually in none of the examples I can find in this repository's issues a device name is ever shown. Why?

Is there a way to retrieve the LUMIX name somehow, so I can auto-select it? Any suggestion about that?

Thanks you very much,

fishfitz avatar Dec 01 '19 09:12 fishfitz

Hi @cobaltway, I am sorry I haven't helped you yet. Have you figured it out in the meantime?

natterstefan avatar Dec 11 '19 12:12 natterstefan

@cobaltway just note down your camera mac-address instead and search for it.

Miosame avatar Jan 13 '20 01:01 Miosame

I was not able to find anything for now.

@Miosame Sure your solution may work for my precise device. It is far from ideal to automatically detect a new camera on the network by the way. But it may be not possible.

fishfitz avatar Jan 13 '20 10:01 fishfitz

@cobaltway the issue is that a lot of devices don't report a host name to others, besides to the router via dhcp.

I've tried plenty of solutions like arp, nmap, smb-tools,.. all couldn't get a host name most of the time.

A hacky solution but which would work is to write a wrapper for your router dashboard and read out the host names there.

Another could be to run your own dhcp server similar to how pihole handles it.

And the final would be to just discover all devices that are available via this module and then go through those detecting which of them gives a webcam feed (assuming your webcams are IPcams).

Miosame avatar Jan 13 '20 16:01 Miosame

I'll probably go for the last solution. My cams have a very specific API that could be used to detect wether or not the device is compatible. Nice idea.

fishfitz avatar Jan 13 '20 16:01 fishfitz

Hi @cobaltway, hi @Miosame,

thanks for supporting each other and I want to apologize for the delayed response.

Does the solution work for you @cobaltway?

natterstefan avatar Jan 14 '20 19:01 natterstefan

I found this package in npm: https://www.npmjs.com/package/network-list It seems to do what you need (it shows the names of the computers too), but it also shows an error which does not affect the result. Test and write if it gave you the desired result

jpolstre avatar Mar 31 '20 17:03 jpolstre

Device names can be retrieved using an NSLOOKUP. So when you have a list of ip addresses for the local devices. The command nslookup IP_HERE will return the name of the connected device. example below


C:\Users\Han\Desktop\file-sharer\server>nslookup 192.168.43.84
Server:  UnKnown
Address:  192.168.43.1

Name:    DESKTOP-K5ENA7C
Address:  192.168.43.84


C:\Users\Han\Desktop\file-sharer\server>

doc-han avatar Jan 31 '21 17:01 doc-han

any solution please

fukemy avatar Nov 22 '23 04:11 fukemy