Mbed #include "EthernetInterface.h"

Hi, following problem:
I want to use a Nucleo401RE with a Wiznet Ethernetshield.
I include in the lib folder the WIZnetInterface library which is an
’in replace’ library with the same names of the original mbed library
(like EthernetInteface.h …).
When I try to compile, pio want to use the original mbed library instead
the Wiznet library. How to solve?
Maybe it is a general problem that pio try to use the mbed ethernet library even
when this is not a feature of the board.

Any suggestions to solve this problem?

Look at the libs_ignore section in the platformio.ini file. You can specify which user library you would like to exclude from compiling

It is the standard library which must excluded, not an user lib.
The standard lib shouldn’t in the build system because the Nucleo 401RE board has
no ethernetinterface.

Pio does not include any libraries unless you explicitly include them
In case of mbed, it should be only the mbed HAL. So if your pioenvs folder is having the ethernet library then you must be including it somewhere else.

Besides, the directory you have specified is showing only the compiled .o and .d files from the wiznet library and not the mbed standard library. (If I am understanding it correctly)

If it is still failing, you can explicitly set the lib_deps option in the platformio.ini or (in a much more crude manner) rename the Wiznet files to something else and then include them.

@krishna_chaitanya is right, you can use lib_ignore to exclude built-in library from build process. Try to use one of:

lib_ignore = mbed-net

or

lib_ignore = net

Please report if it works. Thanks.

lib_ignore = mbed-net works.
Thank you

Now I have another problem, The compiler doesn’t find a needed .h file (rebuild project doesn’t help)

Place the w5500 files in the same directory as the socket folder. Thev eth_srch searches for the w5500 header in its own directory. Platformio cannot help you there. Or give the explicit path while you are including the w5500 header in the eth_srch file.

Sorry that doesn’t work. This only moves the problem. The structure of the library works on the mbed compiler, so it must a problem of pio.

Where did you get this WIZnetInterface? If this is a mbed library it should have module.json where extraIncludes shoule be specified.

If this library doesn’t have manifest file, please create library.json in the root of library and manually specify custom extra includes. See Redirecting...

The library comes from the mbed website: WIZnetInterface - This is Library using WIZnet Hardware TCP/IP chip… | Mbed
I can compile it with the mbed online-compiler and with keil uVision

After changig the paths of the #includes, it works now. The library is very confusing, the mbed online compiler and keil have the right path included. When downloading the library it doesn’t work without modification.

You don’t need to change source code. Just create library.json and specify extra includes for these folders. This is an old version of mbed library.