Updated tag OTA (#193)

This commit is contained in:
Jonas Niesner
2024-01-06 21:16:48 +01:00
committed by GitHub
parent b0cfa1b2b4
commit b68cd22eb1
4 changed files with 119 additions and 118 deletions

View File

@@ -21,11 +21,6 @@ jobs:
with:
python-version: '3.9'
# - name: Zip web files
# run: |
# cd /home/runner/work/OpenEPaperLink/OpenEPaperLink/ESP32_AP-Flasher
# python gzip_wwwfiles.py
# - name: Commit zipped files
# run: |
# git config --global user.name 'Bot'
@@ -38,19 +33,6 @@ jobs:
- name: Install intelhex
run: pip install --upgrade intelhex
# - name: Build NRF firmware
# run: |
# cd ARM_Tag_FW/Newton_M3_nRF52811
# pio run --environment Newton_M3_22_BWR
# pio run --environment Newton_M3_29_BWR
# pio run --environment Newton_M3_75_BWR
# cp Newton_M3_22_BWR-ota.bin /home/runner/work/OpenEPaperLink/OpenEPaperLink/binaries/Newton_M3_22_BWR-ota.bin
# cp Newton_M3_22_BWR-full-flash.bin /home/runner/work/OpenEPaperLink/OpenEPaperLink/binaries/Newton_M3_22_BWR-full-flash.bin
# cp Newton_M3_29_BWR-ota.bin /home/runner/work/OpenEPaperLink/OpenEPaperLink/binaries/Newton_M3_29_BWR-ota.bin
# cp Newton_M3_29_BWR-full-flash.bin /home/runner/work/OpenEPaperLink/OpenEPaperLink/binaries/Newton_M3_29_BWR-full-flash.bin
# cp Newton_M3_75_BWR-ota.bin /home/runner/work/OpenEPaperLink/OpenEPaperLink/binaries/Newton_M3_75_BWR-ota.bin
# cp Newton_M3_75_BWR-full-flash.bin /home/runner/work/OpenEPaperLink/OpenEPaperLink/binaries/Newton_M3_75_BWR-full-flash.bin
- name: Install esptool
run: pip install esptool
@@ -58,6 +40,11 @@ jobs:
- name: create folders
run: |
mkdir espbinaries
- name: Zip web files
run: |
cd /home/runner/work/OpenEPaperLink/OpenEPaperLink/ESP32_AP-Flasher
python gzip_wwwfiles.py
- name: Build firmware for Simple_AP
run: |
@@ -149,6 +136,15 @@ jobs:
cp OpenEPaperLink_Nano_AP/firmware.bin espbinaries/OpenEPaperLink_Nano_AP.bin
cp OpenEPaperLink_Nano_AP/merged-firmware.bin espbinaries/OpenEPaperLink_Nano_AP_full.bin
- name: generate release json file
run: |
mkdir jsonfiles
python genfilelist.py ${{ github.ref_name }} $GITHUB_REPOSITORY $GITHUB_SHA
- name: move files for big APs
run: |
cp -a binaries/ESP32-C6/. ESP32_AP-Flasher/data/
- name: Build firmware for OpenEPaperLink_AP_and_Flasher
run: |
cd ESP32_AP-Flasher
@@ -185,6 +181,24 @@ jobs:
cp ESP32_S3_16_8_YELLOW_AP/firmware.bin espbinaries/ESP32_S3_16_8_YELLOW_AP.bin
cp ESP32_S3_16_8_YELLOW_AP/merged-firmware.bin espbinaries/ESP32_S3_16_8_YELLOW_AP_full.bin
- name: Build firmware for ESP32_S3_C6_NANO_AP
run: |
cd ESP32_AP-Flasher
export PLATFORMIO_BUILD_FLAGS="-D BUILD_VERSION=${{ github.ref_name }} -D SHA=$GITHUB_SHA"
pio run --environment ESP32_S3_C6_NANO_AP
pio run --target buildfs --environment ESP32_S3_C6_NANO_AP
mkdir /home/runner/work/OpenEPaperLink/OpenEPaperLink/ESP32_S3_C6_NANO_AP
cp ~/.platformio/packages/framework-arduinoespressif32/tools/partitions/boot_app0.bin /home/runner/work/OpenEPaperLink/OpenEPaperLink/ESP32_S3_C6_NANO_AP/boot_app0.bin
cp .pio/build/ESP32_S3_C6_NANO_AP/firmware.bin /home/runner/work/OpenEPaperLink/OpenEPaperLink/ESP32_S3_C6_NANO_AP/firmware.bin
cp .pio/build/ESP32_S3_C6_NANO_AP/bootloader.bin /home/runner/work/OpenEPaperLink/OpenEPaperLink/ESP32_S3_C6_NANO_AP/bootloader.bin
cp .pio/build/ESP32_S3_C6_NANO_AP/partitions.bin /home/runner/work/OpenEPaperLink/OpenEPaperLink/ESP32_S3_C6_NANO_AP/partitions.bin
cp .pio/build/ESP32_S3_C6_NANO_AP/littlefs.bin /home/runner/work/OpenEPaperLink/OpenEPaperLink/ESP32_S3_C6_NANO_AP/littlefs.bin
cd /home/runner/work/OpenEPaperLink/OpenEPaperLink/ESP32_S3_C6_NANO_AP
esptool.py --chip esp32-s3 merge_bin -o merged-firmware.bin --flash_mode dio --flash_freq 80m --flash_size 16MB 0x0000 bootloader.bin 0x8000 partitions.bin 0xe000 boot_app0.bin 0x10000 firmware.bin 0x00910000 littlefs.bin
cd /home/runner/work/OpenEPaperLink/OpenEPaperLink
cp ESP32_S3_C6_NANO_AP/firmware.bin espbinaries/ESP32_S3_C6_NANO_AP.bin
cp ESP32_S3_C6_NANO_AP/merged-firmware.bin espbinaries/ESP32_S3_C6_NANO_AP_full.bin
- name: Build firmware for OpenEPaperLink_PoE_AP
run: |
cd ESP32_AP-Flasher
@@ -203,11 +217,6 @@ jobs:
cp OpenEPaperLink_PoE_AP/firmware.bin espbinaries/OpenEPaperLink_PoE_AP.bin
cp OpenEPaperLink_PoE_AP/merged-firmware.bin espbinaries/OpenEPaperLink_PoE_AP_full.bin
- name: generate release json file
run: |
mkdir jsonfiles
python genfilelist.py ${{ github.ref_name }} $GITHUB_REPOSITORY $GITHUB_SHA
- name: Add file lists to release
uses: svenstaro/upload-release-action@v2
with:
@@ -216,16 +225,7 @@ jobs:
tag: ${{ github.ref }}
file_glob: true
overwrite: true
# - name: Add tag bins to release
# uses: svenstaro/upload-release-action@v2
# with:
# repo_token: ${{ secrets.GITHUB_TOKEN }}
# file: binaries/*
# tag: ${{ github.ref }}
# file_glob: true
# overwrite: true
# this is down here intentionally to be able to modify the binary folder before adding it to the Tag_Flasher later (ota binaries can be removed)
- name: Build firmware for Tag_Flasher
@@ -254,27 +254,3 @@ jobs:
tag: ${{ github.ref }}
file_glob: true
overwrite: true
# - name: Add www folder to release
# uses: svenstaro/upload-release-action@v2
# with:
# repo_token: ${{ secrets.GITHUB_TOKEN }}
# file: ESP32_AP-Flasher/data/www/*
# tag: ${{ github.ref }}
# file_glob: true
# - name: Add fonts folder to release
# uses: svenstaro/upload-release-action@v2
# with:
# repo_token: ${{ secrets.GITHUB_TOKEN }}
# file: ESP32_AP-Flasher/data/fonts/*
# tag: ${{ github.ref }}
# file_glob: true
# - name: Add data folder to release
# uses: svenstaro/upload-release-action@v2
# with:
# repo_token: ${{ secrets.GITHUB_TOKEN }}
# file: ESP32_AP-Flasher/data/*
# tag: ${{ github.ref }}
# file_glob: true

View File

@@ -557,32 +557,28 @@ $('#cfgreset').onclick = function () {
}
$('#cfgautoupdate').onclick = async function() {
if(confirm("Every OTA update comes with a risk of bricking the tag, if it is bricked, it only can be recoverd with a tag flasher. Please only update if you need the new features. Press Cancel if you do not want to update, press OK if you want to update")){
let obj = {};
let formData = new FormData();
formData.append("mac", $('#cfgmac').dataset.mac);
formData.append("alias", $('#cfgalias').value);
var repo = apConfig.repo || 'jjwbruijn/OpenEPaperLink';
var infourl = "https://raw.githubusercontent.com/" + repo + "/master/binaries/Tag/info.json";
var infourl = "https://raw.githubusercontent.com/" + repo + "/master/binaries/Tag/tagotaversions.json";
var info = "";
await fetch(infourl, {
method: 'GET'
})
.then(function(response) {
return response.json();
})
.then(function(json) {
info = json;
});
await fetch(infourl, { method: 'GET' }).then(await function(response) { return response.json(); }).then(await function(json) { info = json; });
var mac = $('#cfgmac').dataset.mac;
var tagtype = ("0" + (Number($('#tag' + mac).dataset.hwtype).toString(16))).slice(-2).toUpperCase();
var name = info[0].types[tagtype];
var version = info[0].version[tagtype];
var md5 = info[0].md5[tagtype];
var name = info[0][tagtype]["type"];
if(name == ""){
alert("Tag id not known");
return false;
}
var version = info[0][tagtype]["version"];
var md5 = info[0][tagtype]["md5"];
var fullFilename = name + "_" + version + ".bin";
var filepath = "/" + fullFilename;
var binurl = "https://raw.githubusercontent.com/" + repo + "/master/binaries/Tag/" + filepath;
var binurl = "https://raw.githubusercontent.com/" + repo + "/master/binaries/Tag/" + fullFilename;
var url = "/check_file?path=" + encodeURIComponent(filepath);
var response = await fetch(url);
if (response.ok) {
@@ -628,6 +624,7 @@ $('#cfgautoupdate').onclick = async function() {
.then(response => response.text())
.then(data => showMessage(data))
.catch(error => showMessage('Error: ' + error));
}
}
$('#rebootbutton').onclick = function (event) {

View File

@@ -1,46 +0,0 @@
[
{
"types": {
"00": "SOL_M2_154_SSD",
"01": "SOL_M2_29_SSD",
"02": "SOL_M2_42_SSD",
"05": "SOL_M2_75_ota",
"11": "SOL_M2_29_UC",
"21": "SOL_M2_29_LT",
"2E": "SOL_M3_Uni_ota",
"2F": "SOL_M3_Uni_ota",
"31": "SOL_M3_Uni_ota",
"33": "SOL_M3_Uni_ota",
"35": "SOL_M3_Uni_ota",
"36": "SOL_M3_Uni_ota"
},
"version": {
"00": "25",
"01": "25",
"02": "25",
"05": "04",
"11": "25",
"21": "25",
"2E": "26",
"2F": "26",
"31": "26",
"33": "26",
"35": "26",
"36": "26"
},
"md5": {
"00": "57e02f80c9f2581be0a140979b1124e1",
"01": "bed1a20ca6af04e29e5aabce480c1e9d",
"02": "80e36c7d4d08beaca8ad2f00f42923d0",
"05": "26c058db1f14c7ee2f301283bcbe7c9d",
"11": "0c692cfca683948efeb3501a00c8f8bd",
"21": "8ebc88f2a8de187a81d2f7c4c39b0d8e",
"2E": "d234e395a8441779caa2df75ca9a508d",
"2F": "d234e395a8441779caa2df75ca9a508d",
"31": "d234e395a8441779caa2df75ca9a508d",
"33": "d234e395a8441779caa2df75ca9a508d",
"35": "d234e395a8441779caa2df75ca9a508d",
"36": "d234e395a8441779caa2df75ca9a508d"
}
}
]

View File

@@ -0,0 +1,74 @@
[
{
"00" : {
"type": "SOL_M2_154_SSD",
"version": "25",
"md5": "57e02f80c9f2581be0a140979b1124e1"
},
"01" : {
"type": "SOL_M2_29_SSD",
"version": "25",
"md5": "bed1a20ca6af04e29e5aabce480c1e9d"
},
"02" : {
"type": "SOL_M2_42_SSD",
"version": "25",
"md5": "80e36c7d4d08beaca8ad2f00f42923d0"
},
"05" : {
"type": "SOL_M2_75_ota",
"version": "04",
"md5": "26c058db1f14c7ee2f301283bcbe7c9d"
},
"11" : {
"type": "SOL_M2_29_UC",
"version": "25",
"md5": "0c692cfca683948efeb3501a00c8f8bd"
},
"21" : {
"type": "SOL_M2_29_LT",
"version": "25",
"md5": "8ebc88f2a8de187a81d2f7c4c39b0d8e"
},
"2E" : {
"type": "SOL_M3_Uni_ota",
"version": "26",
"md5": "d234e395a8441779caa2df75ca9a508d"
},
"2F" : {
"type": "SOL_M3_Uni_ota",
"version": "26",
"md5": "d234e395a8441779caa2df75ca9a508d"
},
"30" : {
"type": "SOL_M3_Uni_ota",
"version": "26",
"md5": "d234e395a8441779caa2df75ca9a508d"
},
"31" : {
"type": "SOL_M3_Uni_ota",
"version": "26",
"md5": "d234e395a8441779caa2df75ca9a508d"
},
"33" : {
"type": "SOL_M3_Uni_ota",
"version": "26",
"md5": "d234e395a8441779caa2df75ca9a508d"
},
"34" : {
"type": "SOL_M3_Uni_ota",
"version": "26",
"md5": "d234e395a8441779caa2df75ca9a508d"
},
"35" : {
"type": "SOL_M3_Uni_ota",
"version": "26",
"md5": "d234e395a8441779caa2df75ca9a508d"
},
"36" : {
"type": "SOL_M3_Uni_ota",
"version": "26",
"md5": "d234e395a8441779caa2df75ca9a508d"
}
}
]