micrOSDevToolKit 2.9.9__py3-none-any.whl → 2.9.10__py3-none-any.whl
This diff represents the content of publicly available package versions that have been released to one of the supported registries. The information contained in this diff is provided for informational purposes only and reflects changes between package versions as they appear in their respective public registries.
Potentially problematic release.
This version of micrOSDevToolKit might be problematic. Click here for more details.
- micrOS/release_info/micrOS_ReleaseInfo/system_analysis_sum.json +20 -20
- micrOS/source/LM_oled_ui.py +1 -1
- micrOS/source/LM_system.py +4 -4
- micrOS/source/Notify.py +4 -0
- micrOS/source/Server.py +1 -1
- micrOS/source/Shell.py +3 -3
- micrOS/source/Tasks.py +1 -1
- micrOS/source/Time.py +7 -8
- micrOS/source/__pycache__/Common.cpython-312.pyc +0 -0
- micrOS/source/__pycache__/Logger.cpython-312.pyc +0 -0
- micrOS/source/__pycache__/Server.cpython-312.pyc +0 -0
- micrOS/source/micrOSloader.py +0 -1
- micrOS/source/urequests.py +8 -6
- {micrOSDevToolKit-2.9.9.data → micrOSDevToolKit-2.9.10.data}/scripts/devToolKit.py +10 -0
- {micrOSDevToolKit-2.9.9.dist-info → micrOSDevToolKit-2.9.10.dist-info}/METADATA +14 -4
- {micrOSDevToolKit-2.9.9.dist-info → micrOSDevToolKit-2.9.10.dist-info}/RECORD +50 -46
- {micrOSDevToolKit-2.9.9.dist-info → micrOSDevToolKit-2.9.10.dist-info}/WHEEL +1 -1
- toolkit/MicrOSDevEnv.py +19 -5
- toolkit/WebRepl.py +73 -0
- toolkit/dashboard_apps/BackupRestore.py +20 -31
- toolkit/dashboard_apps/CCTDemo.py +12 -17
- toolkit/dashboard_apps/CCTTest.py +20 -24
- toolkit/dashboard_apps/CamStream.py +2 -6
- toolkit/dashboard_apps/CatGame.py +14 -16
- toolkit/dashboard_apps/Dimmer.py +11 -21
- toolkit/dashboard_apps/GetVersion.py +11 -19
- toolkit/dashboard_apps/MicrophoneTest.py +1 -6
- toolkit/dashboard_apps/NeoEffectsDemo.py +28 -34
- toolkit/dashboard_apps/NeopixelTest.py +20 -25
- toolkit/dashboard_apps/PresenceTest.py +2 -8
- toolkit/dashboard_apps/RGBTest.py +20 -24
- toolkit/dashboard_apps/RoboArm.py +24 -32
- toolkit/dashboard_apps/SED_test.py +10 -14
- toolkit/dashboard_apps/SensorsTest.py +61 -0
- toolkit/dashboard_apps/SystemTest.py +151 -77
- toolkit/dashboard_apps/Template_app.py +11 -23
- toolkit/dashboard_apps/_app_base.py +34 -0
- toolkit/dashboard_apps/uLightDemo.py +15 -24
- toolkit/lib/micrOSClient.py +11 -9
- toolkit/micrOSlint.py +3 -3
- toolkit/socketClient.py +0 -1
- toolkit/workspace/precompiled/LM_oled_ui.mpy +0 -0
- toolkit/workspace/precompiled/LM_system.mpy +0 -0
- toolkit/workspace/precompiled/Notify.mpy +0 -0
- toolkit/workspace/precompiled/Shell.mpy +0 -0
- toolkit/workspace/precompiled/Time.mpy +0 -0
- toolkit/workspace/precompiled/micrOSloader.mpy +0 -0
- toolkit/workspace/precompiled/urequests.mpy +0 -0
- toolkit/dashboard_apps/AirQualityBME280.py +0 -36
- toolkit/dashboard_apps/AirQualityDHT22_CO2.py +0 -36
- {micrOSDevToolKit-2.9.9.dist-info → micrOSDevToolKit-2.9.10.dist-info}/LICENSE +0 -0
- {micrOSDevToolKit-2.9.9.dist-info → micrOSDevToolKit-2.9.10.dist-info}/top_level.txt +0 -0
|
@@ -4,28 +4,23 @@ import os
|
|
|
4
4
|
import sys
|
|
5
5
|
import time
|
|
6
6
|
MYPATH = os.path.dirname(os.path.abspath(__file__))
|
|
7
|
-
sys.path.append(os.path.dirname(MYPATH))
|
|
8
|
-
import socketClient
|
|
9
7
|
sys.path.append(os.path.join(MYPATH, '../lib/'))
|
|
10
8
|
from TerminalColors import Colors
|
|
11
9
|
|
|
12
|
-
|
|
13
|
-
|
|
14
|
-
|
|
15
|
-
|
|
16
|
-
def base_cmd():
|
|
17
|
-
return ['--dev', DEVICE]
|
|
10
|
+
try:
|
|
11
|
+
from ._app_base import AppBase
|
|
12
|
+
except:
|
|
13
|
+
from _app_base import AppBase
|
|
18
14
|
|
|
15
|
+
CLIENT = None
|
|
19
16
|
|
|
20
17
|
def light_demo(modules, smooth=True, sample=10):
|
|
21
18
|
verdict = [True, []]
|
|
22
19
|
smooth_str = '[smooth]' if smooth else '[simple]'
|
|
23
20
|
|
|
24
|
-
if '
|
|
25
|
-
args = base_cmd() + [f'rgb random {smooth}'] * sample + ['rgb toggle False']
|
|
26
|
-
print(args)
|
|
21
|
+
if 'rgb' in modules:
|
|
27
22
|
delta_t = time.time()
|
|
28
|
-
status_rgb, answer_rgb =
|
|
23
|
+
status_rgb, answer_rgb = CLIENT.run([f'rgb random {smooth}'] * sample + ['rgb toggle False'])
|
|
29
24
|
delta_t = round((time.time() - delta_t) / sample, 2)
|
|
30
25
|
if status_rgb:
|
|
31
26
|
msg = f"{smooth_str} rgb module random color func: {Colors.OK}OK{Colors.NC} [{delta_t}sec]"
|
|
@@ -35,10 +30,9 @@ def light_demo(modules, smooth=True, sample=10):
|
|
|
35
30
|
verdict[1].append(msg)
|
|
36
31
|
verdict[0] &= False
|
|
37
32
|
|
|
38
|
-
if '
|
|
39
|
-
args = base_cmd() + [f'cct random {smooth}'] * sample + ['cct toggle False']
|
|
33
|
+
if 'cct' in modules:
|
|
40
34
|
delta_t = time.time()
|
|
41
|
-
status_cct, answer_cct =
|
|
35
|
+
status_cct, answer_cct = CLIENT.run([f'cct random {smooth}'] * sample + ['cct toggle False'])
|
|
42
36
|
delta_t = round((time.time() - delta_t) / sample, 2)
|
|
43
37
|
if status_cct:
|
|
44
38
|
msg = f"{smooth_str} cct module random color func: {Colors.OK}OK{Colors.NC} [{delta_t}sec]"
|
|
@@ -48,10 +42,9 @@ def light_demo(modules, smooth=True, sample=10):
|
|
|
48
42
|
verdict[1].append(msg)
|
|
49
43
|
verdict[0] &= False
|
|
50
44
|
|
|
51
|
-
if '
|
|
52
|
-
args = base_cmd() + [f'neopixel random {smooth}'] * sample + ['neopixel toggle False']
|
|
45
|
+
if 'neopixel' in modules:
|
|
53
46
|
delta_t = time.time()
|
|
54
|
-
status_neo, answer_neo =
|
|
47
|
+
status_neo, answer_neo = CLIENT.run([f'neopixel random {smooth}'] * sample + ['neopixel toggle False'])
|
|
55
48
|
delta_t = round((time.time() - delta_t) / sample, 2)
|
|
56
49
|
if status_neo:
|
|
57
50
|
msg = f"{smooth_str} neopixel module random color func: {Colors.OK}OK{Colors.NC} [{delta_t}sec]"
|
|
@@ -63,19 +56,17 @@ def light_demo(modules, smooth=True, sample=10):
|
|
|
63
56
|
return verdict
|
|
64
57
|
|
|
65
58
|
|
|
66
|
-
def app(devfid=None):
|
|
59
|
+
def app(devfid=None, pwd=None):
|
|
67
60
|
"""
|
|
68
61
|
devfid: selected device input
|
|
69
62
|
send command(s) over socket connection [socketClient.run(args)]
|
|
70
63
|
list load module commands and send in single connection
|
|
71
64
|
"""
|
|
72
|
-
global
|
|
73
|
-
|
|
74
|
-
DEVICE = devfid
|
|
65
|
+
global CLIENT
|
|
66
|
+
CLIENT = AppBase(device=devfid, password=pwd)
|
|
75
67
|
|
|
76
68
|
# Get loaded modules
|
|
77
|
-
|
|
78
|
-
status, modules = socketClient.run(args)
|
|
69
|
+
status, modules = CLIENT.run(['modules'])
|
|
79
70
|
print("status: {}\nanswer: {}".format(status, modules))
|
|
80
71
|
|
|
81
72
|
if not status:
|
toolkit/lib/micrOSClient.py
CHANGED
|
@@ -355,8 +355,9 @@ class micrOSClient:
|
|
|
355
355
|
verdict.append(console_msg)
|
|
356
356
|
print(f"===>\t\t{console_msg}")
|
|
357
357
|
self.close()
|
|
358
|
-
|
|
359
|
-
|
|
358
|
+
delta_t_result = round(delta_t_all / cnt, 3)
|
|
359
|
+
verdict.append(f"SINGLE CONNECTION LOAD TEST X{cnt}, AVERAGE REPLY TIME: {delta_t_result} sec\n")
|
|
360
|
+
return verdict, delta_t_result
|
|
360
361
|
|
|
361
362
|
def __del__(self):
|
|
362
363
|
if self.dbg and self.avg_reply[1] > 0:
|
|
@@ -385,9 +386,10 @@ def micros_connection_metrics(address):
|
|
|
385
386
|
print(f"\t\t{_console_msg}")
|
|
386
387
|
all_reply.append(_console_msg)
|
|
387
388
|
success_rate = int(round(_success / cnt, 2) * 100)
|
|
388
|
-
|
|
389
|
-
|
|
390
|
-
|
|
389
|
+
delta_t_result = round(_all_delta_t/cnt, 3)
|
|
390
|
+
all_reply.append(f"MULTI CONNECTION LOAD TEST X{cnt}, AVERAGE REPLY TIME: {delta_t_result}s, "
|
|
391
|
+
f"SERVER AVAILABILITY: {success_rate}% ({int((_all_delta_t/_success)*1000)} ms)")
|
|
392
|
+
return all_reply, delta_t_result
|
|
391
393
|
|
|
392
394
|
# ---------------------------------------------------- #
|
|
393
395
|
high_level_verdict = []
|
|
@@ -395,12 +397,12 @@ def micros_connection_metrics(address):
|
|
|
395
397
|
# [1] Create micrOSClient object + Run LOAD tests
|
|
396
398
|
com_obj = micrOSClient(host=address, port=9008, pwd="ADmin123", dbg=True)
|
|
397
399
|
# [1.1] Run load test in one connection
|
|
398
|
-
verdict_list = com_obj.load_test()
|
|
400
|
+
verdict_list, delta_t_single_session = com_obj.load_test()
|
|
399
401
|
com_obj.close()
|
|
400
402
|
high_level_verdict.append(verdict_list[-1])
|
|
401
403
|
|
|
402
404
|
# [2] Run multi connection load test - reconnect - raw connection (without retry)
|
|
403
|
-
verdict_multi = multi_conn_load(address)
|
|
405
|
+
verdict_multi, delta_t_multi_session = multi_conn_load(address)
|
|
404
406
|
high_level_verdict.append((verdict_multi[-1]))
|
|
405
407
|
|
|
406
408
|
############################################################################
|
|
@@ -412,7 +414,7 @@ def micros_connection_metrics(address):
|
|
|
412
414
|
for k in verdict_multi:
|
|
413
415
|
print(f"\t{k}")
|
|
414
416
|
|
|
415
|
-
return high_level_verdict
|
|
417
|
+
return high_level_verdict, delta_t_single_session, delta_t_multi_session
|
|
416
418
|
|
|
417
419
|
|
|
418
420
|
if __name__ == "__main__":
|
|
@@ -446,7 +448,7 @@ if __name__ == "__main__":
|
|
|
446
448
|
print(f"noconf out: {noconf_mode}")
|
|
447
449
|
if force_close: com_obj.close()
|
|
448
450
|
|
|
449
|
-
verdict = micros_connection_metrics(address=address)
|
|
451
|
+
verdict, delta_t_single, delta_t_multi = micros_connection_metrics(address=address)
|
|
450
452
|
for k in verdict:
|
|
451
453
|
print(f"+\t\t{k}")
|
|
452
454
|
|
toolkit/micrOSlint.py
CHANGED
|
@@ -172,7 +172,7 @@ def core_dep_checker(categories, verbose=True):
|
|
|
172
172
|
def load_module_checker(categories, verbose=True):
|
|
173
173
|
|
|
174
174
|
def _is_allowed(_relation):
|
|
175
|
-
_allowed_whitelist = ['Common', 'microIO', 'Types']
|
|
175
|
+
_allowed_whitelist = ['Common', 'microIO', 'Types', 'urequests']
|
|
176
176
|
_allowed = []
|
|
177
177
|
for _allow in _relation:
|
|
178
178
|
if _allow in _allowed_whitelist:
|
|
@@ -239,7 +239,7 @@ def _run_pylint(file_name):
|
|
|
239
239
|
|
|
240
240
|
def run_pylint(categories, verbose=True, dry_run=False):
|
|
241
241
|
# ERROR CONFIG: drop error if this is in pylint output
|
|
242
|
-
error_msg_core = ['syntax-error', 'undefined-variable', 'no-member'
|
|
242
|
+
error_msg_core = ['syntax-error', 'undefined-variable', 'bad-indentation'] # 'no-member' ?
|
|
243
243
|
# BYPASS 'no-member' due to duty and sleep_ms micropython functions is drops false alarm, etc.
|
|
244
244
|
error_msg_lm = ['syntax-error', 'undefined-variable']
|
|
245
245
|
|
|
@@ -467,7 +467,7 @@ def short_report(categories, states, verbose=True):
|
|
|
467
467
|
print(f"load_module_checker: load module dependency check (no core): {c_OK if lm_dep[0] else c_NOK} {'' if lm_dep[1] == 0 else f'{lm_dep[1]}{_vis(lm_dep_diff)} warning(s)'}")
|
|
468
468
|
print(f" core pylint score: {core_pylint}{_pyl_vis(core_score_diff)}")
|
|
469
469
|
print(f"load module pylint score: {lm_pylint}{_pyl_vis(load_score_diff)}")
|
|
470
|
-
print(f"pylint resource check (syntax): {c_OK if pylint_check[0] else f'{c_NOK}: {pylint_check[1]}' }")
|
|
470
|
+
print(f"pylint resource check (syntax?): {c_OK if pylint_check[0] else f'{c_NOK}: {pylint_check[1]}' }")
|
|
471
471
|
|
|
472
472
|
exitcode = sum([1 for k, v in states.items() if not v[0]])
|
|
473
473
|
print(f"micrOSlint verdict: {c_OK if exitcode == 0 else c_NOK}")
|
toolkit/socketClient.py
CHANGED
|
Binary file
|
|
Binary file
|
|
Binary file
|
|
Binary file
|
|
Binary file
|
|
Binary file
|
|
Binary file
|
|
@@ -1,36 +0,0 @@
|
|
|
1
|
-
#!/usr/bin/env python3
|
|
2
|
-
|
|
3
|
-
import os
|
|
4
|
-
import sys
|
|
5
|
-
import time
|
|
6
|
-
MYPATH = os.path.dirname(os.path.abspath(__file__))
|
|
7
|
-
sys.path.append(os.path.dirname(MYPATH))
|
|
8
|
-
import socketClient
|
|
9
|
-
|
|
10
|
-
# FILL OUT
|
|
11
|
-
DEVICE = 'AirQualityPro'
|
|
12
|
-
|
|
13
|
-
|
|
14
|
-
def base_cmd():
|
|
15
|
-
return ['--dev', DEVICE]
|
|
16
|
-
|
|
17
|
-
|
|
18
|
-
def app(devfid=None):
|
|
19
|
-
global DEVICE
|
|
20
|
-
if devfid is not None:
|
|
21
|
-
DEVICE = devfid
|
|
22
|
-
for k in range(0, 20):
|
|
23
|
-
args = base_cmd() + ['bme280 measure']
|
|
24
|
-
try:
|
|
25
|
-
status, answer = socketClient.run(args)
|
|
26
|
-
if status:
|
|
27
|
-
print("|- [{}/20] OK".format(k+1))
|
|
28
|
-
else:
|
|
29
|
-
print("|- [{}/20] ERR".format(k+1))
|
|
30
|
-
time.sleep(3)
|
|
31
|
-
except KeyboardInterrupt:
|
|
32
|
-
break
|
|
33
|
-
|
|
34
|
-
|
|
35
|
-
if __name__ == "__main__":
|
|
36
|
-
app()
|
|
@@ -1,36 +0,0 @@
|
|
|
1
|
-
#!/usr/bin/env python3
|
|
2
|
-
|
|
3
|
-
import os
|
|
4
|
-
import sys
|
|
5
|
-
import time
|
|
6
|
-
MYPATH = os.path.dirname(os.path.abspath(__file__))
|
|
7
|
-
sys.path.append(os.path.dirname(MYPATH))
|
|
8
|
-
import socketClient
|
|
9
|
-
|
|
10
|
-
# FILL OUT
|
|
11
|
-
DEVICE = 'airquality'
|
|
12
|
-
|
|
13
|
-
|
|
14
|
-
def base_cmd():
|
|
15
|
-
return ['--dev', DEVICE]
|
|
16
|
-
|
|
17
|
-
|
|
18
|
-
def app(devfid=None):
|
|
19
|
-
global DEVICE
|
|
20
|
-
if devfid is not None:
|
|
21
|
-
DEVICE = devfid
|
|
22
|
-
for k in range(0, 20):
|
|
23
|
-
args = base_cmd() + ['dht22 measure_w_co2']
|
|
24
|
-
try:
|
|
25
|
-
status, answer = socketClient.run(args)
|
|
26
|
-
if status:
|
|
27
|
-
print("|- [{}/20] OK".format(k+1))
|
|
28
|
-
else:
|
|
29
|
-
print("|- [{}/20] ERR".format(k+1))
|
|
30
|
-
time.sleep(3)
|
|
31
|
-
except KeyboardInterrupt:
|
|
32
|
-
break
|
|
33
|
-
|
|
34
|
-
|
|
35
|
-
if __name__ == "__main__":
|
|
36
|
-
app()
|
|
File without changes
|
|
File without changes
|