Page 1 of 1

What is the recommend way to customize lwIP settings using ESP-IDF?

Posted: Tue Jan 07, 2020 6:34 am
by axellin
The idf.py menuconfig does not expose all lwIP settings.
I'd like to enable some settings that are not display on menuconfig.
e.g. To set LCP_ECHOINTERVAL, LCP_MAXECHOFAILS, etc.
I'd prefer to customize the lwipopts.h in my application rather than modify
esp-idf directly. But I'm not sure how to do it.

Re: What is the recommend way to customize lwIP settings using ESP-IDF?

Posted: Tue Jan 07, 2020 7:10 am
by ESP_Angus
Hi axellin,

Officially we only support changing the settings which are exposed in menuconfig, as that's what we've tested.

To modify other settings you'll need to modify lwip (and you'll be in "unsupported" territory with a modified ESP-IDF). You can do this by editing it directly, or you can copy the whole lwip component into a "components" directory inside your project directory (ie projectdir/components/lwip/...), and it will override the component found in the IDF source.

That said, I think we can probably add configuration items to tweak these PPP settings via menuconfig. Is there anything else you'd like to be able to customize?

Angus

Re: What is the recommend way to customize lwIP settings using ESP-IDF?

Posted: Tue Jan 07, 2020 7:18 am
by axellin
Hi Angus,
I think modify the lwip source in IDF is not a good way.
I have different applications to build but just some of the applications need to add additional changes of lwIP settings.
I think it's better if the build system can take a optional lwipopts.h from application to override the default one.
This is more flexible to customize settings. (Just a suggestion)

Re: What is the recommend way to customize lwIP settings using ESP-IDF?

Posted: Fri Jul 01, 2022 2:15 am
by rkit2134
add_compile_definitions(LWIP_SNMP=1)
In root CMakeLists.txt

Also some files from LWIP are not included in esp-idf build. You can manually add those into idf_component_register directive

Code: Select all

"$ENV{IDF_PATH}/components/lwip/lwip/src/apps/snmp/snmpv3_mbedtls.c"
"$ENV{IDF_PATH}/components/lwip/lwip/src/apps/snmp/snmpv3.c"
...