Hi Peter,
Hi All,
I'm trying to get the HTTP server example working on my LPC2368 mbed without any success so far. I have a simple index.htm file in the mbed drive. I have tried the pre-compiled code at http://mbed.org/projects/cookbook/svn/EMAC/lwip/examples/HTTPServer_LPC2368.bin and have tried compiling the the source at http://mbed.org/projects/cookbook/svn/EMAC/lwip/examples/HTTPServer with a little pintf at the start of main() for testing.
My set-up has the mbed on a mbed-BOB connected to my Linksys WAG200G wireless router with a crossover Ethernet cable. I get nothing from the USB serial port other than the little message I inserted in the compiled version. The router does not list an IP address for the mbed. Back in August, I successfully tried the nice Ethernet test example at http://mbed.org/projects/cookbook/wiki/EthernetTest with the same crossover Ethernet cable connected to my Windows XP PC with static IP addresses so I am pretty sure the mbed Ethernet works OK. By the way this example no longer compiles-there are heaps of errors; any idea what's changed?
Anyway, I suspect something in the router set-up is not right; I have looked over the router web pages and nothing obvious tells me why it won't DHCP the mbed. I have looked over the Forum at this and related threads and can't find any clues. I would apprecaie any help.
Thanks,
Peter
The old EthernetTest example was using another (older) port of lwip. It does not compile anymore with the new library because in version 12 of the mbed library changed the declaration of the pins and some other things. But on the other hand versions >11 allows you to compile for the LPC2368 and LPC1768 without rewriting your code.
The problem you have sounds like a wiring problem but this is just a guess. Can you compile and run ethersniff_hex for me and see if you can see some broadcasting packages from the network. Bets is when you make some broadcasting traffic with your pc (ARP requests or broadcast pings). You should see every arriving package with sender and receiver mac address and a hex dump of the package itself. If it works your connection is fine if not we know its a connection problem.
If it works you describe that you get stuck before you've got a IP address from your DHCP server. If you can change line 5:
HTTPServer http;
to
HTTPServer http("wolf", // Brings up the device with static IP address and domain name.
IPv4(192,168,0,44), // IPv4 is a helper function which allows to rtype ipaddresses direct
IPv4(255,255,255,0), // as numbers in C++.
IPv4(192,168,0,1), // the device address is set to 192.168.0.44, netmask 255.255.255.0
IPv4(192,168,0,1)); // default gateway is 192.168.0.1 and dns to 192.168.0.1 as well.
But change the IP address and netmask and gateway for your network. Have a look here: http://mbed.org/projects/cookbook/api/EMAC/lwip/trunk/HTTPServer/HTTPServer
This should at least bring more information whats wrong.
Regards
Rolf
Hi Ilya,
I did not think of this might be a good feature for the next version.
timeout is in ms. I will add that in the API docs.
Yes, this was the main reason I've done it. But I'm sure there are many more bugs ;-) And that means I need help to find them :-D
Cheers
Rolf