Problem with the EthernetInterface
Topic last updated
04 Aug 2012, by
Jan-Hendrik Bade.
10 replies
beta,
ethernet
Hello,
I imported the the newset version of the EthernetInterface but it dont works...
"cannot open source input file "rtos.h": No such file or directory" in file "EthernetInterface/LwIPNetworking/coreIOStream.h", Line: 25, Col: 17
Replies
I got past this point. Look up and add mbed_rtos. I'm stuck at the next step. During a compile, I get a lot of LwIP warnings, like 40 or so. The code compiles, but the linker fails.
...kevin
Hi Jan-Hendrik, Kevin,
You are right, you need to import the mbed-rtos library as well.
There was a bug in the latest version of the libraries that made these warnings appear and that is now fixed, can you try updating the library?
Also, did you check the following programs? They can provide you with a good starting point to build your own code:
TCP Socket Hello World with Ethernet
UDP Socket Hello World with Ethernet
Cheers,
Donatien
Hi,
I think I found what made your code fail to compile.
You must have got this error:
"struct "os_thread_def" has no field "stack_pointer"" in file "EthernetInterface/LwIPNetworking/mbed-lwip/lwip-sys/arch//sys_arch.c", Line: 447, Col: 11
A change in the latest mbed-rtos update generated this error within the RTOS abstraction layer in the networking stack (in the lwip-sys library to be specific).
I just updated the lwip-sys library (and the EthernetInterface library which uses it) so that it is compatible with the new mbed-rtos revision.
Hope that this helps.
Cheers,
Donatien
Thanks Donatien,
The update made all things better. So, a couple of questions:
1. Is there a way to get a link status at any time?
2. How can I test for a valid DHCP address after a connect() is issued?
3. How would I implement a NTP client?
...kevin
Hi Kevin,
This is great news.
To answer your questions:
- 1. You can use this function:
//bool isConnected(); //Is the interface connected?
if( eth.isConnected() )
{
//Do something
}
- 2. If isConnected() returns true, the IP address should be valid, you can get it with:
//char* getIPAddress(); //Get IP Address as a string ('a.b.c.d')
printf("IP Address is %s\n", eth.getIPAddress());
- 3. I am currently working on implementing one, it should be available quite soon!
Cheers,
Donatien
hey the newesr version works (with mbed-rtos lib)
but now the HTTPClientLibBeta dont works....
"cannot open source input file "api/socket.h": No such file or directory" in file "HTTPClientLibBetaHTTPClient.h", Line: 31, Col: 23
Donatien,
Thanks for the update. An important note: when attempting a eth.connect(), the mbed hangs forever if the Ethernet cable is disconnected. Is there a timeout value that can change?
...kevin
Hi Jan-Hendrik,
Sorry about this regression. We have tried lately to make the Socket APIs consistent but we had to introduce a few architecture changes lately.
Can you try out this program (in beta) instead?
A HTTP Client for the mbed networking libraries
Hi Kevin,
Yes, for now there is no timeout implemented in the eth.connect() function. This should definitely be added in a later revision.
Donatien
thank you, now the program complies...
Hi guys,
I still have some issues:
"cannot open source input file "TCPSocket.h": No such file or directory" in file "HTTPClientHTTPClient.h"
and also
"cannot open source input file "core/fwk.h": No such file or directory" in file "HTTPClientHTTPClient.cpp"
Any ideas to solve it?
Tnx!
V.
Please log in to post a reply.
Hello,
I imported the the newset version of the EthernetInterface but it dont works...
"cannot open source input file "rtos.h": No such file or directory" in file "EthernetInterface/LwIPNetworking/coreIOStream.h", Line: 25, Col: 17