I honestly don't know if this is an issue, but on 1.4.0, my startup also
calls tcpip_init as below:
g_EmacSetMacFromRegs( (char *)&m_NetIF.hwaddr); // init MAC address
from the hardware
IP4_ADDR(ð0gw, 192,168,0,1);
IP4_ADDR(ð0ipaddr, 0,0,0,0); // for DHCP, start with this IP
IP4_ADDR(ð0netmask, 255,255,255,0);
tcpip_init( NULL, NULL);
netif_add( &m_NetIF, ð0ipaddr, ð0netmask, ð0gw, NULL,
ethernetif_init, tcpip_input);
dhcp_start( &m_NetIF)
...
After DHCP completes, try ping it from a computer on the subnet.
HTH!
Marty
________________________________
From: [email protected]
[mailto:[email protected]] On
Behalf Of Chen
Sent: Thursday, September 20, 2012 3:54 PM
To: [email protected]
Subject: [lwip-users] DHCP OK but TCP not? (Chen)
Bad news, DHCP got the IP assigned, but I can't connect to it
via TCP
anymore (UDP works fine), and the only difference in codes are
if (DHCP){
//This gets the IP, but I can't open via TCP
IP4_ADDR( &xIpAddr,0,0,0,0 );
IP4_ADDR( &xNetMask,255,255,255,0 );
IP4_ADDR( &xGateway,0,0,0,0 );
netif_add( &MACB_if, &xIpAddr, &xNetMask, &xGateway,
NULL, ethernetif_init, tcpip_input );
netif_set_default( &MACB_if );
dhcp_start(&MACB_if);
}
else{
//This works perfectly
IP4_ADDR( &xIpAddr,myIP[0],myIP[1],myIP[2],myIP[3]);
IP4_ADDR( &xNetMask,255,255,255,0 );
IP4_ADDR( &xGateway,0,0,0,0 );
netif_add( &MACB_if, &xIpAddr, &xNetMask, &xGateway,
NULL, ethernetif_init, tcpip_input );
netif_set_default( &MACB_if );
netif_set_up( &MACB_if );
}
_______________________________________________
lwip-users mailing list
[email protected]
https://lists.nongnu.org/mailman/listinfo/lwip-users