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

Multithreading with AdvancedWebServer? #11

Open
PeterAJansen opened this issue Nov 20, 2017 · 0 comments
Open

Multithreading with AdvancedWebServer? #11

PeterAJansen opened this issue Nov 20, 2017 · 0 comments

Comments

@PeterAJansen
Copy link

Thanks for your contribution, as someone new to the ESP32 environment this set of WebServer examples was really helpful!

In using AdvancedWebServer, I have a bit of javascript to reload the SVG every 250msec, and then added in some quick code to receive data from a sensor and populate the graph with this data. Every 2000msec the data is read and stored in a buffer, and on request for the SVG the contents of the buffer are used for the Y values instead of the random values. I believe the code to read the sensor is fairly light weight (tens to a few hundred msec).

I've noticed that when actually reading real values, the server ends up missing most of the requests. It seems to work a bit better when reducing the update from 250msec to 1000msec, and placing the server and sensor code in separate FreeRTOS tasks doesn't appear to help much.

My question is: is there a canonical or suggested method for pairing this webserver with other tasks that require non-zero time, so that it doesn't miss requests?

thanks again,
Peter

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