Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

Receive BINARY_EVENT on ESP32 Socket.IO client #872

Open
Pro-282 opened this issue Feb 16, 2024 · 0 comments
Open

Receive BINARY_EVENT on ESP32 Socket.IO client #872

Pro-282 opened this issue Feb 16, 2024 · 0 comments

Comments

@Pro-282
Copy link

Pro-282 commented Feb 16, 2024

Hi,

I am trying to send a binary event from a node.js server to a esp32 client, but I only got the JSON encoded part of the event.
For example I got this: 451-["userData",{"time":1707930541,"data":{_placeholder":true,"num":0}}] but did not get the binary buffer.
Code:

case sIOtype_BINARY_EVENT:
            Serial.printf("[IOc] get binary: %u\n", length);
            hexdump(payload, length);

Serial monitor output:

[WS][0][handleWebsocket] text: 451-["userData",{"time":1707930541,"data":{_placeholder":true,"num":0}}]
[wsIOc] Socket.IO Message Type 5 (35) is not implemented
[wsIOc] get text: 451-["userData",{"time":1707930541,"data":{_placeholder":true,"num":0}}]
[IOc] get binary: 68

[HEXDUMP] Address: 0x3FFCF4DA len: 0x44 (68)
[0x3FFCF4DA] 0x00000000: 31 2D 5B 22 65 6E 72 6F 6C 6C 5F 74 65 6D 70 6C 
[0x3FFCF4EA] 0x00000010: 61 74 65 22 2C 7B 22 68 6F 73 74 6E 61 6D 65 22 
[0x3FFCF4FA] 0x00000020: 3A 22 45 53 50 33 32 20 45 6E 72 6F 6C 6C 20 70 
[0x3FFCF50A] 0x00000030: 6F 69 6E 74 22 2C 22 65 70 6F 63 68 54 69 6D 65 

I am guessing that the binary buffer frame sent after the first encoded json text is the cause of the [wsIOc] Socket.IO Message Type 5 (35) is not implemented

I've tried this to get the binary buffer, but it did not work:

case WStype_BIN:
            Serial.printf("[IOc] get bin: %u\n", length);
            hexdump(payload, length);
            break;

@Links2004 (I'm sorry for tagging you, but it's kind of urgent) how do I get the binary buffer after the first encoded json text.

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
None yet
Projects
None yet
Development

No branches or pull requests

1 participant