Updating firmware with HTTP Requests
-
I'm interested in allowing our users to update their firmware and macros directly from the Nautilus plugin for Cura (I would be happy to submit a pull request with this functionality to the DuetRRF Plugin as well). I started with macros, and everything is working great there using the HTTP request scheme set up by the DuetRRF Plugin. I haven't published the code yet but I will soon.
Before I tackle firmware I wanted to ask @chrishamm, @dc42, and any other knowledgeable folks what to watch out for in terms of firmware installation? For macros I just recursively delete everything in macros and then upload the new ones. I assume firmware updating isn't quite as easy? Is there a good example to look to somewhere as to what order things need to be uploaded/deleted/changed, I didn't find it in the DWC source (I'm not super experienced w/ JS so I'm sure I just missed it).
-
For firmware updates, you need to upload the correct firmware file to /sys with exactly the right name (i.e. without any version number suffixes) using rr_upload. When it completes successfully, send M997.
Updates crossing some version numbers are a little more complicated, e.g. you may need to upload a new IAP file too.
-
You might need to differentiate between Duet 2 Wifi, Maestro and Ethernet boards (as well as Duet 3).
While Wifi and Ethernet share the RepRap firmware, the Wifi board can need to have the Wifi firmware updated. (Maybe you can just upload all firmware files and run
M997 S0:1:2
?) -
@dc42 for now I'm only confronting the Duet Wifi since all of the printers we've produced use those. Given that, is there reason to avoid uploading firmware, iap, and dwc bins and running m997 s0:1:2 every time the user runs the update script regardless of version number?
-
Flash memory does wear out, but unless you're doing it every other minute it shouldn't matter much I recon - on the other hand you have Murphys law.
(Edit: To compliment dc42 below; Winbond says 100,000 cycles for their W25Q32 flash, which is used in the genuine ESP12S from AI-Thinker; knock-offs may have less durable flash but thats not a problem with genuine Duets)
-
@roseg0ld said in Updating firmware with HTTP Requests:
@dc42 for now I'm only confronting the Duet Wifi since all of the printers we've produced use those. Given that, is there reason to avoid uploading firmware, iap, and dwc bins and running m997 s0:1:2 every time the user runs the update script regardless of version number?
The only possible issue I see with that is wearing out the flash memory on the WiFi module. Unfortunately I haven't seen a specification for how many erase cycles the flash memory in the ESP-12S module can survive.
The SAM4E microcontroller on the Duet WiFi is rated to 10000 erase cycles.