ESP-WebOTA
ESP-WebOTA copied to clipboard
Use WebOTA in FreeRTOS ?
That's not an issue but a question. I've used your code in several projects and would like to use it also on a new one I've borrowed around ( an energy monitor for the house ). Difference this time is that the project use FreeRTOS and works with tasks and not the usual loop. I was wondering if you or someone has never thougth to use this code in a FreeRTOS environment.
Thanks for your code and thanks for your time :)
I have zero experience with FreeRTOS but I'd be open to pull requests.
I know this is an old issue but I have done this through creating a task to initialize the webOTA that contains a while loop that runs the webota.handle method as well. Something like this:
TaskHandle_t webota;
xTaskCreatePinnedToCore(handleWebOTA, "WebOTA", 10000, NULL, 1, &webota, 0);
void handleWebOTA(void* parameters){
webota.init(8080, "/update");
while(1){
webota.handle();
}
}
I thought I would run into heap problems since the task is not large enough to handle the whole sketch but it works just fine. I think only because webota resets the board as soon as it is done updating. I've been using this method for a while without issue.