Skip to content

Commit 8a64335

Browse files
wificonf: show more feedback to user
1 parent b93731e commit 8a64335

File tree

3 files changed

+26
-9
lines changed

3 files changed

+26
-9
lines changed

README.md

Lines changed: 13 additions & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -89,4 +89,16 @@ If you made a 'devbuild', then you probably want to install all files and apps m
8989
~/sources/PiggyOS/scripts/install.sh
9090
```
9191

92-
92+
Release checklist
93+
=================
94+
- Make sure CURRENT_OS_VERSION in main.py is incremented
95+
- Make sure version numbers of apps that have been changed are incremented
96+
- commit and push all code
97+
- ./scripts/bundle_apps.sh
98+
- ./scripts/freezefs_mount_builtin.sh
99+
- ./scripts/build_lvgl_micropython.sh
100+
- copy_apps_to_server.sh
101+
- copy_build_to_server.sh
102+
- copy ~/sources/lvgl_micropython/build/lvgl_micropy_ESP32_GENERIC_S3-SPIRAM_OCT-16.bin to webinstaller
103+
- update manifest of webinstaller
104+
- push webinstaller

internal_filesystem/builtin/apps/com.example.wificonf/assets/wificonf.py

Lines changed: 12 additions & 7 deletions
Original file line numberDiff line numberDiff line change
@@ -11,7 +11,6 @@
1111

1212
ssids=[]
1313
busy_scanning=False
14-
1514
busy_connecting=False
1615

1716
access_points={}
@@ -67,7 +66,7 @@ def save_config():
6766

6867
def scan_done_callback():
6968
print("scan_done_callback called")
70-
global busy_scanning, scan_button_label
69+
global busy_scanning, scan_button_label, scan_button
7170
refresh_list()
7271
scan_button_label.set_text(scan_button_scan_text)
7372
scan_button.add_flag(lv.obj.FLAG.CLICKABLE)
@@ -104,14 +103,18 @@ def start_scan_networks():
104103

105104
def attempt_connecting_done(ssid, result):
106105
print(f"Connecting to {ssid} got result: {result}")
107-
global busy_connecting
106+
global busy_connecting, scan_button_label, scan_button
108107
refresh_list(ssid, result)
109108
busy_connecting=False
109+
scan_button_label.set_text(scan_button_scan_text)
110+
scan_button.add_flag(lv.obj.FLAG.CLICKABLE)
111+
110112

111113
def attempt_connecting(ssid,password):
112114
print(f"attempt_connecting: Attempting to connect to SSID: {ssid}")
113115
result="connected"
114116
try:
117+
wlan.disconnect()
115118
wlan.connect(ssid,password)
116119
for i in range(10):
117120
if wlan.isconnected():
@@ -124,12 +127,14 @@ def attempt_connecting(ssid,password):
124127
except Exception as e:
125128
print(f"attempt_connecting: Connection error: {e}")
126129
result=f"{e}"
127-
show_error("Connection failed")
130+
show_error("Connecting to {ssid} failed!")
128131
attempt_connecting_done(ssid, result)
129132

130133
def start_attempt_connecting(ssid,password):
131134
print(f"start_attempt_connecting: Attempting to connect to SSID: {ssid}")
132-
global busy_connecting
135+
global busy_connecting, scan_button_label, scan_button
136+
scan_button.remove_flag(lv.obj.FLAG.CLICKABLE)
137+
scan_button_label.set_text(f"Connecting to {ssid}...")
133138
if busy_connecting:
134139
print("Not attempting connect because busy_connecting.")
135140
else:
@@ -274,7 +279,7 @@ def create_ui():
274279
global aplist,appscreen,error_label,scan_button_label,scan_button
275280
print("create_ui: Creating list widget")
276281
aplist=lv.list(appscreen)
277-
aplist.set_size(lv.pct(100),180)
282+
aplist.set_size(lv.pct(100),lv.pct(80))
278283
aplist.align(lv.ALIGN.TOP_MID,0,0)
279284
print("create_ui: Creating error label")
280285
error_label=lv.label(appscreen)
@@ -283,7 +288,7 @@ def create_ui():
283288
error_label.add_flag(lv.obj.FLAG.HIDDEN)
284289
print("create_ui: Creating Scan button")
285290
scan_button=lv.button(appscreen)
286-
scan_button.set_size(100,30)
291+
scan_button.set_size(lv.SIZE_CONTENT,lv.pct(15))
287292
scan_button.align(lv.ALIGN.BOTTOM_MID,0,-5)
288293
scan_button_label=lv.label(scan_button)
289294
scan_button_label.set_text(scan_button_scan_text)

internal_filesystem/main.py

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -3,7 +3,7 @@
33
import machine
44

55
# Constants
6-
CURRENT_OS_VERSION = "0.0.1"
6+
CURRENT_OS_VERSION = "0.0.3"
77
TFT_HOR_RES=320
88
TFT_VER_RES=240
99
NOTIFICATION_BAR_HEIGHT=24

0 commit comments

Comments
 (0)