Note 1:
This Project has some errors which asked here:
Note 2:
Based on the timemage answer, I have changed the address of
bin
andTXT
file by finding the download link of those files form the GitHub. And it has been working by changing theblob
part of address toraw
, so the bin address changed formhttps://github.com/soheilpaper/ota_github_blink/blob/main/BlinkWithoutDelay_ino_esp8285.bin
tohttps://github.com/soheilpaper/ota_github_blink/raw/main/BlinkWithoutDelay_ino_esp8285.bin
And thehttps://github.com/soheilpaper/ota_github_blink/blob/main/version.txt
tohttps://raw.githubusercontent.com/soheilpaper/ota_github_blink/main/version.txt
And now that error has been fixed as you can see below:
Although I gave some dupt about upgrading the main code by getting this output via serial port:
Device already on latest firmware version
And I would check it after some resting!.
First you need to do these steps:
1- the file made for the target codes as version.txt file with the Above amount (2.0 here):
const String FirmwareVer={"2.0"};//{"1.8"};
you need to build this file via the Arduino target project at your GitHub repo as you can see below:
#define URL_fw_Version "https://github.com/soheilpaper/ota_github_blink/blob/main/version.txt"
3- you need to create the .bin file of your Arduino project like shown below and upload the bin file to your GitHub project and give its URL_fw_Bin as the target program to be updated automatically to Arduino board:
#define URL_fw_Bin "https://github.com/soheilpaper/ota_github_blink/blob/main/BlinkWithoutDelay.ino.esp8285.bin" //"https://raw.githubusercontent.com/programmer131/otaFiles/master/firmware.bin"
4- Finally upload the main code (GitHub_OTA Codes) to Arduino as you can see below:
Also, you can test it by this video:
ESP8266 Self Update OTA from Github
##Other methods:
There are some other methods described here:
- Serverless Continuous Integration and OTA update flow for IoT devices using Google Cloud Build and Arduino
Thanks for your attention.