micrOSDevToolKit 2.9.8__py3-none-any.whl → 2.9.11__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 +21 -21
- micrOS/source/LM_espnow.py +27 -1
- 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 +14 -7
- {micrOSDevToolKit-2.9.8.data → micrOSDevToolKit-2.9.11.data}/scripts/devToolKit.py +10 -0
- {micrOSDevToolKit-2.9.8.dist-info → micrOSDevToolKit-2.9.11.dist-info}/METADATA +66 -21
- {micrOSDevToolKit-2.9.8.dist-info → micrOSDevToolKit-2.9.11.dist-info}/RECORD +57 -50
- {micrOSDevToolKit-2.9.8.dist-info → micrOSDevToolKit-2.9.11.dist-info}/WHEEL +1 -1
- toolkit/DevEnvOTA.py +13 -9
- toolkit/DevEnvUSB.py +6 -5
- toolkit/MicrOSDevEnv.py +19 -5
- toolkit/WebRepl.py +73 -0
- toolkit/dashboard_apps/BackupRestore.py +20 -35
- 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/Repository.py +64 -0
- toolkit/lib/micrOSClient.py +16 -11
- toolkit/micrOSlint.py +3 -3
- toolkit/simulator_lib/__pycache__/aioespnow.cpython-312.pyc +0 -0
- toolkit/simulator_lib/aioespnow.py +28 -0
- toolkit/socketClient.py +0 -1
- toolkit/workspace/precompiled/LM_espnow.py +27 -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.8.dist-info → micrOSDevToolKit-2.9.11.dist-info}/LICENSE +0 -0
- {micrOSDevToolKit-2.9.8.dist-info → micrOSDevToolKit-2.9.11.dist-info}/top_level.txt +0 -0
|
@@ -5,18 +5,15 @@ import sys
|
|
|
5
5
|
import time
|
|
6
6
|
import random
|
|
7
7
|
MYPATH = os.path.dirname(os.path.abspath(__file__))
|
|
8
|
-
sys.path.append(os.path.dirname(MYPATH))
|
|
9
|
-
import socketClient
|
|
10
|
-
import time
|
|
11
8
|
sys.path.append(os.path.join(MYPATH, '../lib/'))
|
|
12
9
|
from TerminalColors import Colors
|
|
13
10
|
|
|
14
|
-
|
|
15
|
-
|
|
16
|
-
|
|
11
|
+
try:
|
|
12
|
+
from ._app_base import AppBase
|
|
13
|
+
except:
|
|
14
|
+
from _app_base import AppBase
|
|
17
15
|
|
|
18
|
-
|
|
19
|
-
return ['--dev', DEVICE]
|
|
16
|
+
CLIENT = None
|
|
20
17
|
|
|
21
18
|
|
|
22
19
|
def test_random_colors(test_len=8, smooth=False):
|
|
@@ -30,12 +27,12 @@ def test_random_colors(test_len=8, smooth=False):
|
|
|
30
27
|
|
|
31
28
|
# Generate command
|
|
32
29
|
cmd_list_str = " <a> ".join(["{} {} {} {} >json".format(main_function, k[0], k[1], smooth) for k in cct_list])
|
|
33
|
-
args =
|
|
30
|
+
args = [cmd_list_str]
|
|
34
31
|
print("{} Generated command {} - multi message single connection single connection: {} cold warm {}\n{}".format(Colors.HEADER, Colors.NC, main_function, smooth, args))
|
|
35
32
|
|
|
36
33
|
start_t = time.time()
|
|
37
34
|
# SEND MESSSAGE OVER micrOS client
|
|
38
|
-
status, answer =
|
|
35
|
+
status, answer = CLIENT.run(args)
|
|
39
36
|
delta_t = round((time.time() - start_t)/test_len, 1)
|
|
40
37
|
|
|
41
38
|
#Evaluate last message
|
|
@@ -51,14 +48,14 @@ def test_random_colors(test_len=8, smooth=False):
|
|
|
51
48
|
|
|
52
49
|
def test_toogle():
|
|
53
50
|
main_function = 'cct toggle'
|
|
54
|
-
args_on =
|
|
55
|
-
args_toggle =
|
|
51
|
+
args_on = [f'{main_function} True >json']
|
|
52
|
+
args_toggle = [f'{main_function} >json']
|
|
56
53
|
|
|
57
54
|
# SEND MESSSAGE OVER micrOS client
|
|
58
|
-
status, answer =
|
|
55
|
+
status, answer = CLIENT.run(args_on)
|
|
59
56
|
if status and '"S": 1' in answer:
|
|
60
57
|
# SEND MESSSAGE OVER micrOS client
|
|
61
|
-
status, answer =
|
|
58
|
+
status, answer = CLIENT.run(args_toggle)
|
|
62
59
|
if status and '"S": 0' in answer:
|
|
63
60
|
return True, '{} works {}OK{}'.format(main_function, Colors.OK, Colors.NC)
|
|
64
61
|
return False, '{} not works {}NOK{}: {}'.format(main_function, Colors.ERR, Colors.NC, answer)
|
|
@@ -66,24 +63,23 @@ def test_toogle():
|
|
|
66
63
|
|
|
67
64
|
def test_brightness():
|
|
68
65
|
main_function = 'cct brightness'
|
|
69
|
-
args_10 =
|
|
70
|
-
args_50 =
|
|
71
|
-
args_actual_br =
|
|
66
|
+
args_10 = [f'{main_function} 10 >json']
|
|
67
|
+
args_50 = [f'{main_function} 50 >json']
|
|
68
|
+
args_actual_br = [f'{main_function} >json']
|
|
72
69
|
|
|
73
|
-
status, answer =
|
|
70
|
+
status, answer = CLIENT.run(args_10)
|
|
74
71
|
if status:
|
|
75
|
-
status, answer =
|
|
72
|
+
status, answer = CLIENT.run(args_50)
|
|
76
73
|
if status:
|
|
77
|
-
status, answer =
|
|
74
|
+
status, answer = CLIENT.run(args_actual_br)
|
|
78
75
|
if status and "50.0 %" in answer:
|
|
79
76
|
return True, "{} function {}OK{} (50.0 % == {})".format(main_function, Colors.OK, Colors.NC, answer)
|
|
80
77
|
return False, "{} function {}NOK{} (50.0 % == {})".format(main_function, Colors.ERR, Colors.NC, answer)
|
|
81
78
|
|
|
82
79
|
|
|
83
|
-
def app(devfid=None):
|
|
84
|
-
global
|
|
85
|
-
|
|
86
|
-
DEVICE = devfid
|
|
80
|
+
def app(devfid=None, pwd=None):
|
|
81
|
+
global CLIENT
|
|
82
|
+
CLIENT = AppBase(device=devfid, password=pwd)
|
|
87
83
|
|
|
88
84
|
test_pool = { 'Color change test': test_random_colors(test_len=8, smooth=False),
|
|
89
85
|
'Color smooth test': test_random_colors(test_len=4, smooth=True),
|
|
@@ -2,14 +2,10 @@ import sys, os
|
|
|
2
2
|
import subprocess
|
|
3
3
|
MYPATH = os.path.dirname(os.path.abspath(__file__))
|
|
4
4
|
|
|
5
|
-
DEVICE = "node01"
|
|
6
5
|
|
|
7
|
-
def app(devfid=None):
|
|
6
|
+
def app(devfid=None, pwd=None):
|
|
8
7
|
"""
|
|
9
8
|
Wrapper function to start subprocess plotting... (threading limitation)
|
|
10
9
|
"""
|
|
11
|
-
|
|
12
|
-
if devfid is not None:
|
|
13
|
-
DEVICE = devfid
|
|
14
|
-
result = subprocess.run([f'{sys.executable}', os.path.join(MYPATH, '_capture.py'), DEVICE])
|
|
10
|
+
result = subprocess.run([f'{sys.executable}', os.path.join(MYPATH, '_capture.py'), devfid])
|
|
15
11
|
print(result)
|
|
@@ -1,28 +1,26 @@
|
|
|
1
1
|
#!/usr/bin/env python3
|
|
2
2
|
|
|
3
3
|
import os
|
|
4
|
-
import sys
|
|
5
4
|
import atexit
|
|
6
5
|
from random import randint
|
|
7
6
|
MYPATH = os.path.dirname(os.path.abspath(__file__))
|
|
8
|
-
sys.path.append(os.path.dirname(MYPATH))
|
|
9
|
-
import socketClient
|
|
10
7
|
|
|
11
|
-
|
|
8
|
+
try:
|
|
9
|
+
from ._app_base import AppBase
|
|
10
|
+
except:
|
|
11
|
+
from _app_base import AppBase
|
|
12
|
+
|
|
13
|
+
CLIENT = None
|
|
12
14
|
CMD_PIPE_SEP = '<a>'
|
|
13
15
|
SERVO_CENTER_VAL = 77
|
|
14
16
|
|
|
15
17
|
|
|
16
|
-
def base_cmd():
|
|
17
|
-
return ['--dev', DEVICE]
|
|
18
|
-
|
|
19
|
-
|
|
20
18
|
def play_game(iteration=30, devfid=None):
|
|
21
19
|
global CMD_PIPE_SEP
|
|
22
20
|
for _ in range(iteration):
|
|
23
21
|
piped_commands = []
|
|
24
22
|
|
|
25
|
-
args =
|
|
23
|
+
args = ['servo sduty {} '.format(SERVO_CENTER_VAL)]
|
|
26
24
|
print("CMD: {}".format(args))
|
|
27
25
|
args.append(CMD_PIPE_SEP)
|
|
28
26
|
piped_commands += args
|
|
@@ -39,19 +37,19 @@ def play_game(iteration=30, devfid=None):
|
|
|
39
37
|
piped_commands += args
|
|
40
38
|
|
|
41
39
|
print("CMD PIPE: {}".format(piped_commands))
|
|
42
|
-
|
|
40
|
+
CLIENT.run(piped_commands)
|
|
43
41
|
|
|
44
42
|
|
|
45
43
|
def deinit_servo():
|
|
46
44
|
print("DEINIT SERVO, SET TO {} and DEINIT".format(SERVO_CENTER_VAL))
|
|
47
|
-
args =
|
|
48
|
-
|
|
45
|
+
args = ['servo sduty {}'.format(SERVO_CENTER_VAL)]
|
|
46
|
+
CLIENT.run(args)
|
|
47
|
+
|
|
49
48
|
|
|
49
|
+
def app(devfid=None, pwd=None):
|
|
50
|
+
global CLIENT
|
|
51
|
+
CLIENT = AppBase(device=devfid, password=pwd)
|
|
50
52
|
|
|
51
|
-
def app(devfid=None):
|
|
52
|
-
global DEVICE
|
|
53
|
-
if devfid is not None:
|
|
54
|
-
DEVICE = devfid
|
|
55
53
|
atexit.register(deinit_servo)
|
|
56
54
|
play_game()
|
|
57
55
|
deinit_servo()
|
toolkit/dashboard_apps/Dimmer.py
CHANGED
|
@@ -1,43 +1,33 @@
|
|
|
1
1
|
#!/usr/bin/env python3
|
|
2
2
|
|
|
3
3
|
import os
|
|
4
|
-
import sys
|
|
5
4
|
MYPATH = os.path.dirname(os.path.abspath(__file__))
|
|
6
|
-
sys.path.append(os.path.dirname(MYPATH))
|
|
7
|
-
import socketClient
|
|
8
5
|
|
|
6
|
+
try:
|
|
7
|
+
from ._app_base import AppBase
|
|
8
|
+
except:
|
|
9
|
+
from _app_base import AppBase
|
|
9
10
|
|
|
10
|
-
|
|
11
|
-
DEVICE = 'CamLed'
|
|
11
|
+
CLIENT = None
|
|
12
12
|
|
|
13
13
|
|
|
14
|
-
def
|
|
15
|
-
|
|
14
|
+
def app(devfid=None, pwd=None, itr=80):
|
|
15
|
+
global CLIENT
|
|
16
|
+
CLIENT = AppBase(device=devfid, password=pwd)
|
|
16
17
|
|
|
17
|
-
|
|
18
|
-
def app(devfid=None, itr=80):
|
|
19
|
-
global DEVICE
|
|
20
|
-
if devfid is not None:
|
|
21
|
-
DEVICE = devfid
|
|
22
18
|
# EDIT YOUR COMMAND
|
|
23
19
|
cmd_list = []
|
|
24
20
|
for k in range(0, itr, 2):
|
|
25
21
|
cmd_list += ['dimmer set_value {} smooth=False >json'.format(k)]
|
|
26
|
-
|
|
22
|
+
CLIENT.run(cmd_list)
|
|
27
23
|
|
|
28
24
|
cmd_list = []
|
|
29
25
|
for k in range(itr, 0, -2):
|
|
30
26
|
cmd_list += ['dimmer set_value {} smooth=False >json'.format(k)]
|
|
31
|
-
|
|
27
|
+
CLIENT.run(cmd_list)
|
|
32
28
|
|
|
33
29
|
cmd_list = ['dimmer set_value 300', 'dimmer toggle False', 'dimmer toggle True']
|
|
34
|
-
|
|
35
|
-
|
|
36
|
-
|
|
37
|
-
def execute(cmd_list):
|
|
38
|
-
cmd_args = base_cmd() + cmd_list
|
|
39
|
-
print("DIMMER TEST: {}".format(cmd_args))
|
|
40
|
-
socketClient.run(cmd_args)
|
|
30
|
+
CLIENT.run(cmd_list)
|
|
41
31
|
|
|
42
32
|
|
|
43
33
|
if __name__ == "__main__":
|
|
@@ -4,31 +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
|
|
|
10
|
-
|
|
11
|
-
|
|
12
|
-
|
|
13
|
-
|
|
14
|
-
|
|
15
|
-
def base_cmd():
|
|
16
|
-
if PASSWD is None:
|
|
17
|
-
return ['--dev', DEVICE]
|
|
18
|
-
return ['--dev', DEVICE, '--password', PASSWD]
|
|
8
|
+
try:
|
|
9
|
+
from ._app_base import AppBase
|
|
10
|
+
except:
|
|
11
|
+
from _app_base import AppBase
|
|
19
12
|
|
|
13
|
+
CLIENT = None
|
|
20
14
|
|
|
21
15
|
|
|
22
16
|
def app(devfid=None, pwd=None):
|
|
23
|
-
global
|
|
24
|
-
|
|
25
|
-
|
|
26
|
-
if pwd is not None:
|
|
27
|
-
PASSWD = pwd
|
|
17
|
+
global CLIENT
|
|
18
|
+
CLIENT = AppBase(device=devfid, password=pwd)
|
|
19
|
+
|
|
28
20
|
# EDIT YOUR COMMAND
|
|
29
|
-
args =
|
|
30
|
-
status, answer =
|
|
31
|
-
print("[micrOS] {}: {}".format(
|
|
21
|
+
args = ['version']
|
|
22
|
+
status, answer = CLIENT.run(args)
|
|
23
|
+
print("[micrOS] {}: {}".format(CLIENT.get_device(), answer).upper())
|
|
32
24
|
|
|
33
25
|
|
|
34
26
|
if __name__ == "__main__":
|
|
@@ -2,15 +2,10 @@ import sys, os
|
|
|
2
2
|
import subprocess
|
|
3
3
|
MYPATH = os.path.dirname(os.path.abspath(__file__))
|
|
4
4
|
|
|
5
|
-
DEVICE = "node01"
|
|
6
|
-
|
|
7
5
|
|
|
8
6
|
def app(devfid=None, pwd=None):
|
|
9
7
|
"""
|
|
10
8
|
Wrapper function to start subprocess plotting... (threading limitation)
|
|
11
9
|
"""
|
|
12
|
-
|
|
13
|
-
if devfid is not None:
|
|
14
|
-
DEVICE = devfid
|
|
15
|
-
result = subprocess.run([f'{sys.executable}', os.path.join(MYPATH, '_micPlotting.py'), DEVICE])
|
|
10
|
+
result = subprocess.run([f'{sys.executable}', os.path.join(MYPATH, '_micPlotting.py'), devfid])
|
|
16
11
|
print(result)
|
|
@@ -1,72 +1,66 @@
|
|
|
1
1
|
#!/usr/bin/env python3
|
|
2
2
|
|
|
3
3
|
import os
|
|
4
|
-
import sys
|
|
5
4
|
import time
|
|
6
5
|
MYPATH = os.path.dirname(os.path.abspath(__file__))
|
|
7
|
-
sys.path.append(os.path.dirname(MYPATH))
|
|
8
|
-
import socketClient
|
|
9
|
-
sys.path.append(os.path.join(MYPATH, '../lib/'))
|
|
10
|
-
from TerminalColors import Colors
|
|
11
6
|
|
|
12
|
-
|
|
13
|
-
|
|
7
|
+
try:
|
|
8
|
+
from ._app_base import AppBase
|
|
9
|
+
except:
|
|
10
|
+
from _app_base import AppBase
|
|
14
11
|
|
|
12
|
+
CLIENT = None
|
|
15
13
|
|
|
16
|
-
def base_cmd():
|
|
17
|
-
return ['--dev', DEVICE]
|
|
18
14
|
|
|
19
|
-
|
|
20
|
-
def app(devfid=None):
|
|
15
|
+
def app(devfid=None, pwd=None):
|
|
21
16
|
"""
|
|
22
17
|
devfid: selected device input
|
|
23
18
|
send command(s) over socket connection [socketClient.run(args)]
|
|
24
19
|
list load module commands and send in single connection
|
|
25
20
|
"""
|
|
26
|
-
global
|
|
27
|
-
|
|
28
|
-
DEVICE = devfid
|
|
21
|
+
global CLIENT
|
|
22
|
+
CLIENT = AppBase(device=devfid, password=pwd)
|
|
29
23
|
|
|
30
|
-
args =
|
|
31
|
-
status, answer =
|
|
24
|
+
args = ['task kill neoeffects.*', 'neopixel toggle False', 'neopixel toggle True']
|
|
25
|
+
status, answer = CLIENT.run(args)
|
|
32
26
|
time.sleep(2)
|
|
33
27
|
|
|
34
|
-
status, answer =
|
|
28
|
+
status, answer = CLIENT.run(['neoeffects rainbow &&'])
|
|
35
29
|
time.sleep(2)
|
|
36
|
-
status, answer =
|
|
30
|
+
status, answer = CLIENT.run(['task kill neoeffects.rainbow'])
|
|
37
31
|
|
|
38
|
-
status, answer =
|
|
32
|
+
status, answer = CLIENT.run(['neoeffects color 122 18 0'])
|
|
39
33
|
|
|
40
|
-
status, answer =
|
|
34
|
+
status, answer = CLIENT.run(['neoeffects cycle &&'])
|
|
41
35
|
time.sleep(2)
|
|
42
|
-
status, answer =
|
|
36
|
+
status, answer = CLIENT.run(['task kill neoeffects.cycle'])
|
|
43
37
|
|
|
44
|
-
status, answer =
|
|
38
|
+
status, answer = CLIENT.run(['neoeffects meteor &&'])
|
|
45
39
|
time.sleep(2)
|
|
46
|
-
status, answer =
|
|
40
|
+
status, answer = CLIENT.run(['task kill neoeffects.meteor'])
|
|
47
41
|
|
|
48
|
-
status, answer =
|
|
42
|
+
status, answer = CLIENT.run(['neoeffects fire &&'])
|
|
49
43
|
time.sleep(2)
|
|
50
|
-
status, answer =
|
|
44
|
+
status, answer = CLIENT.run(['task kill neoeffects.fire'])
|
|
51
45
|
|
|
52
46
|
time.sleep(1)
|
|
53
47
|
|
|
54
|
-
status, answer =
|
|
48
|
+
status, answer = CLIENT.run(['neoeffects random &&500'])
|
|
55
49
|
|
|
56
|
-
status, answer =
|
|
50
|
+
status, answer = CLIENT.run(['neoeffects cycle &&'])
|
|
57
51
|
time.sleep(3)
|
|
58
|
-
status, answer =
|
|
52
|
+
status, answer = CLIENT.run(['task kill neoeffects.cycle'])
|
|
59
53
|
|
|
60
|
-
status, answer =
|
|
54
|
+
status, answer = CLIENT.run(['neoeffects meteor &&'])
|
|
61
55
|
time.sleep(3)
|
|
62
|
-
status, answer =
|
|
56
|
+
status, answer = CLIENT.run(['task kill neoeffects.meteor'])
|
|
63
57
|
|
|
64
|
-
status, answer =
|
|
58
|
+
status, answer = CLIENT.run(['neoeffects fire &&'])
|
|
65
59
|
time.sleep(3)
|
|
66
|
-
status, answer =
|
|
60
|
+
status, answer = CLIENT.run(['task kill neoeffects.fire'])
|
|
67
61
|
|
|
68
|
-
status, answer =
|
|
69
|
-
status, answer =
|
|
62
|
+
status, answer = CLIENT.run(['task kill neoeffects.random'])
|
|
63
|
+
status, answer = CLIENT.run(['neopixel color 122 18 0'])
|
|
70
64
|
|
|
71
65
|
|
|
72
66
|
if __name__ == "__main__":
|
|
@@ -5,19 +5,15 @@ import sys
|
|
|
5
5
|
import time
|
|
6
6
|
import random
|
|
7
7
|
MYPATH = os.path.dirname(os.path.abspath(__file__))
|
|
8
|
-
sys.path.append(os.path.dirname(MYPATH))
|
|
9
|
-
import socketClient
|
|
10
|
-
import time
|
|
11
8
|
sys.path.append(os.path.join(MYPATH, '../lib/'))
|
|
12
9
|
from TerminalColors import Colors
|
|
13
10
|
|
|
14
|
-
|
|
15
|
-
|
|
16
|
-
|
|
17
|
-
|
|
18
|
-
def base_cmd():
|
|
19
|
-
return ['--dev', DEVICE]
|
|
11
|
+
try:
|
|
12
|
+
from ._app_base import AppBase
|
|
13
|
+
except:
|
|
14
|
+
from _app_base import AppBase
|
|
20
15
|
|
|
16
|
+
CLIENT = None
|
|
21
17
|
|
|
22
18
|
def test_random_colors(test_len=8, smooth=False):
|
|
23
19
|
main_function = 'neopixel color'
|
|
@@ -31,12 +27,12 @@ def test_random_colors(test_len=8, smooth=False):
|
|
|
31
27
|
|
|
32
28
|
# Generate command
|
|
33
29
|
cmd_list_str = " <a> ".join(["{} {} {} {} {} >json".format(main_function, k[0], k[1], k[2], smooth) for k in color_list])
|
|
34
|
-
args =
|
|
30
|
+
args = [cmd_list_str]
|
|
35
31
|
print("{} Generated command {} - multi message single connection single connection: {} r g b {}\n{}".format(Colors.HEADER, Colors.NC, main_function, smooth, args))
|
|
36
32
|
|
|
37
33
|
start_t = time.time()
|
|
38
34
|
# SEND MESSSAGE OVER micrOS client
|
|
39
|
-
status, answer =
|
|
35
|
+
status, answer = CLIENT.run(args)
|
|
40
36
|
delta_t = round((time.time() - start_t)/test_len, 1)
|
|
41
37
|
|
|
42
38
|
#Evaluate last message
|
|
@@ -53,14 +49,14 @@ def test_random_colors(test_len=8, smooth=False):
|
|
|
53
49
|
|
|
54
50
|
def test_toogle():
|
|
55
51
|
main_function = 'neopixel toggle'
|
|
56
|
-
args_on =
|
|
57
|
-
args_toggle =
|
|
52
|
+
args_on = [f'{main_function} True >json']
|
|
53
|
+
args_toggle = [f'{main_function} >json']
|
|
58
54
|
|
|
59
55
|
# SEND MESSSAGE OVER micrOS client
|
|
60
|
-
status, answer =
|
|
56
|
+
status, answer = CLIENT.run(args_on)
|
|
61
57
|
if status and '"S": 1' in answer:
|
|
62
58
|
# SEND MESSSAGE OVER micrOS client
|
|
63
|
-
status, answer =
|
|
59
|
+
status, answer = CLIENT.run(args_toggle)
|
|
64
60
|
if status and '"S": 0' in answer:
|
|
65
61
|
return True, '{} works {}OK{}'.format(main_function, Colors.OK, Colors.NC)
|
|
66
62
|
return False, '{} not works {}NOK{}: {}'.format(main_function, Colors.ERR, Colors.NC, answer)
|
|
@@ -68,24 +64,23 @@ def test_toogle():
|
|
|
68
64
|
|
|
69
65
|
def test_brightness():
|
|
70
66
|
main_function = 'neopixel brightness'
|
|
71
|
-
args_10 =
|
|
72
|
-
args_50 =
|
|
73
|
-
args_actual_br =
|
|
67
|
+
args_10 = [f'{main_function} 10 >json']
|
|
68
|
+
args_50 = [f'{main_function} 50 >json']
|
|
69
|
+
args_actual_br = [f'{main_function} >json']
|
|
74
70
|
|
|
75
|
-
status, answer =
|
|
71
|
+
status, answer = CLIENT.run(args_10)
|
|
76
72
|
if status:
|
|
77
|
-
status, answer =
|
|
73
|
+
status, answer = CLIENT.run(args_50)
|
|
78
74
|
if status:
|
|
79
|
-
status, answer =
|
|
75
|
+
status, answer = CLIENT.run(args_actual_br)
|
|
80
76
|
if status and "50.0 %" in answer:
|
|
81
77
|
return True, "{} function {}OK{} (50.0 % == {})".format(main_function, Colors.OK, Colors.NC, answer)
|
|
82
78
|
return False, "{} function {}NOK{} (50.0 % == {})".format(main_function, Colors.ERR, Colors.NC, answer)
|
|
83
79
|
|
|
84
80
|
|
|
85
|
-
def app(devfid=None):
|
|
86
|
-
global
|
|
87
|
-
|
|
88
|
-
DEVICE = devfid
|
|
81
|
+
def app(devfid=None, pwd=None):
|
|
82
|
+
global CLIENT
|
|
83
|
+
CLIENT = AppBase(device=devfid, password=pwd)
|
|
89
84
|
|
|
90
85
|
test_pool = { 'Color change test': test_random_colors(test_len=8, smooth=False),
|
|
91
86
|
'Color smooth test': test_random_colors(test_len=4, smooth=True),
|
|
@@ -2,15 +2,9 @@ import sys, os
|
|
|
2
2
|
import subprocess
|
|
3
3
|
MYPATH = os.path.dirname(os.path.abspath(__file__))
|
|
4
4
|
|
|
5
|
-
|
|
6
|
-
|
|
7
|
-
|
|
8
|
-
def app(devfid=None):
|
|
5
|
+
def app(devfid=None, pwd=None):
|
|
9
6
|
"""
|
|
10
7
|
Wrapper function to start subprocess plotting... (threading limitation)
|
|
11
8
|
"""
|
|
12
|
-
|
|
13
|
-
if devfid is not None:
|
|
14
|
-
DEVICE = devfid
|
|
15
|
-
result = subprocess.run([f'{sys.executable}', os.path.join(MYPATH, '_presencePlotting.py'), DEVICE])
|
|
9
|
+
result = subprocess.run([f'{sys.executable}', os.path.join(MYPATH, '_presencePlotting.py'), devfid])
|
|
16
10
|
print(result)
|
|
@@ -5,18 +5,15 @@ import sys
|
|
|
5
5
|
import time
|
|
6
6
|
import random
|
|
7
7
|
MYPATH = os.path.dirname(os.path.abspath(__file__))
|
|
8
|
-
sys.path.append(os.path.dirname(MYPATH))
|
|
9
|
-
import socketClient
|
|
10
|
-
import time
|
|
11
8
|
sys.path.append(os.path.join(MYPATH, '../lib/'))
|
|
12
9
|
from TerminalColors import Colors
|
|
13
10
|
|
|
14
|
-
|
|
15
|
-
|
|
16
|
-
|
|
11
|
+
try:
|
|
12
|
+
from ._app_base import AppBase
|
|
13
|
+
except:
|
|
14
|
+
from _app_base import AppBase
|
|
17
15
|
|
|
18
|
-
|
|
19
|
-
return ['--dev', DEVICE]
|
|
16
|
+
CLIENT = None
|
|
20
17
|
|
|
21
18
|
|
|
22
19
|
def test_random_colors(test_len=8, smooth=False):
|
|
@@ -31,12 +28,12 @@ def test_random_colors(test_len=8, smooth=False):
|
|
|
31
28
|
|
|
32
29
|
# Generate command
|
|
33
30
|
cmd_list_str = " <a> ".join(["{} {} {} {} {} >json".format(main_function, k[0], k[1], k[2], smooth) for k in color_list])
|
|
34
|
-
args =
|
|
31
|
+
args = [cmd_list_str]
|
|
35
32
|
print("{} Generated command {} - multi message single connection single connection: {} r g b {}\n{}".format(Colors.HEADER, Colors.NC, main_function, smooth, args))
|
|
36
33
|
|
|
37
34
|
start_t = time.time()
|
|
38
35
|
# SEND MESSSAGE OVER micrOS client
|
|
39
|
-
status, answer =
|
|
36
|
+
status, answer = CLIENT.run(args)
|
|
40
37
|
delta_t = round((time.time() - start_t)/test_len, 1)
|
|
41
38
|
|
|
42
39
|
#Evaluate last message
|
|
@@ -53,14 +50,14 @@ def test_random_colors(test_len=8, smooth=False):
|
|
|
53
50
|
|
|
54
51
|
def test_toogle():
|
|
55
52
|
main_function = 'rgb toggle'
|
|
56
|
-
args_on =
|
|
57
|
-
args_toggle =
|
|
53
|
+
args_on = [f'{main_function} True >json']
|
|
54
|
+
args_toggle = [f'{main_function} >json']
|
|
58
55
|
|
|
59
56
|
# SEND MESSSAGE OVER micrOS client
|
|
60
|
-
status, answer =
|
|
57
|
+
status, answer = CLIENT.run(args_on)
|
|
61
58
|
if status and '"S": 1' in answer:
|
|
62
59
|
# SEND MESSSAGE OVER micrOS client
|
|
63
|
-
status, answer =
|
|
60
|
+
status, answer = CLIENT.run(args_toggle)
|
|
64
61
|
if status and '"S": 0' in answer:
|
|
65
62
|
return True, '{} works {}OK{}'.format(main_function, Colors.OK, Colors.NC)
|
|
66
63
|
return False, '{} not works {}NOK{}: {}'.format(main_function, Colors.ERR, Colors.NC, answer)
|
|
@@ -68,24 +65,23 @@ def test_toogle():
|
|
|
68
65
|
|
|
69
66
|
def test_brightness():
|
|
70
67
|
main_function = 'rgb brightness'
|
|
71
|
-
args_10 =
|
|
72
|
-
args_50 =
|
|
73
|
-
args_actual_br =
|
|
68
|
+
args_10 = [f'{main_function} 10 >json']
|
|
69
|
+
args_50 = [f'{main_function} 50 >json']
|
|
70
|
+
args_actual_br = [f'{main_function} >json']
|
|
74
71
|
|
|
75
|
-
status, answer =
|
|
72
|
+
status, answer = CLIENT.run(args_10)
|
|
76
73
|
if status:
|
|
77
|
-
status, answer =
|
|
74
|
+
status, answer = CLIENT.run(args_50)
|
|
78
75
|
if status:
|
|
79
|
-
status, answer =
|
|
76
|
+
status, answer = CLIENT.run(args_actual_br)
|
|
80
77
|
if status and "50.0 %" in answer:
|
|
81
78
|
return True, "{} function {}OK{} (50.0 % == {})".format(main_function, Colors.OK, Colors.NC, answer)
|
|
82
79
|
return False, "{} function {}NOK{} (50.0 % == {})".format(main_function, Colors.ERR, Colors.NC, answer)
|
|
83
80
|
|
|
84
81
|
|
|
85
|
-
def app(devfid=None):
|
|
86
|
-
global
|
|
87
|
-
|
|
88
|
-
DEVICE = devfid
|
|
82
|
+
def app(devfid=None, pwd=None):
|
|
83
|
+
global CLIENT
|
|
84
|
+
CLIENT = AppBase(device=devfid, password=pwd)
|
|
89
85
|
|
|
90
86
|
test_pool = { 'Color change test': test_random_colors(test_len=8, smooth=False),
|
|
91
87
|
'Color smooth test': test_random_colors(test_len=4, smooth=True),
|