Open Fuempel opened 6 years ago
After some additional investigation, I guess the above mentioned delay is not the real root cause. Still it remains unstable. Also the parameter to vTaskDelay is not in ms, but in ticks.
But: I suspect the real root cause is that the ArduinoOTA library is not designed to run in a separate task in core 0, in parallel to the Arduino infrastucture.
I did a prototype, where the creatin of an additional task via xTaskCreatePinnedToCore(&OTAHandling, "ArduinoOTATask", ...)
is avoided.
I have implemented a member function Basecamp::handle, called from main.cpp loop()
function which then calls ArduinoOTA.handle();
Then ArduinoOTA runs on core 1 together with other Arduino infrastracture.
With this, I have a stabel setup of OTA functionality.
see PR #53
When using Basecamp 0.1.8 with PlatformIO / Atom, the OTA feature works very easily. However it is not stable and not successful in a high number of attempts.
I guess, main reason for this is the excessive delay in Basecamp.cpp:
The original value of 100 ms is way too high for the UDP based transmission, for high speed connections. Changing the value to 5 solved the problem for me for the moment.
But I am not sure on the side effects (runtime consumption) and if 5 ms is sufficiently low. Can you please check ?