tonyp7 / esp32-wifi-manager

Captive Portal for ESP32 that can connect to a saved wireless network or start an access point where you can connect to existing wifis.
MIT License
684 stars 222 forks source link

idf 5.x support #153

Open huardti opened 1 year ago

huardti commented 1 year ago

add the support for IDF 5.X

this patch also cleanup examples to remove compiler warning

BaktiyarBr commented 1 year ago

hello I still have a problem when building the project i added your commit to components and added it to cmakelist I just begin studying IDF and cant solve it on my own please help me if its possible "[0/1] Re-running CMake... -- Building ESP-IDF components for target esp32 CMake Error at D:/ESP-IDF/tools/cmake/build.cmake:245 (message): Failed to resolve component 'mdns'. Call Stack (most recent call first): D:/ESP-IDF/tools/cmake/build.cmake:281 (build_resolve_and_add_req) D:/ESP-IDF/tools/cmake/build.cmake:574 (build_expand_requirements) D:/ESP-IDF/tools/cmake/project.cmake:440 (idf_build_process)
CMakeLists.txt:8 (project)

-- Configuring incomplete, errors occurred! See also "D:/ESP-IDF/Projects/sample_project/build/CMakeFiles/CMakeOutput.log". ←[31mFAILED: ←[0mbuild.ninja D:.espressif\tools\cmake\3.24.0\bin\cmake.exe --regenerate-during-build -SD:\ESP-IDF\Projects\sample_project -BD:\ESP-IDF\Projects\sample_project\build ninja: error: rebuilding 'build.ninja': subcommand failed"

CJCombrink commented 1 year ago

I can maybe suggest to update the readme to state that when using this component in your own project to add the following to your own idf_component.yml:

dependencies:
  mdns: ">=1.0.3"
  esp32-wifi-manager:
    # Using the fork since it has idf 5 support
    version: huardti/idf-5.X-support
    git: https://github.com/huardti/esp32-wifi-manager.git

It would be first prize if this can be set by this base component but I do not know enough of IDF to know if this is possible

CJCombrink commented 1 year ago

Can I ask that you add the following include in wifi_manager.h

#include <esp_wifi.h>

If I change the include order in my app I cant compile anymore due to this include missing:

C:/.../managed_components/esp32-wifi-manager/src/wifi_manager.h:252:9: error: unknown type name 'wifi_bandwidth_t'
  252 |         wifi_bandwidth_t ap_bandwidth;
      |         ^~~~~~~~~~~~~~~~
C:/.../managed_components/esp32-wifi-manager/src/wifi_manager.h:254:9: error: unknown type name 'wifi_ps_type_t'
  254 |         wifi_ps_type_t sta_power_save;
      |         ^~~~~~~~~~~~~~
Bognacy commented 1 year ago

Can I ask that you add the following include in wifi_manager.h

#include <esp_wifi.h>

If I change the include order in my app I cant compile anymore due to this include missing:

C:/.../managed_components/esp32-wifi-manager/src/wifi_manager.h:252:9: error: unknown type name 'wifi_bandwidth_t'
  252 |         wifi_bandwidth_t ap_bandwidth;
      |         ^~~~~~~~~~~~~~~~
C:/.../managed_components/esp32-wifi-manager/src/wifi_manager.h:254:9: error: unknown type name 'wifi_ps_type_t'
  254 |         wifi_ps_type_t sta_power_save;
      |         ^~~~~~~~~~~~~~

You have to download mDNS component (https://github.com/espressif/esp-protocols/tree/master). Copy mdns folder to components in your project or add it with wizard when creating project. Finaly add #include to wifi_menager.h and it's start working.

huardti commented 1 year ago

If you want to make some changes to this PR you can submit your commit in my fork. this repo don't seems active anymore...