hi i.mx6 community
i am trying to run httpd application from i,mx6_platform_sdk
i made following changes to main routine
1. i commented getting ip by dhcp and auto
2. i enabled getting ip by static
3. i changed ip address 172.22.20.61 and my host is 172.22.20.11
after compilation, when i browse http:172.22.20.61 its not working (no connection error)
plz any one can reply
thanks and regards
Saida
First please make sure that httpd accepts the connection.
I mean you should get something like this:
# telnet 172.22.20.61 80
Trying 172.22.20.61...
Connected to woland.iae.nsk.su.
Escape character is '^]'.
running telnet on PC.
If you get no responce you can run telnet on the board itself to make sure that it is not a routing issue.
Then you can perform some simple http request:
# curl http://172.22.20.61/
and see what exactly the httpd returns.
Have a great day,
Victor
-----------------------------------------------------------------------------------------------------------------------
Note: If this post answers your question, please click the Correct Answer button. Thank you!
-----------------------------------------------------------------------------------------------------------------------
Thank you
i will come back checked
what happen if you "telnet" from PC on port 80 ? Can you try a cross cable ? On netstat -ant, is the http process listening on port 80 ?
hi
i pinged from ubuntu when u-boot is running on target board,
its working and also i tried tftp loading is also working with direct cable but not with cross over cable.
from this i confirmed that it works with direct cable
hi saida,
what code / app are you modifing ?
If you "ip addr show" can you see the correct ip set for the interface ?
What gives "netstat -ant" ?
hi angelo dureghello
thanks for your reply
i am modifying in http_main.c file init_lwip() function .
just give the procedure what i am doing
void init_lwip(void)
{
lwip_init();
ip_addr_t addr;
ip_addr_t netmask;
ip_addr_t gw;
IP4_ADDR(&addr, 10, 81, 4, 142);
IP4_ADDR(&netmask, 255, 255, 255, 0);
IP4_ADDR(&gw, 10, 81, 7, 254);
#if LWIP_NETIF_HOSTNAME
g_netif.hostname = "lwip";
#endif
// Set the MAC address.
enet_set_mac(kMACAddress);
// Create the netif.
netif_add(&g_netif, &addr, &netmask, &gw, NULL, enet_init, ethernet_input);
netif_set_status_callback(&g_netif, netif_status_callback);
netif_set_link_callback(&g_netif, netif_link_status_callback);
netif_set_default(&g_netif);
dns_init();
// Wait for link to come up.
printf("Waiting for link...\n");
while (true)
{
#if CHIP_MX6DQ || CHIP_MX6SDL
uint32_t status = imx_enet_get_phy_status(g_en0);
if (status & ENET_STATUS_LINK_ON)
#elif CHIP_MX6SL
uint32_t status = imx_fec_get_phy_status(g_en0);
if (status & FEC_STATUS_LINK_ON)
#endif
{
printf("Ethernet link is up!\n");
break;
}
hal_delay_us(100000); // 100 ms
}
// DHCP
if (1)
{
dhcp_start(&g_netif);
}
// Auto IP
else if (0)
{
autoip_start(&g_netif);
}
// Static IP address
else
{
netif_set_up(&g_netif);
}
httpd_init();
printf("TCP/IP initialized.\n");
}
in this function i am disabling DHCP and Auto IP mode and enabling Static IP way getting IP address
changes
IP4_ADDR(&addr, 172, 22, 20, 61);
IP4_ADDR(&netmask, 255, 255, 255, 0);
IP4_ADDR(&gw, 172, 22,20, 254);
continuation to my previous reply
than i compiling the code and loaded into SD card.Sabresd Board is directly connected with ubuntu PC with RJ45 cable
than the web page requested through this ip http://172.22.20.61
which is not working
give any idea to make it work
thanks and regards
Saida
any one can reply for me query