Please help: Get IP address of a remote device (wifi kit) from DHCP router
Hi ppl,
I am about to get the IP address for the wifi kit which is connected to the same router with my PC.
I need to control my wifi kit through TCP client communication, but DHCP tends to assign new IP address to my wifi kit when connected to router.
Hence, i wish to write a java function to trace the IP address before starts the communication.
I am thinking to get the wifi kit's IP address based on the Hostname (name of the wifi shield):
As below:
InetAddress thatIp = InetAddress.getByName("Wiznet");
System.out.println("IP E:"+thatIp.getHostAddress());
But i don't think this is secure..
I attempt to research for getting IP address with MAC..
But have ambiguity on the result i found.
It stating i have to get the ARP table from router but it is not a good approach.
I have no luck for next finding on how retrieving the table with Java.
Hereby hope to have your advise how can i get the ip address of my wifi kit in a more dynamic and secure method..
is it using Hostname or MAC address or else...
many thanks.
hi... wish to have your advise again.
I tried to retrieve the arp table in java and attempt to extract the IP address based on MAC address for particular devise.
But i stuck with the substring... my code is as below:
Process result = Runtime.getRuntime().exec("arp -a");
BufferedReader output = new BufferedReader
(new InputStreamReader(result.getInputStream()));
String line = output.readLine();
while(line != null){
if ( line.startsWith("default") == true ){
System.out.println("is default");
break;
line = output.readLine();
String ipAdd = line.substring(0, 18);
String MACAdd = line.substring(24, 42);
System.out.println(line.length() + " " + line + " " + ipAdd + " " + MACAdd );
i m trying to sub the IP and MAC accordingly.. but i got error saying
Exception in thread "main" java.lang.StringIndexOutOfBoundsException: String index out of range: 42
at java.lang.String.substring(Unknown Source)
at ExecTest.main(ExecTest.java:22)
i dun understand this! as since the length of LINE is 56 , why STRING INDEX OUT OF RANGE happen?!
please advise!!!
Similar Messages
-
Please help I just accidentally deleted a very very important note from my "Notes" on my iPhone 4s. How can I get it back?
Is there a "Trash" file somewhere for deleted notes?
Thank you,
SusanHad you never backed up the phone before? When you saw the iTunes logo and cable, the device was in recovery mode. The data was already lost. The only way to recover from that is to restore the device, which will delete all of your data. You will only be able to restore to your last backup, whenever that was. Sorry this happened, but this highlights the importance of doing regular backups. The backup is the only protection you have against a problem like this.
-
can someone please help? my address bar is missing. All i have in its place is a grayed out tab that will not allow me enter a URL.
What browser?
Is this a Mac Pro? -
iitWhen syncing my iPhone the storage says OTHER what is other and how do you delete it or make it smaller my 16g phone has 3G of other please help get rid of it
The following has some information that may help: http://osxdaily.com/2013/07/24/remove-other-data-storage-iphone-ipad/
-
I reboot my router updated to IOS 5, still NO on/off selection for mirroring..please help getting disappointed
What are you trying to mirror from? Mirroring from your Mac won't be available until Mountain Lion 10.8 www.apple.com/macosx/mountain-lion/
Setting up and troubleshooting AirPlay Mirroring
support.apple.com/kb/TS4085 -
Please help needed os x lion I wish to transfer photos from the iPhoto library to a album or folder then delete them from the Library but when I do this it also deletes them from the album ? how do I do this please.
Albums are not places to store photos, they're more like "labels" you can apply to photos to better organize them. A single image file can be in multiple albums... they are not copies, it's simply been labelled as being in all those albums. So what you're trying to do doesn't make sense, because it's based on incorrect assumptions.
The iPhoto library will always show all photos that you have added to iPhoto. -
I lost all my pictures! Please help:( I added all my photo to a new album from the camera roll and i delete the picture that already move to new album, at last all my picture was gone !:'( Please, anyway to recover back all my photo? please help :'( Apple Service Center or Branch can help?
Albums is a way or sorting photos. Photos aren't moved from the Camera roll. The Camera Roll consists of all the photos on the phone. If you delete from Camera Roll they are deleted everywhere but Photo Stream.
Are you using Photo Stream? Your photos, providing they wer recent should still be in Photo Stream. If you have Photo Stream set up on your computer they should all be there. -
i set up my email account with ntlworld can somebody please help me why it keeps downloading emails i have deleted from about 4 years ago amounting to thousands of emails. thanks
Hi, is this POP or IMAP?
In Mail Preferences>Accounts>Mailbox Behaviors, what are settings for remove from server & such? -
Please help me to unable my ipad2 to play stream video from rtr planeta
Please help me to unable my ipad2 to play stream video from rtr planeta . Thank you!
I have no idea what rtr planeta is but if it uses Flash, it won't work very well or at all on an iOS device. If it is Flash, try the Skyfire browser... it is supposed to run some Flash sites. Review it carefully before purchase.
-
my wifi button does not working / it looks grey and can not open it... and my some applications does not working too ... please help me ... I bought this I phone from Beirut/Lebanon and i live in Turkey...
Here you go:
http://support.apple.com/kb/ts1559 -
Please help! My iPhone 4s will not let me slide from off to no
Please help! My iPhone 4s will not let me slide from off to no
try this:
Hold down the Sleep/Wake button and the home button together until the apple logo appears (ignore the ON/OFF slider) then let both buttons go and wait for phone to restart (no data will be lost). -
Satellite Pro L300-12H not getting IP from DHCP router via cable
My Vista Premium SP1 laptop is connected via wireless connection to a Buffalo ADSL modem/router model WBMR-G54 which works fine. However, I tried the other day to connect up the LAN card via RJ45 cable to the router and it won't work! I get the message "limited connectivity" and an IP of 169.254.xxx.xxx which suggests it is not getting an IP from the router.
I been on various web sites and tried all sorts of things like unchecking ipv6 on the LAN card properties, turning off DHCP Broadcast flag in the registry (as per micrsoft issue) etc. but to no avail.
Anybody got any suggestions to get it working?
NB: I took the laptop into work and connected it to the Windows 2003 server network and got a DHCP IP straight away!?!Hi wakefijr,
To be honest, it's still worth checking with your ISP or the router manufacturer because they will be able to guide you through the settings of the router. You're quite right about the 169.254.xxx.xxx IP address, it means that the DHCP server within the router isn't assigning an IP address to the laptop so the laptop is assigning itself an IP address via APIPA.
Short of checking the DHCP router settings, one other thing you could do is disable APIPA and try using the alternate IP configuration, this is how:
* Go to the *Start Menu* and in the *Start Search* box, type in *ncpa.cpl* and hit Enter, this will open up network connections
* Go into the properties of the LAN and properties of IPv4
* Click on the *Alternate Configuration* tab
* You will see that it is set to APIPA, you can change to *User configured* and input an available IP address, the correct subnet mask (most likely 255.255.255.0) and default gateway.
* Click *OK* as many times as you need to save all changes, then reboot with the RJ45 cable connected.
What this will then do is make the laptop try looking for a DHCP server to assign an IP address, but if no DHCP server is assigning an IP address to this laptop then it will assign one that should work on the network.
But really check router configuration as a priority. -
I am getting ready to order a iPad 3 wifi 4g from USA. I need to take it to India. Will the iPAD 3 work ? And when i pre order do i go with the AT&T since it has the gsm ?
Please let me know.
thanks
KunalI would since it is more global than Verizon. AT&T works in more than 200 countries worldwide. Also talk to AT&T about an International Data Plan for it so your wireless statement will not be as high without it.
-
My Time Capsule backups disappeared (blank black screens) and in trying to set it up again I now find that when TC is plugged in and on (green light) it cancels out wifi reception from my router. I am only using TC as a backup not for wifi. Can anybody help?
Sorry, you have lost me since it appears that you have two completely separate issues here.
All that I can suggest is you start over and try to set up the Time Capsule again first...and then, once that is done and the Time Capsule is working correctly on the network....then, try to troubleshoot the separate Time Machine issue.
If you decide that you want to do this, we'll need some basic information:
Make and model number of your modem?
You are using OS X Mavericks (10.9.3), correct? -
Please help external IP address and CCTV
Hi all,
I am really struggling to set up my router etc to try and get my Cctv camera to be able to be viewed over a 3G iphone app or another network. I can view the camera over my iphone, iPad etc as long as I am connected to my home network as soon as I lose that I can view the camera, have googled etc and it is saying need to port forward and set up external IP address, in all honesty I have a clue what this is, how to do and getting a little frustrated blindly typing things in, I have a home hub 5 please help some one.
Thanks
SiThere is an additional help page on this link.
CCTV and IP cameras - port forwarding
Which IP camera do you have?
There are some useful help pages here, for BT Broadband customers only, on my personal website.
BT Broadband customers - help with broadband, WiFi, networking, e-mail and phones.
Maybe you are looking for
-
We have a socket connection and when reading a huge XML file, part of it is lost. No exceptions are thrown. only a few lines in the middle of the xml is lost. We use InputStream in = socket.getInputStream(); BufferedReader dis = new BufferedReader(ne
-
I recently bought MS Office 2008 for my dell and now just bought the MB Pro. Are there other "substitutes" on Mac OSX that would take the place of Office? I think I can order the MAC version and install it on my MB Thanks
-
I am about to buy a Macbook Pro 13, should I go for and do I need the extra 3 years warranty?
-
Hi All, In the webdynpro content administrator. All the 'create ,the other links like 'test', 'preview','edit','ping','remove' are all disabled. when i am trying to access the webdynpro application i am getting the following error. can any body tell
-
Exceptions during startup of WLCS 3.5
Hi, I just downloaded and installed WLCS 3.5. I'm trying to run it with WebLogic 6.0sp1. I get the following errors when the server starts up, although I can still request pages and the administration tools and exampleportal seem to work fine. I've a