Skip to content

ESP32-S3 specific WS message lengths cause WS frame is not properly masked error (IDFGH-14461) #15235

Open
@higaski

Description

@higaski

Answers checklist.

  • I have read the documentation ESP-IDF Programming Guide and the issue is not addressed there.
  • I have updated my IDF branch (master or release) to the latest version and checked that the issue is present there.
  • I have searched the issue tracker for a similar issue and not found a similar issue.

IDF version.

ESP-IDF v5.4

Espressif SoC revision.

ESP32-S3 (QFN56) (revision v0.1)

Operating System used.

Linux

How did you build your project?

Command line with CMake

If you are using Windows, please specify command line type.

None

Development Kit.

ESP32-S3 WROOM2 custom board

Power Supply used.

External 3.3V

What is the expected behavior?

Transmitting WebSocket messages of any length should not be an issue.

What is the actual behavior?

I think there still is an issue when transmitting WebSocket messages of a particular length. I have an application which used to transmit 268B messages in bursts of 256 messages at a time. This worked flawlessly so far. Due to changed requirements the message size decreased from 268 to 263B and suddenly ESP-IDF is throwing WS frame is not properly masked errors at me.

Doing some research I think that this might be related to #14473, #14704 or #14706?
Apparently a particular message size transmitted at a specific pattern (263B x 256 in this case) is problematic.

Steps to reproduce.

  1. Use the following example esp_idf_issue_15235-master.zip
  2. Provide WiFi credentials in main.cpp
    #define MY_SSID ""
    #define MY_PASSWORD ""
  3. Flash the example onto an ESP32-S3-DevKitC-1 (must be a 32MB flash one, e.g. N32R8V)
  4. Open the ws_send.py script (requires websocket-client)
  5. Replace the IP address with the one assigned to the ESP32
  6. Run the script

Debug Logs.

I (9245) wifi:dp: 1, bi: 102400, li: 3, scale listen interval from 307200 us to 307200 us
I (9245) wifi:set rx beacon pti, rx_bcn_pti: 0, bcn_timeout: 25000, mt_pti: 0, mt_time: 10000
I (9255) wifi:AP's beacon interval = 102400 us, DTIM period = 1
I (10465) esp_netif_handlers: sta ip: 192.168.1.122, mask: 255.255.255.0, gw: 192.168.1.250
I (10465) esp_idf_issue_15235: got ip: 192.168.1.122
I (47935) wifi:<ba-add>idx:1 (ifx:0, 18:a6:f7:df:6d:b5), tid:0, ssn:0, winSize:64
I (48065) esp_idf_issue_15235: WS open
W (49805) httpd_ws: httpd_ws_recv_frame: WS frame is not properly masked.

More Information.

No response

Metadata

Metadata

Assignees

Type

No type

Projects

No projects

Milestone

No milestone

Relationships

None yet

Development

No branches or pull requests

Issue actions