Skip to content

websocket (WS_EVT_DATA) event from client does not update state on esp8266 only #307

@tichaonax

Description

@tichaonax

On esp8266 the event handler from file

lib\framework\WebSocketTxRx.h

is not passed the correct size_t len. As a result the if condition to proceed with updating the state is never executed. This works well on esp32 and I cannot figure out if its a library issue or not.
I have a json size 1365 characters but the len passed is 528.

  virtual void onWSEvent(AsyncWebSocket* server,
                         AsyncWebSocketClient* client,
                         AwsEventType type,
                         void* arg,
                         uint8_t* data,
                         size_t len) {
    if (type == WS_EVT_DATA) {
      Serial.println(F("WS_EVT_DATA"));
      AwsFrameInfo* info = (AwsFrameInfo*)arg;
      if (info->final && info->index == 0 && info->len == len) {

lib_deps =
  ArduinoJson@>=6.0.0,<7.0.0
  ; The following allows the use of the latest code for ESPAsyncWebServer - there hasn't been a release in a while
  ; Work around for https://github.com/me-no-dev/ESPAsyncWebServer/issues/1151
  https://github.com/me-no-dev/ESPAsyncWebServer
  ;ESP Async WebServer@>=1.2.0,<2.0.0
  AsyncMqttClient@>=0.9.0,<1.0.0

Metadata

Metadata

Assignees

No one assigned

    Labels

    No labels
    No labels

    Projects

    No projects

    Milestone

    No milestone

    Relationships

    None yet

    Development

    No branches or pull requests

    Issue actions