Skip to content
This repository was archived by the owner on Jan 20, 2025. It is now read-only.
This repository was archived by the owner on Jan 20, 2025. It is now read-only.

WebSocket works on PC's Chrome but wont on Android's Chrome. #259

@aguaviva

Description

@aguaviva

First off, thanks for this amazing project :) Thanks to it I was able to build a sous vide controller.

https://github.com/aguaviva/SousVide

It turns out that it works fine on PC
image

but on my mobile and my tablet I get this:
image

The main.cpp file in my github repo shows how am I using the websockets.

In the setup() I init the websockets like this:

ws.onEvent([](AsyncWebSocket * server, AsyncWebSocketClient * client, AwsEventType type, void * arg, uint8_t *data, size_t len)
{
  if(type == WS_EVT_CONNECT)
  {
      Serial.printf("ws[%s][%u] connected\n", server->url(), client->id());
      client->ping();
      websocketsOnConnect(client);
  }
  else if(type == WS_EVT_DISCONNECT)
  {
      Serial.printf("ws[%s][%u] disconnected\n", server->url(), client->id());
  }
});
server.addHandler(&ws);

and in the loop() I do something like this:

    if (DataStreamer.tick())
    {
        STATE st = { (float)Temperature, (float)Power };
        histData.Queue(st);

        ws.binaryAll((char*)&st, sizeof(STATE));
    }

Any ideas what could be going on? I'll be happy to test any experiments you may want me to test.

Metadata

Metadata

Assignees

No one assigned

    Labels

    Projects

    No projects

    Milestone

    No milestone

    Relationships

    None yet

    Development

    No branches or pull requests

    Issue actions