From 498eb5b42063ff47dfc7c8d0a9579869a17f1a2c Mon Sep 17 00:00:00 2001 From: Thomas Farstrike Date: Thu, 9 Oct 2025 19:14:44 +0200 Subject: [PATCH] Add missing files due to exclude --- .gitignore | 1 - scripts/build_all.sh | 20 +++++++++++ scripts/capture_webcam.sh | 1 + scripts/core_dump_activate.sh | 9 +++++ scripts/grayscale.raw_to_png.sh | 1 + scripts/release_to_install.sh | 14 ++++++++ scripts/release_to_updates.sh | 15 +++++++++ scripts/run_desktop.sh | 60 +++++++++++++++++++++++++++++++++ scripts/start_presentation.sh | 6 ++++ 9 files changed, 126 insertions(+), 1 deletion(-) create mode 100755 scripts/build_all.sh create mode 100755 scripts/capture_webcam.sh create mode 100755 scripts/core_dump_activate.sh create mode 100755 scripts/grayscale.raw_to_png.sh create mode 100755 scripts/release_to_install.sh create mode 100755 scripts/release_to_updates.sh create mode 100755 scripts/run_desktop.sh create mode 100755 scripts/start_presentation.sh diff --git a/.gitignore b/.gitignore index 67a2e5b3..45013b9e 100644 --- a/.gitignore +++ b/.gitignore @@ -1,6 +1,5 @@ trash/ -*.sh conf.json* # auto created when running on desktop: diff --git a/scripts/build_all.sh b/scripts/build_all.sh new file mode 100755 index 00000000..5522e2ba --- /dev/null +++ b/scripts/build_all.sh @@ -0,0 +1,20 @@ +builddir=../lvgl_micropython/build +outdir=../build_outputs + +buildfile="$builddir"/lvgl_micropy_ESP32_GENERIC_S3-SPIRAM_OCT-16.bin + +#./scripts/build_lvgl_micropython.sh esp32 dev fri3d-2024 +#cp "$buildfile" "$outdir"/MicroPythonOS_fri3d-2024_dev + +./scripts/build_lvgl_micropython.sh esp32 prod fri3d-2024 +cp "$buildfile" "$outdir"/MicroPythonOS_fri3d-2024_prod + +./scripts/build_lvgl_micropython.sh unix dev +cp "$builddir"/lvgl_micropy_unix "$outdir"/MicroPythonOS_amd64_Linux + +./scripts/build_lvgl_micropython.sh esp32 prod waveshare-esp32-s3-touch-lcd-2 +cp "$buildfile" "$outdir"/MicroPythonOS_waveshare-esp32-s3-touch-lcd-2_prod + +./scripts/build_lvgl_micropython.sh esp32 dev waveshare-esp32-s3-touch-lcd-2 +cp "$buildfile" "$outdir"/MicroPythonOS_waveshare-esp32-s3-touch-lcd-2_dev + diff --git a/scripts/capture_webcam.sh b/scripts/capture_webcam.sh new file mode 100755 index 00000000..dd464446 --- /dev/null +++ b/scripts/capture_webcam.sh @@ -0,0 +1 @@ +mplayer tv:// -tv driver=v4l2:device=/dev/video0 diff --git a/scripts/core_dump_activate.sh b/scripts/core_dump_activate.sh new file mode 100755 index 00000000..79488558 --- /dev/null +++ b/scripts/core_dump_activate.sh @@ -0,0 +1,9 @@ +# you want this not stripped: +# file ~/projects/MicroPythonOS/lvgl_micropython/build/lvgl_micropy_unix +# ~/projects/MicroPythonOS/lvgl_micropython/build/lvgl_micropy_unix: ELF 64-bit LSB pie executable, x86-64, version 1 (SYSV), dynamically linked, interpreter /lib64/ld-linux-x86-64.so.2, BuildID[sha1]=f5c2fd31fd06ac76f9ba4eb031b383dfbc3a1b3c, for GNU/Linux 3.2.0, with debug_info, not stripped +# +# To get that, run it with STRIP= and maybe also that LV_CFLAGS: +# python3 make.py "$target" LV_CFLAGS="-g -O0 -ggdb" STRIP= DISPLAY=sdl_display INDEV=sdl_pointer INDEV=sdl_keyboard "$manifest" + +ulimit -c unlimited +sudo sysctl -w kernel.core_pattern=/tmp/core.%p diff --git a/scripts/grayscale.raw_to_png.sh b/scripts/grayscale.raw_to_png.sh new file mode 100755 index 00000000..ea33d51e --- /dev/null +++ b/scripts/grayscale.raw_to_png.sh @@ -0,0 +1 @@ +convert -size 240x240 -depth 8 gray:grayscale.raw grayscale.png diff --git a/scripts/release_to_install.sh b/scripts/release_to_install.sh new file mode 100755 index 00000000..de6caa6c --- /dev/null +++ b/scripts/release_to_install.sh @@ -0,0 +1,14 @@ +newversion="$1" + +if [ -z "$newversion" ]; then + echo "$0 newversion" + exit 1 +fi + +cd ~/projects/MicroPythonOS/install +cp ~/projects/MicroPythonOS/lvgl_micropython/build/lvgl_micropy_ESP32_GENERIC_S3-SPIRAM_OCT-16.bin firmware_images/Waveshare/ESP32-S3-Touch-LCD-2/Waveshare_ESP32-S3-Touch-LCD-2_$newversion.bin +echo "Now update manifests/Waveshare/ESP32-S3-Touch-LCD-2/Waveshare_ESP32-S3-Touch-LCD-2.json and push it." + + + + diff --git a/scripts/release_to_updates.sh b/scripts/release_to_updates.sh new file mode 100755 index 00000000..9c73ac29 --- /dev/null +++ b/scripts/release_to_updates.sh @@ -0,0 +1,15 @@ +newversion="$1" + +if [ -z "$newversion" ]; then + echo "$0 newversion" + exit 1 +fi + +pushd ~/projects/MicroPythonOS/updates/ +cp ~/projects/MicroPythonOS/lvgl_micropython/lib/micropython/ports/esp32/build-ESP32_GENERIC_S3-SPIRAM_OCT/micropython.bin releases/Waveshare/ESP32-S3-Touch-LCD-2/Waveshare_ESP32-S3-Touch-LCD-2_$newversion.bin +echo "Now update osupdate.json and push it." +popd + + + + diff --git a/scripts/run_desktop.sh b/scripts/run_desktop.sh new file mode 100755 index 00000000..94041abc --- /dev/null +++ b/scripts/run_desktop.sh @@ -0,0 +1,60 @@ +script="$1" +if [ -f "$script" ]; then + script=$(readlink -f "$script") +fi + +echo "Usage:" +echo "$0 # with no arguments just starts it up normally" +echo "$0 scriptfile.py # doesn't initialize anything, just runs scriptfile.py directly" +echo "$0 appname # starts the app by appname, for example: com.example.helloworld" + +#export SDL_WINDOW_FULLSCREEN=true + +#export HEAPSIZE=8M # 9MB is not enough for slides, 10MB is okay for 5, 16 for 10, 64 for 100s +#export HEAPSIZE=9M # 9MB is not enough for slides, 10MB is okay for 5, 16 for 10, 64 for 100s +#export HEAPSIZE=10M # 9MB is not enough for slides, 10MB is okay for 5, 16 for 10, 64 for 100s +#export HEAPSIZE=11M # 9MB is not enough for slides, 10MB is okay for 5, 16 for 10, 64 for 100s +#export HEAPSIZE=12M # 9MB is not enough for slides, 10MB is okay for 5, 16 for 10, 64 for 100s +#export HEAPSIZE=13M # 9MB is not enough for slides, 10MB is okay for 5, 16 for 10, 64 for 100s +#export HEAPSIZE=14M # 9MB is not enough for slides, 10MB is okay for 5, 16 for 10, 64 for 100s +#export HEAPSIZE=15M # 9MB is not enough for slides, 10MB is okay for 5, 15 ok for all + +# 15 works infinite with 8 images +# 12 seems to work fine with all images now, doing only gc.collect() +# 10-11 works infinite with 7 images but as soon as I add the next one (big PNG slide 2) it hangs memory alloc + +# Makes semse because the error is: +# MemoryError: memory allocation failed, allocating 2518043 bytes +# So every new slide needs 2.5MB extra RAM! + +# Fixed by adding lv.image.cache_drop(None) # This helps a lot! + +# Now it works with 10M with infinite slides! + +# Now not anymore... let's try increasing it. +#export HEAPSIZE=20M # this is fine for 1024x576 +#export HEAPSIZE=15M # fine too + +export HEAPSIZE=32M # for 1280x720 images in the image viewer +export HEAPSIZE=128M # for 1280x720 images in the image viewer + +pushd internal_filesystem/ + if [ -f "$script" ]; then + /home/user/projects/MicroPythonOS/lvgl_micropython/build/lvgl_micropy_unix -v -i "$script" + elif [ ! -z "$script" ]; then # it's an app name + scriptdir="apps/$script" + if [ ! -d "$scriptdir" ]; then + scriptdir="builtin/apps/$script" + fi + if [ ! -d "$scriptdir" ]; then + echo "ERROR: no app found by the name '$script'" + exit 1 + fi + echo "Running app from $scriptdir" + /home/user/projects/MicroPythonOS/lvgl_micropython/build/lvgl_micropy_unix -X heapsize=$HEAPSIZE -v -i -c "$(cat boot_unix.py main.py) ; import mpos.apps; mpos.apps.start_app('$scriptdir')" + else + /home/user/projects/MicroPythonOS/lvgl_micropython/build/lvgl_micropy_unix -X heapsize=$HEAPSIZE -v -i -c "$(cat boot_unix.py main.py)" + fi + + +popd diff --git a/scripts/start_presentation.sh b/scripts/start_presentation.sh new file mode 100755 index 00000000..f5a85971 --- /dev/null +++ b/scripts/start_presentation.sh @@ -0,0 +1,6 @@ +~/bin/set_1280x720.sh +export SDL_WINDOW_FULLSCREEN=true + +./scripts/run_desktop.sh + +