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

esp_websocket_event_data_t corrupted when receiving if EspWebSocketClient initialized with new_with_conn #232

Open
evoggy opened this issue Feb 19, 2023 · 2 comments

Comments

@evoggy
Copy link
Contributor

evoggy commented Feb 19, 2023

Hi!

I've been using the websockets implementation for sending and receiving binary data on an ESP32 (ESP32-WROOM-32E). Sending and receiving seems to be working fine if the EspWebSocketClient::new is used for initialization, but if EspWebSocketClient::new_with_conn is used there seems to be an issue with the received data being corrupted.

From what I've observed the data passed from the SDK looks fine on client.rs#L356. But when the data in message (esp_websocket_event_data_t) is accessed in EspWebSocketConnection::next it seems corrupted. Some things, like op_code and client seems fine, but other like data_ptr and data_len are corrupted.

I'm new to rust, so I might be mistaken, but I can't find anything wrong in the implementation. Could it be that the underlying data in esp_websocket_event_data_t is modified in the IDF after the callback returns ?

@Vollbrecht
Copy link
Collaborator

Did you get closer to the problem, or did you move on? Do you have an simplified project setup to help reproduce the problem? Anyway thank you for reporting.

@evoggy
Copy link
Contributor Author

evoggy commented Oct 23, 2023

No, I never got this working and instead just used EspWebSocketClient::new.

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

No branches or pull requests

2 participants