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

axellin
Posts: 199
Joined: Mon Sep 17, 2018 9:09 am

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

Postby axellin » Tue Jan 07, 2020 6:34 am

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.

ESP_Angus
Posts: 2344
Joined: Sun May 08, 2016 4:11 am

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

Postby ESP_Angus » Tue Jan 07, 2020 7:10 am

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

axellin
Posts: 199
Joined: Mon Sep 17, 2018 9:09 am

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

Postby axellin » Tue Jan 07, 2020 7:18 am

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)

rkit2134
Posts: 6
Joined: Mon Sep 14, 2020 5:54 am

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

Postby rkit2134 » Fri Jul 01, 2022 2:15 am

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"
...

Who is online

Users browsing this forum: No registered users and 232 guests