embeddedlwip

How can I configure LWIP to add additional appliactions


I am using LWIP on an embedded device. I would like to create a MQTT application. LWIP supports this in the apps directory. But it seems that its not setup to compile this be default. I am unsure how I would get it to do this. I see there are some make files and also a CMake file. I would like to know the correct way to do this rather than try and hack the files.


Solution

  • To enable MQTT in LWIP the proper way, start by defining #define LWIP_MQTT 1 in your lwipopts.h file to activate MQTT support. Then, ensure the MQTT source files located in contrib/apps/mqtt are included in your build system. If you're using CMake, you should modify your CMakeLists.txt to add the MQTT source files explicitly. If you're using Makefiles, update them to include the MQTT directory and its .c files in the build process. Also, make sure that all required LWIP modules such as TCP and DNS are enabled in lwipopts.h, as MQTT depends on them. This approach keeps your setup clean and avoids modifying LWIP core files directly.