Replies: 1 comment 5 replies
-
If you can provide a complete example that reproduces the problem I can investigate. Receiving a binary string is valid, WebSocket has support for binary payloads. But of course, if the client never sends binary strings I cannot explain why the server gets them. |
Beta Was this translation helpful? Give feedback.
5 replies
Sign up for free
to join this conversation on GitHub.
Already have an account?
Sign in to comment
-
This probably is a bit of a vague question, but I run into the problem that from time to time the data I receive on the micropython side via a websocket is not correct.
On the python side, I have code like this:
@with_subscriber is a decorator that allocates a channel to forward data to subscribers (or receive data from them that are then sent over the web socket). As such, it has nothing to do with the problem that occurs.
On the JavaScript side, I have code like so:
The problem now is that the received message on my microcontroller (an ESP32 system) from time to time is incorrect, for example like this:
I log the sent message on the JavaScript side, using console.log, and there what was sent was
{"tick": 38}
, but instead the garbled binary string shown above was received.What could be the reason for this? Are there communication errors that would need to be handled on the python side but are currently ignored? I would have expected that, if a message arrives, it indeed is correct.
Beta Was this translation helpful? Give feedback.
All reactions