diff --git a/internal_filesystem/builtin/apps/com.example.wificonf/META-INF/MANIFEST.MF b/internal_filesystem/builtin/apps/com.example.wificonf/META-INF/MANIFEST.MF index 39a23cc8..27d2d7d3 100644 --- a/internal_filesystem/builtin/apps/com.example.wificonf/META-INF/MANIFEST.MF +++ b/internal_filesystem/builtin/apps/com.example.wificonf/META-INF/MANIFEST.MF @@ -1,3 +1,5 @@ Manifest-Version: 1.0 Name: WiFiConf Start-Script: assets/wificonf.py +WiFi-Connect-Script: assets/auto_connect.py +WiFi-Configure-Script: assets/wificonf.py diff --git a/internal_filesystem/main.py b/internal_filesystem/main.py index 98a8f28d..92a1f72c 100644 --- a/internal_filesystem/main.py +++ b/internal_filesystem/main.py @@ -355,17 +355,28 @@ def start_app(app_dir, is_launcher=False): # Execute this if it exists execute_script_new_thread("/autorun.py", True, False, False) -# A generic "start at boot" mechanism hasn't been implemented yet, so do it like this: -execute_script_new_thread("/builtin/apps/com.example.wificonf/assets/auto_connect.py", True, False, False) - - try: import freezefs_mount_builtin except Exception as e: print("/main.py: WARNING: could not import/run freezefs_mount_builtin: ", e) -# The launcher might have been updated from the builtin one, so check that: + +# A generic "start at boot" mechanism hasn't been implemented yet, so do it like this: import uos +custom_auto_connect = "/apps/com.example.wificonf/assets/auto_connect.py" +builtin_auto_connect = "/builtin/apps/com.example.wificonf/assets/auto_connect.py" +try: + stat = uos.stat(custom_auto_connect) + execute_script_new_thread(custom_auto_connect, True, False, False) +except OSError: + try: + print(f"Couldn't execute {custom_auto_connect}, trying {builtin_auto_connect}...") + stat = uos.stat(builtin_auto_connect) + execute_script_new_thread(builtin_auto_connect, True, False, False) + except OSError: + print("Couldn't execute {builtin_auto_connect}, continuing...") + +# The launcher might have been updated from the builtin one, so check that: custom_launcher = "/apps/com.example.launcher" builtin_launcher = "/builtin/apps/com.example.launcher" try: diff --git a/manifest.py b/manifest.py index d6aacee4..549bfcea 100644 --- a/manifest.py +++ b/manifest.py @@ -1,4 +1,4 @@ freeze('internal_filesystem/', 'boot.py') # Hardware initialization freeze('internal_filesystem/', 'main.py') # User Interface initialization freeze('internal_filesystem/lib', '') # Additional libraries -freeze('/home/user/sources/freezeFS/', 'freezefs_mount.py') # Built-in apps +freeze('/home/user/sources/freezeFS/', 'freezefs_mount_builtin.py') # Built-in apps diff --git a/scripts/build_freezefs_mount_builtin.sh b/scripts/build_freezefs_mount_builtin.sh old mode 100644 new mode 100755 index 48c0ebe8..9bab3f90 --- a/scripts/build_freezefs_mount_builtin.sh +++ b/scripts/build_freezefs_mount_builtin.sh @@ -1 +1,3 @@ +pushd ~/sources/freezeFS python3 -m freezefs --target /builtin --on-import mount ~/sources/PiggyOS/internal_filesystem/builtin freezefs_mount_builtin.py +popd diff --git a/scripts/build_lvgl_micropython.sh b/scripts/build_lvgl_micropython.sh old mode 100644 new mode 100755 index c8b50f5d..6bca2655 --- a/scripts/build_lvgl_micropython.sh +++ b/scripts/build_lvgl_micropython.sh @@ -3,4 +3,4 @@ # --partition size: both OTA partitions are 4MB # --flash-size: total flash size is 16MB # -python3 make.py --ota --partition-size=4194304 --flash-size=16 esp32 BOARD=ESP32_GENERIC_S3 BOARD_VARIANT=SPIRAM_OCT DISPLAY=st7789 INDEV=cst816s USER_C_MODULE="/home/user/sources/micropython-camera-API/src/micropython.cmake" FROZEN_MANIFEST=manifest.py +python3 make.py --ota --partition-size=4194304 --flash-size=16 esp32 BOARD=ESP32_GENERIC_S3 BOARD_VARIANT=SPIRAM_OCT DISPLAY=st7789 INDEV=cst816s USER_C_MODULE="/home/user/sources/micropython-camera-API/src/micropython.cmake" FROZEN_MANIFEST=~/sources/PiggyOS/manifest.py diff --git a/scripts/flash_over_usb.sh b/scripts/flash_over_usb.sh old mode 100644 new mode 100755 index 1cd75513..bed5ca64 --- a/scripts/flash_over_usb.sh +++ b/scripts/flash_over_usb.sh @@ -1,4 +1,4 @@ -fwfile="build/lvgl_micropy_ESP32_GENERIC_S3-SPIRAM_OCT-16.bin" -ls -al "$fwfile" -~/.espressif/python_env/idf5.2_py3.9_env/bin/python -m esptool --chip esp32s3 --before default_reset --after hard_reset write_flash --flash_mode dio --flash_size 16MB --flash_freq 80m --erase-all 0x0 "$fwfile" +fwfile="/home/user/sources/lvgl_micropython/build/lvgl_micropy_ESP32_GENERIC_S3-SPIRAM_OCT-16.bin" +ls -al $fwfile +~/.espressif/python_env/idf5.2_py3.9_env/bin/python -m esptool --chip esp32s3 --before default_reset --after hard_reset write_flash --flash_mode dio --flash_size 16MB --flash_freq 80m --erase-all 0x0 $fwfile