Skip to content

WebSocket - void send_P() is deprecated #107

@mikrocoder

Description

@mikrocoder

Platform

ESP32

IDE / Tooling

Arduino (IDE/CLI)

What happened?

When I compile the WebSocket example I get a deprecated warning. I think this should be changed at some point. I am using the Espressif Core 3.1.1 with the Arduino IDE 2.3.4 with C++20 (23) and Windows 11

Stack Trace

"C:\\Users\\Worker\\AppData\\Local\\Arduino15\\packages\\esp32\\tools\\esp-x32\\2405/bin/xtensa-esp32s3-elf-g++" -MMD -c "@C:\\Users\\Worker\\AppData\\Local\\Arduino15\\packages\\esp32\\tools\\esp32-arduino-libs\\idf-release_v5.3-cfea4f7c-v1\\esp32s3/flags/cpp_flags" -std=gnu++23 -Wno-volatile -Os -Werror=return-type -DF_CPU=240000000L -DARDUINO=10607 -DARDUINO_XIAO_ESP32S3 -DARDUINO_ARCH_ESP32 "-DARDUINO_BOARD=\"XIAO_ESP32S3\"" "-DARDUINO_VARIANT=\"XIAO_ESP32S3\"" -DARDUINO_PARTITION_default_8MB "-DARDUINO_HOST_OS=\"windows\"" "-DARDUINO_FQBN=\"esp32:esp32:XIAO_ESP32S3:UploadSpeed=921600,USBMode=hwcdc,CDCOnBoot=default,MSCOnBoot=default,DFUOnBoot=default,UploadMode=default,CPUFreq=240,FlashMode=qio,FlashSize=8M,PartitionScheme=default_8MB,DebugLevel=none,PSRAM=disabled,LoopCore=1,EventsCore=1,EraseFlash=none,JTAGAdapter=default\"" -DESP32=ESP32 -DCORE_DEBUG_LEVEL=0 -DARDUINO_RUNNING_CORE=1 -DARDUINO_EVENT_RUNNING_CORE=1 -DARDUINO_USB_MODE=1 -DARDUINO_USB_CDC_ON_BOOT=1 -DARDUINO_USB_MSC_ON_BOOT=0 -DARDUINO_USB_DFU_ON_BOOT=0 "@C:\\Users\\Worker\\AppData\\Local\\Arduino15\\packages\\esp32\\tools\\esp32-arduino-libs\\idf-release_v5.3-cfea4f7c-v1\\esp32s3/flags/defines" "-IC:\\Users\\Worker\\AppData\\Local\\Temp\\.arduinoIDE-unsaved202528-9912-xh4lir.zrgbi\\WebSocket" -iprefix "C:\\Users\\Worker\\AppData\\Local\\Arduino15\\packages\\esp32\\tools\\esp32-arduino-libs\\idf-release_v5.3-cfea4f7c-v1\\esp32s3/include/" "@C:\\Users\\Worker\\AppData\\Local\\Arduino15\\packages\\esp32\\tools\\esp32-arduino-libs\\idf-release_v5.3-cfea4f7c-v1\\esp32s3/flags/includes" "-IC:\\Users\\Worker\\AppData\\Local\\Arduino15\\packages\\esp32\\tools\\esp32-arduino-libs\\idf-release_v5.3-cfea4f7c-v1\\esp32s3/qio_qspi/include" "-IC:\\Users\\Worker\\AppData\\Local\\Arduino15\\packages\\esp32\\hardware\\esp32\\3.1.1\\cores\\esp32" "-IC:\\Users\\Worker\\AppData\\Local\\Arduino15\\packages\\esp32\\hardware\\esp32\\3.1.1\\variants\\XIAO_ESP32S3" "-Ig:\\Arduino IDE v2.3.4\\portable\\sketchbook\\libraries\\credentials" "-IC:\\Users\\Worker\\AppData\\Local\\Arduino15\\packages\\esp32\\hardware\\esp32\\3.1.1\\libraries\\WiFi\\src" "-IC:\\Users\\Worker\\AppData\\Local\\Arduino15\\packages\\esp32\\hardware\\esp32\\3.1.1\\libraries\\Network\\src" "-Ig:\\Arduino IDE v2.3.4\\portable\\sketchbook\\libraries\\Async_TCP\\src" "-Ig:\\Arduino IDE v2.3.4\\portable\\sketchbook\\libraries\\ESP_Async_WebServer\\src" "-IC:\\Users\\Worker\\AppData\\Local\\Arduino15\\packages\\esp32\\hardware\\esp32\\3.1.1\\libraries\\FS\\src" "@C:\\Users\\Worker\\AppData\\Local\\arduino\\sketches\\D65EAF21176EFB3E025EFC79F0AA7AAC/build_opt.h" "@C:\\Users\\Worker\\AppData\\Local\\arduino\\sketches\\D65EAF21176EFB3E025EFC79F0AA7AAC/file_opts" "C:\\Users\\Worker\\AppData\\Local\\arduino\\sketches\\D65EAF21176EFB3E025EFC79F0AA7AAC\\sketch\\WebSocket.ino.cpp" -o "C:\\Users\\Worker\\AppData\\Local\\arduino\\sketches\\D65EAF21176EFB3E025EFC79F0AA7AAC\\sketch\\WebSocket.ino.cpp.o"
C:\Users\Worker\AppData\Local\Temp\.arduinoIDE-unsaved202528-9912-xh4lir.zrgbi\WebSocket\WebSocket.ino: In lambda function:
C:\Users\Worker\AppData\Local\Temp\.arduinoIDE-unsaved202528-9912-xh4lir.zrgbi\WebSocket\WebSocket.ino:140:20: warning: 'void AsyncWebServerRequest::send_P(int, const String&, const char*, AwsTemplateProcessor)' is deprecated: Replaced by send(int code, const String& contentType, const char* content = asyncsrv::empty, AwsTemplateProcessor callback = nullptr) [-Wdeprecated-declarations]
In file included from C:\Users\Worker\AppData\Local\Temp\.arduinoIDE-unsaved202528-9912-xh4lir.zrgbi\WebSocket\WebSocket.ino:5:
g:\Arduino IDE v2.3.4\portable\sketchbook\libraries\ESP_Async_WebServer\src/ESPAsyncWebServer.h:423:8: note: declared here
  423 |   void send_P(int code, const String &contentType, PGM_P content, AwsTemplateProcessor callback = nullptr) {
      |        ^~~~~~
Bibliotheken werden kompiliert ...

Minimal Reproductible Example (MRE)

WebSocket Example from ESP32 Async WebServer Library

I confirm that:

  • I have read the documentation.
  • I have searched for similar discussions.
  • I have searched for similar issues.
  • I have looked at the examples.
  • I have upgraded to the lasted version of ESPAsyncWebServer (and AsyncTCP for ESP32).

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