Problem with the EthernetInterface

15 Jul 2012

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

15 Jul 2012

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

15 Jul 2012

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:

Import programTCPSocket_HelloWorld

TCP Socket Hello World with Ethernet

Import programUDPSocket_HelloWorld

UDP Socket Hello World with Ethernet

Cheers,

Donatien

16 Jul 2012

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

16 Jul 2012

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

17 Jul 2012

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

17 Jul 2012

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

17 Jul 2012

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

18 Jul 2012

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?

Import libraryHTTPClient

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

19 Jul 2012

thank you, now the program complies...

04 Aug 2012

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.

25 Oct 2015

It is not compiling again!

Error: Cannot open source input file "TCPSocketConnection.h": No such file or directory in "HTTPClient/HTTPClient.h", Line: 27, Col: 34

Donatien Garnier wrote:

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?

Import libraryHTTPClient

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