Skip to content

Commit 02d9c3e

Browse files
Fix OSUpdate
1 parent 6301d7a commit 02d9c3e

2 files changed

Lines changed: 7 additions & 7 deletions

File tree

internal_filesystem/apps/com.example.osupdate/assets/osupdate.py

Lines changed: 6 additions & 7 deletions
Original file line numberDiff line numberDiff line change
@@ -3,22 +3,21 @@
33
from esp32 import Partition
44
import urequests
55

6-
76
subwindow.clean()
87
canary = lv.obj(subwindow)
98
canary.add_flag(lv.obj.FLAG.HIDDEN)
109

11-
1210
import ota.status
1311
ota.status.status()
1412
current = Partition(Partition.RUNNING)
1513
current
16-
current.get_next_update()
14+
next_partition = current.get_next_update()
15+
next_partition
1716

18-
# Initialize LVGL display (assuming setup is done)
1917
label = lv.label(subwindow)
20-
label.set_text("OTA Update: 0.00%")
18+
label.set_text("OS Update: 0.00%")
2119
label.align(lv.ALIGN.CENTER, 0, -30)
20+
2221
progress_bar = lv.bar(subwindow)
2322
progress_bar.set_size(200, 20)
2423
progress_bar.align(lv.ALIGN.BOTTOM_MID, 0, -50)
@@ -29,7 +28,7 @@
2928
def update_with_lvgl(url):
3029
def progress_callback(percent):
3130
print(f"OTA Update: {percent:.1f}%")
32-
label.set_text(f"OTA Update: {percent:.2f}%") # Cloud upload symbol
31+
label.set_text(f"OTA Update: {percent:.2f}%")
3332
progress_bar.set_value(int(percent), lv.ANIM.ON)
3433
current = Partition(Partition.RUNNING)
3534
next_partition = current.get_next_update()
@@ -59,4 +58,4 @@ def progress_callback(percent):
5958
machine.reset()
6059

6160
# Start OTA update
62-
update_with_lvgl("http://demo.lnpiggy.com:2121/ESP32_GENERIC_S3-SPIRAM_OCT_micropython.bin")
61+
update_with_lvgl("http://demo.lnpiggy.com:2121/latest.bin")

internal_filesystem/main.py

Lines changed: 1 addition & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -1,4 +1,5 @@
11
# Constants
2+
CURRENT_VERSION = "0.0.1"
23
TFT_HOR_RES=320
34
TFT_VER_RES=240
45
NOTIFICATION_BAR_HEIGHT=24

0 commit comments

Comments
 (0)