uOTA firmware update and docker file

This commit is contained in:
Arne Zachlod 2025-02-25 17:44:51 +01:00
parent 0014f3558c
commit 8b6dbfd9ca
6 changed files with 49 additions and 0 deletions

21
create_firmware_update.sh Executable file
View file

@ -0,0 +1,21 @@
#!/bin/sh
if [ -z "$1" ]
then
echo "no argument found, first argument should be version number, e.g.: ./create_firmware_update.sh 3.43.23"
exit 1
fi
tar -czf firmware_update/firmware.tar.gz main.py
checksum=$(sha256sum firmware_update/firmware.tar.gz | cut -d ' ' -f 1)
# write new line into firmware_update/latest file
# example line:
# 2.0.1;firmware.tar.gz;0;8870f8b3bd8b54437f0a7f721cd3f3fe208e60638dcf36a9f4efe31dab58c548
echo "$1;firmware.tar.gz;0;$checksum" >> firmware_update/latest
echo "new latest file:"
cat firmware_update/latest

View file

@ -0,0 +1,9 @@
services:
nginx:
image: nginx:mainline-bookworm
restart: unless-stopped
volumes:
- ./nginx.conf:/etc/nginx/conf.d/default.conf:ro
- /home/arne/hacks/mpy_sdlogger/firmware_update:/data:ro
ports:
- 8090:80

11
docker/nginx.conf Normal file
View file

@ -0,0 +1,11 @@
server {
listen 80 default_server;
server_name _;
client_max_body_size 100M;
root /data/;
location = /favicon.ico { access_log off; log_not_found off; }
location = /robots.txt { access_log off; log_not_found off; }
}

1
firmware_update/latest Normal file
View file

@ -0,0 +1 @@
0.0.1;firmware.tar.gz;0;85cea451eec057fa7e734548ca3ba6d779ed5836a3f9de14b8394575ef0d7d8e

6
uota.cfg Normal file
View file

@ -0,0 +1,6 @@
{
'url': 'https://fw.sorglosinternet.de:8090/sdlogger/',
'tmp_filename': 'new_fw.tar.gz',
'excluded_files': [],
'delete': [],
}

1
version Normal file
View file

@ -0,0 +1 @@
0.0.1