From: David Schwartz on 25 Mar 2010 23:49 On Mar 25, 4:19 pm, Didi <d...(a)tgi-sci.com> wrote: > Pretty much the latter, although usually it is not a browser > but an RFB (VNC) client. If only there were a command line in > the MSDOS window like arp -r <MAC address> which would then do > inverse ARP and list the result I guess I would be fine but... You want to sell a physical device that 'just works'. You want it to connect to a LAN, get its IP by DHCP, and then you want the user to have some easy way to access the device's built in web server without having to install or run any special software. Is that an accurate description of the scenario? DS
From: robertwessel2 on 26 Mar 2010 00:01 On Mar 25, 4:54 pm, Didi <d...(a)tgi-sci.com> wrote: > I tried today to figure out a simple way to give users of our > new netmca (http://tgi-sci.com/tgi/nmcatb.htm) to locate its > IP address once it gets one via dhcp when there is no internet > at the moment (when there is the device posts its IP to our domain > and customers can see it using a browser). > > Turned out there is nothing like an easy way to do that! > > There are some utilities which can be used to ping the entire subnet; > then list the arp cache, locate the known MAC address and > see its IP. But these are far from something one would want to ask > customers to deal with, long lists, necessity to search etc. , heck, > it > will generate more calls to me than if I do it for them every time. > > In an attempt to solve it I spent 10 minutes adding RARP reply > to our device Ethernet related stuff - so it would reply to an ARP > inquiry #3 by sending its IP address (it only has one); and then spent > perhaps 3 hours googling, moogling, you name it, searching for some > piece of code to do that at the wintel side. Even rebooted the wintel > laptop to ubuntu to try it out from there (thought arp -r or something > would just work), oh no. No way. Spent perhaps half an hour of > moogling for linux rarp, same thing. > > How on Earth is that possible?! I can understand how many things > are retarded as one would expect them to be on a x86 based thing, > but this is too simple even for the x86 world. > > Any ideas? I have not faced the issue in real life yet (users tend > to have internet) but this is bound to happen and I am looking for > some solution. Well, you could just install a copy of NMAP on the user's computer. :-) More seriously, the usual technique is to supply a small program that gets the list of interfaces from the OS, and then does a scan from there. On Windows, the GetAdaptersInfo() function will quickly get you a list of all the attached subnets. Then just do something simple to detect your device - if you can have it respond to a UDP port query, for example, just scan all those IP addresses for that port (QOTD/UDP is great for that - just have the quote be "I'm a Widget9000, serial #1234"*). A smidge more work would be to do it with broadcasts, which should work for anyone on a typical Ethernet network, although can have some quirks on less standard connections. You *could* do that with TCP, but the lengthy timeouts will make that rather more painful. With UDP, you can just have a bound/listening socket, and pump the queries out (you should probably throttle that to no more than a few hundred per second, just to be a nice guy). A similar approach is possible on *nix. On either system you could also get the same information from shelling out to ipconfig or ifconfig, as appropriate, and then parsing the output. If your device supports SNMP, you can use that, although your query program then gets to process ASN.1, which is always a joy. In any case, you could wrap that in an HTML page or two (all of which would be stored on the users machine). Use Javascript to actually run your scanner program (prompt the user to respond OK to the security message), and have the result be a list of links to candidate devices. *Just dont use that exact string theres at least one device in the world that already uses that exact string (well, almost the above 9000 and 1234 have been changed to protect the excessively literal- minded). I wrote the spec for a client, they passed it on to their offshore development team, a year later Im looking at the code, and I notice that string embedded in the code sure enough, thats what the device sends Wheres that rolling-eyes-smiley when you need it?
From: Didi on 26 Mar 2010 02:13 On Mar 26, 5:49 am, David Schwartz <dav...(a)webmaster.com> wrote: > On Mar 25, 4:19 pm, Didi <d...(a)tgi-sci.com> wrote: > > > Pretty much the latter, although usually it is not a browser > > but an RFB (VNC) client. If only there were a command line in > > the MSDOS window like arp -r <MAC address> which would then do > > inverse ARP and list the result I guess I would be fine but... > > You want to sell a physical device that 'just works'. You want it to > connect to a LAN, get its IP by DHCP, and then you want the user to > have some easy way to access the device's built in web server without > having to install or run any special software. > > Is that an accurate description of the scenario? > > DS Yes. And this works fine if the customer has internet, but I know I won't be lucky all the time...(so far so good, though :-) ). Dimiter ------------------------------------------------------ Dimiter Popoff Transgalactic Instruments http://www.tgi-sci.com ------------------------------------------------------ http://www.flickr.com/photos/didi_tgi/sets/72157600228621276/
From: glen herrmannsfeldt on 26 Mar 2010 02:32 In comp.protocols.tcp-ip Didi <dp(a)tgi-sci.com> wrote: (snip) > Yes. And this works fine if the customer has internet, but I know > I won't be lucky all the time...(so far so good, though :-) ). Internet or not, most have DHCP, but not all. Many will want any such devices statically addressed. If the device has non-volatile memory (usually flash) then it can store its IP address. DHCP came when diskless machines had no non-volatile memory other than factory configured ROMs. (One with the ethernet MAC address in them, another with the boot code. If not, then you can require DHCP. Many DHCP servers allow one to configure static assignments based on ethernet MAC address. If the DHCP server has a log file, then it is easy to find the recently assigned address. Otherwise, a ping to the broadcast address for the subnet will find some, but not all, devices. (They will get ARP entries if they reply to the ping.) If the device has an LCD or other display, then you can have a way to find the IP address through the display, and configure any stored addresses. -- glen
From: Didi on 26 Mar 2010 03:14
On Mar 26, 8:32 am, glen herrmannsfeldt <g...(a)ugcs.caltech.edu> wrote: > In comp.protocols.tcp-ip Didi <d...(a)tgi-sci.com> wrote: > (snip) > > > Yes. And this works fine if the customer has internet, but I know > > I won't be lucky all the time...(so far so good, though :-) ). > > Internet or not, most have DHCP, but not all. Many will want > any such devices statically addressed. Well yes, but the default state as I ship it is with dhcp on (attempted) and if it times out fallback to a (re)programmable fixed IP address. Once they gain VNC access to the device they can switch dhcp off etc. from a menu and set a static address, I have no issues with that case. > If the device has non-volatile memory (usually flash) then > it can store its IP address. DHCP came when diskless machines > had no non-volatile memory other than factory configured ROMs. I know, but this was quite some time ago :-). Now this device ships with a HDD inside, has an EEPROM, runs a fullblown DPS and "only" needs tcp/ip access to have a monitor, keyboard and mouse. In fact I also offer it without a HDD - the whole DPS + application software fits in a 2M ROM (most of it being a ROM "disk"), flash actually. To repost the link to the device page, http://tgi-sci.com/tgi/nmcatb.htm . > If not, then you can require DHCP. Many DHCP servers allow one > to configure static assignments based on ethernet MAC address. I recently had such an encounter. Wanted to be able to remotely access the device behind a router and asked the network people on that site to forward the port of interest. They said it would take a static IP to do that; I reconsidered and made the device initiate the connection to my support VNC client which now I run in passive (listening) mode. Just made the device attempt it every 20 seconds or so - the user being able to turn that on/off. > If the device has an LCD or other display, then you can have a > way to find the IP address through the display, and configure > any stored addresses. Well if it had such a display it could just display its IP address :-). But it has not and technically there is no need for one. Just a tiny windows utility which will send a RARP inquiry to a MAC address and list the result would do in an internet-less environment; a browser is enough already if there is internet. Dimiter ------------------------------------------------------ Dimiter Popoff Transgalactic Instruments http://www.tgi-sci.com ------------------------------------------------------ http://www.flickr.com/photos/didi_tgi/sets/72157600228621276/ Original message: http://groups.google.com/group/comp.arch.embedded/msg/424b95a94a446059?dmode=source |