Open Wolfieeewolf opened 1 year ago
I can easily write a script for you for this feature. In fact, there even may be one already on our forum....
https://www.elektroda.com/rtvforum/topic3963037.html
Auto update button is problematic because we don't support HTTPS on OBK to save flash memory.... so we can't directly query github... someone would have to offer a HTTP midleman that automatically fetches releases and hosts them...
Mass updating is usually not recommended, when the device is working well, there is no need to update it manually in most cases. We have some people testing new releases (our new contributor https://www.elektroda.com/rtvforum/uzytkownik3444192.html is also very active when it comes to testing), but we are not a company, so mistakes can slip.
Yes - I use curl like this to automatically update:
# initiate OTA on device 192.168.0.201
curl --data-binary "@f:\temp\OpenBK7231N_1.17.10.rbl" http://192.168.0.201/api/ota
# after receiving something like {"size":628960}, reboot
curl http://192.168.0.201/cm?cmnd=reboot
bash script for OTA
#!/bin/bash
# Usage: bash curl_ota.sh $1 $2
# $1 = firmware version, e.g.: 1.17.740
# $2 = part of the device's IP address, e.g.: 192.168.1.10
# sample: bash curl_ota.sh 1.17.740 192.168.1.10
# URL for the firmware
URL="https://github.com/openshwprojects/OpenBK7231T_App/releases/download/$1/OpenBK7231N_$1.rbl"
# Local firmware file name
FILE="./OpenBK7231N_$1.rbl"
# Check if the file exists
if [ -f "$FILE" ]; then
echo "File $FILE already exists, download is not required."
else
echo "File $FILE not found, starting download."
curl -L -o "$FILE" "$URL"
fi
# Send firmware to the device and capture the response
OTA_RESPONSE=$(curl --data-binary "@$FILE" "http://$2/api/ota")
# Check if the response contains the word "size" (indicating success)
if [[ "$OTA_RESPONSE" == *"size"* ]]; then
echo "OTA update successful, rebooting device."
curl "http://$2/cm?cmnd=reboot"
else
echo "OTA update failed or did not contain the expected response."
fi
Is it possible to incorporate an auto-update feature for releases? It would be very helpful if we could choose between stable and development builds and set the frequency of updates (daily, weekly, or monthly). Currently, updating my 20 devices is a tedious process and an automatic update would save me a lot of time.
Another suggestion could be to implement a one-button update feature that would update the device to the latest release version. Perhaps a Tasmo-Admin type interface could be used for this purpose, although I understand that setting it up may require a significant amount of effort.