2

I would like to build a lib like ArduinoOTA but with no downtime at runtime. To achieve that I am wondering if it is possible to create a simple setup and loop code to

  1. Check for new releases
  2. If we have a new one start download it
  3. As download routine is not finished keep running the current release
  4. When download has finished, swap current release to the new one.
  5. Now the normal routine is running the new release.

I am pretty interested if it is possible to do by myself something like that.

I didn't find any paper or articles similar to this and I don't known if this is a challenge for Arduino scope or C/C++.

Maybe I am saying something bizarre but I have been thinking of save new release into flash memory, point to it and discard the old release from flash memory.

  • On an 8-bit Arduino? No. Or certainly not without a huge amount of work. – Majenko Jun 20 at 22:15
  • what are you trying to achieve? ... maybe it can be done without reflashing the program – jsotola Jun 20 at 22:41
  • @jsotola I am trying to deploy releases over the air without downtime in the middle of this process. That is, I want to download a new release from Internet and keep running the old one until the new has been downloaded. – marquesm91 Jun 20 at 22:51
  • that does not actually answer the question, it is a repeat of your question .... is it possible that an "update" could involve changing only some parameters that could be read from an online server – jsotola Jun 20 at 23:08
  • The "update" I am talking about is a new version of the current sketch previously uploaded to Arduino manually. – marquesm91 Jun 20 at 23:10
2

On many Arduinos the processor is only a few dollar part. You are asking for a feature that only starts appearing on platforms where the processor is over an order of magnitude higher in price. Further, such inexpensive processors normally run a single program. Running a sketch while managing a download & update would best be done by two programs existing in an operating system. Again, likely requiring a processor an order of magnitude higher in price.

Instead, consider implementing your design using two different Arduinos. Swapping one out for the other after updating. Hot swapping may not be trivial. This really depends on how your application interfaces with the world. But likely will be much easier than solving the problem of designing the supporting software to make sketch updates transparent to the Arduino user.

  • This is honestly the most simple and yet fun to implement. It is not be a perfect solution but definitely could attend me. Thank you so much for that! – marquesm91 Jun 21 at 11:36

Your Answer

By clicking “Post Your Answer”, you agree to our terms of service, privacy policy and cookie policy

Not the answer you're looking for? Browse other questions tagged or ask your own question.