Skip to content

Only compile WiFi related filters when WiFi is available #70

Open
@mathieucarbou

Description

@mathieucarbou

@mathieucarbou @qniens

The P4 env needs a change

[env:esp32-p4]
platform = espressif32
framework = arduino
board = esp32-p4
build_flags = -DLED_BUILTIN=2
monitor_speed = 115200
lib_deps =                https://github.com/ESP32Async/AsyncTCP.git
                          https://github.com/ESP32Async/ESPAsyncWebServer.git
custom_sdkconfig =        CONFIG_ESP_HOST_WIFI_ENABLED=y
                          CONFIG_ESP_MAIN_TASK_STACK_SIZE=7168

The key is to enable Host wifi for the P4. Now ESPAsyncWebServer throws an error

.pio/libdeps/esp32-p4/ESPAsyncWebServer/src/WebServer.cpp:11:10: error: 'WiFi' was not declared in this scope
   11 |   return WiFi.localIP() == request->client()->localIP();
      |          ^~~~
.pio/libdeps/esp32-p4/ESPAsyncWebServer/src/WebServer.cpp: In function 'bool ON_AP_FILTER(AsyncWebServerRequest*)':
.pio/libdeps/esp32-p4/ESPAsyncWebServer/src/WebServer.cpp:19:10: error: 'WiFi' was not declared in this scope
   19 |   return WiFi.localIP() != request->client()->localIP();
      |          ^~~~

This line https://github.com/ESP32Async/ESPAsyncWebServer/blob/c25ff116ab0ee917b43ade6156e3bac9e7e80611/src/WebServer.cpp#L10 (probably other too) needs a specifi check for the P4 which Network is used Wifi / ETH

Originally posted by @Jason2866 in #67 (comment)

Metadata

Metadata

Assignees

No one assigned

    Labels

    No labels
    No labels

    Type

    No type

    Projects

    No projects

    Milestone

    No milestone

    Relationships

    None yet

    Development

    No branches or pull requests

    Issue actions