Reputation: 311
I am currently connecting PC with the galileo board, I am using java socket programming for connecting PC with the board,
At the client side I need to give:
Socket client = new Socket(serverName, port);
Where I will provide the IP address of the PC. But everytime I connect galileo board to a different PC, I need to go into the code and modify the IP address.
Is there any way that the galileo board will automatically get the IP address of PC and adjust the IP address in the code.
Upvotes: 2
Views: 142
Reputation: 30335
You can solve this problem in one of two ways:
Assign a static IP address to the PC. It's easy if both the board and the PC are behind the same NAT, or if your ISP can assign you a static IP address.
Use a dynamic DNS service such as no-ip or changeip. You'll need to install an agent on the PC for that. The agent will update the service whenever the PC's address changes. The service will then make sure to answer DNS resolution request for <your subdomain>.dynmaic-dns.net
with the PC's current IP address, so you'll be able program the board to always connect to <your subdomain>.dynmaic-dns.net
Upvotes: 1