Closed pramod-wick closed 3 years ago
Hi, what ESP-IDF version are you using? The IP_NAPT and IP_FORWARD defines are set in the
lwip/src/include/lwip/opt.h
file of the lwip library, not the main.c file. It looks like something went wrong when replacing the lwip library. Did you replace the esp-idf/component/lwip/lwip
folder with my lwip library?
In file included from D:/ESP/esp-idf/components/esp32/include/esp_timer.h:44:0, from D:/ESP/esp-idf/components/freertos/include/freertos/portma cro.h:82, from D:/ESP/esp-idf/components/freertos/include/freertos/portab le.h:96, from D:/ESP/esp-idf/components/freertos/include/freertos/FreeRT OS.h:105, from ../main/main.c:2: ../main/main.c: In function 'wifi_init_sta': ../main/main.c:85:21: error: implicit declaration of function 'esp_event_loop_in it' [-Werror=implicit-function-declaration] ESP_ERROR_CHECK(esp_event_loop_init(event_handler, NULL) ); ^ D:/ESP/esp-idf/components/esp32/include/esp_err.h:117:31: note: in definition of macro 'ESP_ERROR_CHECK' esp_err_t __err_rc = (x); \ ^ ../main/main.c:80:30: warning: unused variable 'dnsinfo' [-Wunused-variable] tcpip_adapter_dns_info_t dnsinfo; ^ cc1.exe: some warnings being treated as errors ninja: build stopped: subcommand failed. ninja failed with exit code 1
Hi, the example is for the ESP-IDF v4 version. With ESP-IDF version v4 you can build it without having to include the "esp_event_loop.h".
I don't know what the problem is with the idf.py menuconfig
command. I would suggest to setup ESP-IDF v4 and try it again. I just tested it on Windows 10 and it worked without a problem.
EDIT: I tested the project with ESP-IDF v3.3 and with including the "esp_event_loop.h" and it worked as well. The Example Configuration also showed up in the menuconfig (Tested it under Linux with make build system though...):
I'm using CMake build system because msys2 is too slow to build.I added a CMakeList.txt into the main directory,and run
idf.py clean idf.py menuconfig
The menuconfig works well.
> I added a CMakeList.txt into the main directory,and run
I also updated the project repository, so that it builds without compilation errors when using CMake build system.
The menuconfig works well.
But the Example Configuration option is still missing? Otherwise I will probably try to reproduce the problem under Windows. At the moment I can't say what the problem is. (Like I said before with ESP-IDF v4.0 and CMake it worked fine under Window 10)
No!The 'Example configuration' appeared after I add CMakeList.txt
Ok, glad to hear that it works now. I will add a note to the readme that you have to include the header when using the example with ESP-IDF v3.3.
But when I run it on Windows7,idf3.3,the CMakeList.txt in main directory must be like this:
set(COMPONENT_SRCS "main.c") set(COMPONENT_ADD_INCLUDEDIRS ".") register_component()
Otherwise,the menuconfig will not appear (CmakeList.txt Error)
But when I run it on Windows7,idf3.3,the CMakeList.txt in main directory must be like this:
set(COMPONENT_SRCS "main.c") set(COMPONENT_ADD_INCLUDEDIRS ".") register_component()
Otherwise,the menuconfig will not appear (CmakeList.txt Error)
Do you use the latest version? The last commit should fix this.
Yes,I used lastest version of this example,and when I run ‘idf.py menuconfig’,it output:
CMake Error at D:/ESP/esp-dd/main/CMakeLists.txt:1 (idf_component_register): Unknown CMake command "idf_component_register". Call Stack (most recent call first): D:/ESP/esp-idf/tools/cmake/scripts/expand_requirements.cmake:107 (include) D:/ESP/esp-idf/tools/cmake/scripts/expand_requirements.cmake:217 (expand_compo nent_requirements) cmake failed with exit code 1
I'm using Windows7 64bit,cmake 3.13.4,idf 3.3.1,python 3.8.
Thanks for the info, you were right, of course. I got a little bit mixed up on the versions.;) I will also add this to the readme or make a new branch for the ESP-IDF 3.3 version.
The esp-idf-v.3.3 branch fixes this issue. Please reopen if you still encounter this issue.
Hi
This is what i did.
I used this example as you provided. As per instructions I changed STA and AP SSID and password accordingly. Then i deleted the contents in the old lwip folder and replaced with the contents of your lwip. After that i changed serial flash config for adjust COM port and enabled "Enable copy between Layer2 and Layer3 packets" in make menuconfig.
Heres my problem.
Doing this will compile and build the program correctly, esp32 connects to my router and also has AP mode, however NAT functionality is not working. Then i noticed that i have to define "#define IP_NAPT 1" in order to include the library file and also the code.
so i added #define IP_NAPT 1 and #define IP_FORWARD 1 in the main.c. However i get an error during build process, more specifically when building the elf file " undefined reference to `ip_napt_enable'"