Some time ago I struggled over the unstable OTA with LN882H when using Firefox browser.
If you are interested in the whole story, you can read most of it following this post:
https://www.elektroda.com/rtvforum/topic4028087-240.html#21312889
It turned out, there was an issue with the SDKs OTA code and, since OBK uses the OTA code slightly differently, the buffer could be filled with more data than the code expected. And accessing memory outside the allocated space is usually no good idea
It took me several days to find the culprit and so I spent quite some time looking to the OTA code.
Since I also made basic tests to verify the operation, I learned it's "only" sending an HTTP POST request to the according page of the device.
And this led to the question, if you always need the (very useful) Web App, "only" to do an update?
O.k, you may ask, why not? I often use a single connection to the device with no internet, so in order to use the App, you need to "host" it locally (e.g. with a docker installation).
Since newer Browsers all support "fetch()", I could do a simple addition to the OTA page to upload the firmware.
It's not so comfortable like using drag and drop in the App, there is no check for the file provided - but in the end it provides a very simple solution.
For now I could only test on the devices I own: LN882H, BK7231N, ESP32 and W800 (I added OTA for W800 while at it
.
Test for other platforms would be great.
The actual pull request is here:
https://github.com/openshwprojects/OpenBK7231T_App/pull/1471
Seeing it in action on a W800
PS: Since W800 code seems to have a simmilar problem like the LN882H code which needed some changes, I'm quite sure, this will be also an issue with W600. But since I don't own one, I didn't made changes here.
Maybe in a seperate PR
If you are interested in the whole story, you can read most of it following this post:
https://www.elektroda.com/rtvforum/topic4028087-240.html#21312889
It turned out, there was an issue with the SDKs OTA code and, since OBK uses the OTA code slightly differently, the buffer could be filled with more data than the code expected. And accessing memory outside the allocated space is usually no good idea

It took me several days to find the culprit and so I spent quite some time looking to the OTA code.
Since I also made basic tests to verify the operation, I learned it's "only" sending an HTTP POST request to the according page of the device.
And this led to the question, if you always need the (very useful) Web App, "only" to do an update?
O.k, you may ask, why not? I often use a single connection to the device with no internet, so in order to use the App, you need to "host" it locally (e.g. with a docker installation).
Since newer Browsers all support "fetch()", I could do a simple addition to the OTA page to upload the firmware.
<p>Upload firmware file for OTA - !!!Be aware, no file check is done!!!<p>
<input id='otafile' type='file'> <input type='button' class='bred' onclick='doota();' value='DO OTA - No file check - reboot after OTA'>
<script>
function doota(){
var input = document.getElementById('otafile');
if (input.files[0]){
fetch('/api/ota', {
method: 'POST',
body: input.files[0]}
).then((resp) => {
if(resp.ok){
console.log('ota successfull; rebooting');
fetch('/index?restart=1');
}
else console.log('ota not successfull');
}
}
else alert('no file selected')
}
</script>
It's not so comfortable like using drag and drop in the App, there is no check for the file provided - but in the end it provides a very simple solution.
For now I could only test on the devices I own: LN882H, BK7231N, ESP32 and W800 (I added OTA for W800 while at it

Test for other platforms would be great.
The actual pull request is here:
https://github.com/openshwprojects/OpenBK7231T_App/pull/1471
Seeing it in action on a W800
PS: Since W800 code seems to have a simmilar problem like the LN882H code which needed some changes, I'm quite sure, this will be also an issue with W600. But since I don't own one, I didn't made changes here.
Maybe in a seperate PR
Cool? Ranking DIY