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

❌ [Experimental, not stable] Add websocket #2370

Draft
wants to merge 6 commits into
base: main
Choose a base branch
from
Draft

Conversation

caco3
Copy link
Collaborator

@caco3 caco3 commented Apr 30, 2023

This PR adds websocket support. With this we can make the web UI more responsive.

Call http://<IP>/websocket.html for a test:
grafik

[22:43:02] Trying to open a WebSocket connection...
[22:43:02] Connection opened
[..]
[22:43:54] {"round": "2"}
[22:43:54] {"uptime": "136"}
[22:43:54] {"state": "Take Image"}
[22:44:05] {"state": "Aligning"}
[22:44:45] {"state": "Digitalization of Digital ROIs"}
[22:44:49] {"state": "Digitalization of Analog ROIs"}
[22:45:01] {"state": "Post-Processing"}
[22:45:02] {"state": "Sending MQTT"}
[22:45:03] {"value": "531.72530", "number": "main"}
[22:45:03] {"error": "no error", "number": "main"}
[22:45:04] {"raw": "53N.72530", "number": "main"}
[22:45:04] {"state": "Flow finished"}
[22:45:04] {"round duration": "70"}
[22:45:04] {"cpu temperature": "69.444443"}
[22:45:05] {"wifi rssi": "-53"}

Notes

  • The needed memory for the websockets are in PSRAM
    Nevertehless some extra internal memory is needed due to the increased config.max_uri_handlers.

@caco3 caco3 marked this pull request as draft May 1, 2023 08:12
@nliaudat
Copy link
Contributor

nliaudat commented Oct 6, 2023

Why no merge ? It seems clean code after a small review.
Regards

@caco3
Copy link
Collaborator Author

caco3 commented Oct 6, 2023

Why no merge ? It seems clean code after a small review. Regards

When I tested it last, it did not work stable, and I was unable to find out why.

Maybe in winter I will have more time again to look into it but not now.

@nliaudat
Copy link
Contributor

nliaudat commented Oct 6, 2023

90% sur it's related to your psram implementation.

free_psram_heap() = unknown, no include and it's not an usual esp-idf function.

The psram need to be allocated with heap_caps_malloc().
Regards

@caco3
Copy link
Collaborator Author

caco3 commented Oct 6, 2023

Well, you didn't really look into the code, right?

A quick search would have shown you that it is a wrapper I wrote for debugging:
https://github.com/search?q=repo%3Ajomjol%2FAI-on-the-edge-device%20free_psram_heap&type=code

I strongly suggest you first study https://github.com/jomjol/AI-on-the-edge-device/blob/rolling/code/components/jomjol_helper/psram.cpp before giving any claims!

@caco3 caco3 changed the title Add websocket Add websocket (do not merge, it is not stable!) Nov 7, 2023
@caco3 caco3 changed the title Add websocket (do not merge, it is not stable!) [Experimental, not stable] Add websocket Aug 26, 2024
@caco3 caco3 changed the title [Experimental, not stable] Add websocket ❌ [Experimental, not stable] Add websocket Aug 29, 2024
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

Successfully merging this pull request may close these issues.

2 participants