@pixie_dustGizmonster!? Been called all sorts but that's a first! Is that a scary clown emoji...wtf?
Sorry all for late response been busy.
lol... is this by any chance that screenshot? ;-)
uh, OTA is nothing special really I thought everyone has figured that out so I didn't bother writing anything about it :-p
I mean, I use predominantly ESPs so it's literally few lines of code. The only thing you really need is somewhere to temporarily upload the bin file and I trigger the ota manually from the ChipChop WebApp
I have made a simple class "ChipChop_ota" for ESPs using esp-idf "HTTPUpdate.h" and I'll post the code at the end but you can make your own it's really simple
Here is what I do:
Steps 1. In the Dev Console I add to every device I want to be able to do an OTA an extra component called
ota | type
text | mode
interactive2. Here's all I add in the main Arduino file
#include <chipchop_ota.h>
ChipChop_OTA ChipChop_ota;
String _OTA_VERSION = "1.0"; //change this every time you are creating a new ota update
void ChipChop_onCommandReceived(String target, String value, String source, int command_age){
//blah blah some commands actions here
if(target == "ota"){ //that's the component I've made in the Dev Console
ChipChop_ota.downloadUpdate(value);
}
}
void setup(){
....whatever setup stuff you need
// only needs to happen once when the device wakes up and it's really only to see in the WebApp/Dev Console which version it's running
ChipChop.updateStatus("ota", _OTA_VERSION);
}
3. Generate your update .bin file (I use PlatformIO) and make sure to change the _OTA_VERSION in the code so you can tell it's been updated
4. Upload the bin file somewhere. A little caveat though, I couldn't get this to work with https:// in like 30 seconds (needed it in a rush) so the little library only works with files accessible through plain old
http://This may sound like not a problem but if you are using basic/free hosting many servers will try and redirect all traffic to https:// automatically.
5. Open the ChipChop WebApp (can do it in the browser) https://my.chipchop.io, select the device and click on the "Send Command" button next to the "ota" component and type the full url to the .bin file
something like:
http://someserver.com/somefolder/your_bin_file.bin and press send.
6. The WebApp will send a command to ChipChop library on your device which will trigger the callback on the "ota" component with the value of the url and then pass that value to the little ota library which will start the download & update process automatically.
You should see straight away in the WebApp that the update has started or if there are any errors and once the update is complete the ESP will restart automatically and once it connects back to ChipChop (be patient) the ota component will show whatever you've specified as _OTA_VERSION in your code.
That's it pretty much it, I'll add the library code in the next post