lwip-devel
[Top][All Lists]
Advanced

[Date Prev][Date Next][Thread Prev][Thread Next][Date Index][Thread Index]

[lwip-devel] Connect my computer (client) to my board (server/Lwip) usin


From: Tizana
Subject: [lwip-devel] Connect my computer (client) to my board (server/Lwip) using the hostname
Date: Tue, 17 Mar 2015 16:52:50 -0700 (MST)

Hi everybody,

Here’s my problem: 

I have an STM32F4 board which contain an STM32F4 microcontrollers. And i use
the LWIP (open source TCP/IP stack designed for embedded). this board is the
server.

In the other side the client will be my computer. I’ll create an application
using VB studio.
Inside windows application I want to create a function to connect the
computer to the server (Board). This function aims to connect to the board
(server) without knowing the IP addresses but only using the hostname board.
I use for that the function Dns.GetHostEntry(hostname)

I put the hostname and the function return me the IP of the device. I can
use the IP to connect to the (server). This function
Dns.GetHostEntry(hostname) works for the computer hostname but won’t work
for my board. It gives me an error. For example when I put the hostname of
my laptop the function give me her IP address. But when I use the board
hostname it won’t work and give me an error (like the hostname doesn’t exist
in the network)


Here’s the function:

<http://lwip.100.n7.nabble.com/file/n24144/pic1.png> 

The IP addresses of the server (board) is assigned by the DHCP. By default
the board is connect to the network without a hostname as shown in picutre1

<http://lwip.100.n7.nabble.com/file/n24144/pic2.png> 

After doing some research in google I found how can i assign a host name to
my board. I have to define the LWIP_NETIF_HOSTNAME inside the lwipopts.h
 #define LWIP_NETIF_HOSTNAME     1 

Then inside the ethernetif.c I can change the hostname:

#if LWIP_NETIF_HOSTNAME
  /* Initialize interface hostname */
  netif->hostname = "lwipBoard";
#endif /* LWIP_NETIF_HOSTNAME */

<http://lwip.100.n7.nabble.com/file/n24144/pic3.png> 

As you can see in the picture I have 3 devices connected in my network :
-my laptotp computer (192.168.1.2),
-my desktop computer which I work with (192.168.1.3) 
-my board called lwipBoard (192.168.1.4).

I want to know if it’s possible to make the Dns.GetHostEntry(hostname) work
also for my board ?? I want to tell you that I don’t know well about the
network stuff, I’m only an electronics engineering.






--
View this message in context: 
http://lwip.100.n7.nabble.com/Connect-my-computer-client-to-my-board-server-Lwip-using-the-hostname-tp24144.html
Sent from the lwip-devel mailing list archive at Nabble.com.



reply via email to

[Prev in Thread] Current Thread [Next in Thread]