micrOSDevToolKit 2.9.11__py3-none-any.whl → 2.10.5__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 +37 -29
- micrOS/source/Common.py +5 -5
- micrOS/source/Espnow.py +245 -123
- micrOS/source/Files.py +101 -0
- micrOS/source/InterConnect.py +14 -11
- micrOS/source/LM_espnow.py +10 -7
- micrOS/source/LM_intercon.py +3 -0
- micrOS/source/LM_light_sensor.py +7 -15
- micrOS/source/LM_mqtt_pro.py +211 -0
- micrOS/source/LM_oled_ui.py +18 -22
- micrOS/source/LM_oledui.py +13 -16
- micrOS/source/LM_pacman.py +37 -57
- micrOS/source/LM_presence.py +8 -11
- micrOS/source/LM_system.py +8 -7
- micrOS/source/LM_telegram.py +21 -16
- micrOS/source/Logger.py +5 -11
- micrOS/source/Shell.py +37 -30
- micrOS/source/Tasks.py +32 -17
- micrOS/source/Web.py +3 -2
- micrOS/source/__pycache__/Common.cpython-312.pyc +0 -0
- micrOS/source/__pycache__/Logger.cpython-312.pyc +0 -0
- micrOS/source/microIO.py +3 -2
- micrOS/source/urequests.py +10 -1
- {micrOSDevToolKit-2.9.11.dist-info → microsdevtoolkit-2.10.5.dist-info}/METADATA +13 -15
- {micrOSDevToolKit-2.9.11.dist-info → microsdevtoolkit-2.10.5.dist-info}/RECORD +54 -50
- {micrOSDevToolKit-2.9.11.dist-info → microsdevtoolkit-2.10.5.dist-info}/WHEEL +1 -1
- toolkit/dashboard_apps/SystemTest.py +17 -6
- toolkit/lib/micrOSClient.py +25 -6
- toolkit/simulator_lib/__pycache__/uos.cpython-312.pyc +0 -0
- toolkit/simulator_lib/uos.py +5 -5
- toolkit/socketClient.py +2 -3
- toolkit/workspace/precompiled/Common.mpy +0 -0
- toolkit/workspace/precompiled/Espnow.mpy +0 -0
- toolkit/workspace/precompiled/Files.mpy +0 -0
- toolkit/workspace/precompiled/InterConnect.mpy +0 -0
- toolkit/workspace/precompiled/LM_espnow.py +10 -7
- toolkit/workspace/precompiled/LM_intercon.mpy +0 -0
- toolkit/workspace/precompiled/LM_light_sensor.mpy +0 -0
- toolkit/workspace/precompiled/LM_mqtt_pro.py +211 -0
- toolkit/workspace/precompiled/LM_oled_ui.mpy +0 -0
- toolkit/workspace/precompiled/LM_oledui.mpy +0 -0
- toolkit/workspace/precompiled/LM_pacman.mpy +0 -0
- toolkit/workspace/precompiled/LM_presence.mpy +0 -0
- toolkit/workspace/precompiled/LM_system.mpy +0 -0
- toolkit/workspace/precompiled/LM_telegram.mpy +0 -0
- toolkit/workspace/precompiled/Logger.mpy +0 -0
- toolkit/workspace/precompiled/Shell.mpy +0 -0
- toolkit/workspace/precompiled/Tasks.mpy +0 -0
- toolkit/workspace/precompiled/Web.mpy +0 -0
- toolkit/workspace/precompiled/microIO.mpy +0 -0
- toolkit/workspace/precompiled/urequests.mpy +0 -0
- {micrOSDevToolKit-2.9.11.data → microsdevtoolkit-2.10.5.data}/scripts/devToolKit.py +0 -0
- {micrOSDevToolKit-2.9.11.dist-info → microsdevtoolkit-2.10.5.dist-info/licenses}/LICENSE +0 -0
- {micrOSDevToolKit-2.9.11.dist-info → microsdevtoolkit-2.10.5.dist-info}/top_level.txt +0 -0
micrOS/source/Shell.py
CHANGED
|
@@ -12,9 +12,9 @@ Designed by Marcell Ban aka BxNxM
|
|
|
12
12
|
# IMPORTS #
|
|
13
13
|
#################################################################
|
|
14
14
|
from sys import modules
|
|
15
|
-
from uos import listdir
|
|
16
15
|
from machine import reset as hard_reset, soft_reset
|
|
17
16
|
from Config import cfgget, cfgput
|
|
17
|
+
from Files import ilist_fs
|
|
18
18
|
from Tasks import lm_exec
|
|
19
19
|
from Debug import errlog_add
|
|
20
20
|
|
|
@@ -25,7 +25,7 @@ from Debug import errlog_add
|
|
|
25
25
|
|
|
26
26
|
class Shell:
|
|
27
27
|
__slots__ = ['__devfid', '__auth_mode', '__hwuid', '__auth_ok', '__conf_mode']
|
|
28
|
-
MICROS_VERSION = '2.
|
|
28
|
+
MICROS_VERSION = '2.10.5-0'
|
|
29
29
|
|
|
30
30
|
def __init__(self):
|
|
31
31
|
"""
|
|
@@ -106,6 +106,7 @@ class Shell:
|
|
|
106
106
|
# No msg to work with
|
|
107
107
|
return True
|
|
108
108
|
msg_list = msg.strip().split()
|
|
109
|
+
local_cmd = not msg_list[-1].startswith(">>") # intercon request check for shell commands
|
|
109
110
|
|
|
110
111
|
##########################################
|
|
111
112
|
# [1] Handle built-in shell commands #
|
|
@@ -113,7 +114,7 @@ class Shell:
|
|
|
113
114
|
##########################################
|
|
114
115
|
|
|
115
116
|
# Hello message
|
|
116
|
-
if msg_list[0] == 'hello':
|
|
117
|
+
if local_cmd and msg_list[0] == 'hello':
|
|
117
118
|
# For low level device identification - hello msg
|
|
118
119
|
await self.a_send(f"hello:{self.__devfid}:{self.__hwuid}")
|
|
119
120
|
return True
|
|
@@ -126,60 +127,65 @@ class Shell:
|
|
|
126
127
|
return True
|
|
127
128
|
|
|
128
129
|
# Version handling
|
|
129
|
-
if msg_list[0] == 'version':
|
|
130
|
+
if local_cmd and msg_list[0] == 'version':
|
|
130
131
|
# For micrOS system version info
|
|
131
132
|
await self.a_send(str(Shell.MICROS_VERSION))
|
|
132
133
|
return True
|
|
133
134
|
|
|
134
135
|
# Reboot micropython VM
|
|
135
|
-
if msg_list[0] == 'reboot':
|
|
136
|
+
if local_cmd and msg_list[0] == 'reboot':
|
|
136
137
|
hard = False
|
|
137
138
|
if len(msg_list) >= 2 and "-h" in msg_list[1]:
|
|
138
139
|
# reboot / reboot -h
|
|
139
140
|
hard = True
|
|
140
141
|
await self.reboot(hard)
|
|
141
142
|
|
|
142
|
-
if msg_list[0].startswith('webrepl'):
|
|
143
|
+
if local_cmd and msg_list[0].startswith('webrepl'):
|
|
143
144
|
if len(msg_list) == 2 and '-u' in msg_list[1]:
|
|
144
145
|
await Shell.webrepl(msg_obj=self.a_send, update=True)
|
|
145
146
|
return await Shell.webrepl(msg_obj=self.a_send)
|
|
146
147
|
|
|
147
148
|
# CONFIGURE MODE STATE: ACCESS FOR NODE_CONFIG.JSON
|
|
148
|
-
if msg_list[0].startswith('conf'):
|
|
149
|
+
if local_cmd and msg_list[0].startswith('conf'):
|
|
149
150
|
self.__conf_mode = True
|
|
150
151
|
return True
|
|
151
|
-
if msg_list[0].startswith('noconf'):
|
|
152
|
+
if local_cmd and msg_list[0].startswith('noconf'):
|
|
152
153
|
self.__conf_mode = False
|
|
153
154
|
return True
|
|
154
155
|
|
|
155
156
|
# HELP MSG
|
|
156
|
-
if msg_list[0] == "help":
|
|
157
|
-
await self.a_send("[MICROS]
|
|
158
|
-
await self.a_send(" hello
|
|
159
|
-
await self.a_send(" modules
|
|
160
|
-
await self.a_send(" version
|
|
161
|
-
await self.a_send(" exit
|
|
162
|
-
await self.a_send(" reboot
|
|
163
|
-
await self.a_send(" webrepl
|
|
164
|
-
await self.a_send("[CONF]
|
|
157
|
+
if local_cmd and msg_list[0] == "help":
|
|
158
|
+
await self.a_send("[MICROS]")
|
|
159
|
+
await self.a_send(" hello - hello msg - for device identification")
|
|
160
|
+
await self.a_send(" modules - show active Load Modules")
|
|
161
|
+
await self.a_send(" version - returns micrOS version")
|
|
162
|
+
await self.a_send(" exit - exit shell session")
|
|
163
|
+
await self.a_send(" reboot - system soft reboot (vm), hard reboot (hw): reboot -h")
|
|
164
|
+
await self.a_send(" webrepl - start webrepl, for file transfers use with --update")
|
|
165
|
+
await self.a_send("[CONF] Configuration mode")
|
|
165
166
|
await self.a_send(" conf - Enter conf mode")
|
|
166
|
-
await self.a_send(" dump - Dump all data")
|
|
167
|
+
await self.a_send(" dump - Dump all data, filter: dump <str>")
|
|
167
168
|
await self.a_send(" key - Get value")
|
|
168
169
|
await self.a_send(" key value - Set value")
|
|
169
170
|
await self.a_send(" noconf - Exit conf mode")
|
|
170
|
-
await self.a_send("[TASK]
|
|
171
|
-
await self.a_send(" task list - list tasks
|
|
171
|
+
await self.a_send("[TASK] Task operations")
|
|
172
|
+
await self.a_send(" task list - list tasks by tags")
|
|
172
173
|
await self.a_send(" task kill <tag> - stop task")
|
|
173
174
|
await self.a_send(" task show <tag> - show task output")
|
|
174
|
-
await self.a_send("[EXEC] Command mode (
|
|
175
|
-
await self.a_send("
|
|
175
|
+
await self.a_send("[EXEC] Command mode, syntax(...): <module> <function> <params> <postfix>")
|
|
176
|
+
await self.a_send(" Postfix hints:")
|
|
177
|
+
await self.a_send(" ... &<x> - start one-shot task")
|
|
178
|
+
await self.a_send(" ... &&<x> - start periodic task, where <x>: delay ms [x min: 20ms]")
|
|
179
|
+
await self.a_send(" ... >>hostname - remote command execution (intercon)")
|
|
180
|
+
await self.a_send(" ... >json - request json formatted output")
|
|
181
|
+
await self.a_send(" help lm - list ALL available LoadModules")
|
|
176
182
|
if "lm" in str(msg_list):
|
|
177
183
|
return await Shell._show_lm_funcs(msg_obj=self.a_send)
|
|
178
184
|
return await Shell._show_lm_funcs(msg_obj=self.a_send, active_only=True)
|
|
179
185
|
|
|
180
186
|
# [2] EXECUTE:
|
|
181
187
|
# @1 Configure mode
|
|
182
|
-
if self.__conf_mode and len(msg_list) > 0:
|
|
188
|
+
if local_cmd and self.__conf_mode and len(msg_list) > 0:
|
|
183
189
|
# Lock thread under config handling is threads available
|
|
184
190
|
return await Shell._configure(self.a_send, msg_list)
|
|
185
191
|
# @2 Command mode
|
|
@@ -249,13 +255,13 @@ class Shell:
|
|
|
249
255
|
Dump LM modules with functions - in case of [py] files
|
|
250
256
|
Dump LM module with help function call - in case of [mpy] files
|
|
251
257
|
"""
|
|
252
|
-
async def _help(
|
|
253
|
-
for lm_path in
|
|
258
|
+
async def _help(mods):
|
|
259
|
+
for lm_path in mods:
|
|
254
260
|
lm_name = lm_path.replace('LM_', '').split('.')[0]
|
|
255
261
|
try:
|
|
256
|
-
await msg_obj(f"
|
|
262
|
+
await msg_obj(f" {lm_name}")
|
|
257
263
|
if lm_path.endswith('.mpy'):
|
|
258
|
-
await msg_obj(f"
|
|
264
|
+
await msg_obj(f" {' ' * len(lm_path.replace('LM_', '').split('.')[0])}help")
|
|
259
265
|
continue
|
|
260
266
|
with open(lm_path, 'r') as f:
|
|
261
267
|
line = "micrOSisTheBest"
|
|
@@ -263,19 +269,20 @@ class Shell:
|
|
|
263
269
|
line = f.readline()
|
|
264
270
|
ldata = line.strip()
|
|
265
271
|
if ldata.startswith('def ') and not ldata.split()[1].startswith("_") and 'self' not in ldata:
|
|
266
|
-
await msg_obj(f"
|
|
272
|
+
await msg_obj(f" {' ' * len(lm_name)}{ldata.replace('def ', '').split('(')[0]}")
|
|
267
273
|
except Exception as e:
|
|
268
274
|
await msg_obj(f"[{lm_path}] SHOW LM PARSER WARNING: {e}")
|
|
269
275
|
return False
|
|
270
276
|
return True
|
|
271
277
|
|
|
278
|
+
await msg_obj("")
|
|
272
279
|
# [1] list active modules (default in shell)
|
|
273
280
|
if active_only:
|
|
274
281
|
mod_keys = modules.keys()
|
|
275
|
-
active_modules = (dir_mod for dir_mod in
|
|
282
|
+
active_modules = (dir_mod for dir_mod in ilist_fs(type_filter='f', select="LM") if dir_mod.split('.')[0] in mod_keys)
|
|
276
283
|
return await _help(active_modules)
|
|
277
284
|
# [2] list all LMs on file system (ALL - help lm) - manual
|
|
278
|
-
return await _help(
|
|
285
|
+
return await _help(ilist_fs(type_filter='f', select="LM"))
|
|
279
286
|
|
|
280
287
|
@staticmethod
|
|
281
288
|
async def webrepl(msg_obj, update=False):
|
micrOS/source/Tasks.py
CHANGED
|
@@ -44,7 +44,7 @@ class TaskBase:
|
|
|
44
44
|
self.out = "" # Store task output
|
|
45
45
|
|
|
46
46
|
@staticmethod
|
|
47
|
-
def is_busy(tag) -> bool:
|
|
47
|
+
def is_busy(tag:str) -> bool:
|
|
48
48
|
"""
|
|
49
49
|
Check task is busy by tag
|
|
50
50
|
:param tag: for task selection
|
|
@@ -199,12 +199,9 @@ class MagicTask(TaskBase):
|
|
|
199
199
|
- self.__inloop: lm call type - one-shot (False) / looped (True)
|
|
200
200
|
- self.__msg_buf: lm msg object redirect to variable - store lm output
|
|
201
201
|
"""
|
|
202
|
-
jsonify = self.__callback[-1] == '>json'
|
|
203
|
-
if jsonify:
|
|
204
|
-
self.__callback = self.__callback[:-1]
|
|
205
202
|
while True:
|
|
206
203
|
await self.feed(self.__sleep)
|
|
207
|
-
state, self.out = _exec_lm_core(self.__callback
|
|
204
|
+
state, self.out = _exec_lm_core(self.__callback)
|
|
208
205
|
if not state or not self.__inloop:
|
|
209
206
|
break
|
|
210
207
|
self.task_gc() # Task pool cleanup
|
|
@@ -227,6 +224,7 @@ class Manager:
|
|
|
227
224
|
__slots__ = ['_initialized', 'idle_counter']
|
|
228
225
|
INSTANCE = None # Manager object
|
|
229
226
|
LOAD = 0 # CPU overload measure
|
|
227
|
+
INTERCON = None # Dynamic ref. for interconnect calls
|
|
230
228
|
|
|
231
229
|
def __new__(cls):
|
|
232
230
|
"""
|
|
@@ -337,7 +335,7 @@ class Manager:
|
|
|
337
335
|
_tasks = []
|
|
338
336
|
tag_parts = tag.split('.')
|
|
339
337
|
for t in TaskBase.TASKS:
|
|
340
|
-
if t.startswith(tag_parts[0])
|
|
338
|
+
if len(tag_parts) > 1 and t.startswith('.'.join(tag_parts[0:-1])) and tag_parts[-1] == '*':
|
|
341
339
|
_tasks.append(t)
|
|
342
340
|
if len(_tasks) == 0:
|
|
343
341
|
return []
|
|
@@ -419,19 +417,34 @@ def exec_builtins(func):
|
|
|
419
417
|
- modules - show active modules list
|
|
420
418
|
- task kill ... - task termination
|
|
421
419
|
show ... - task output dump
|
|
422
|
-
- ... >json - postfix to
|
|
420
|
+
- ... >json - postfix to jsonify the output
|
|
423
421
|
"""
|
|
424
|
-
def wrapper(arg_list, jsonify=None):
|
|
422
|
+
def wrapper(arg_list:list, jsonify=None):
|
|
425
423
|
# Ensure the parameter is a list of strings
|
|
426
424
|
if isinstance(arg_list, list) and arg_list:
|
|
427
|
-
#
|
|
428
|
-
|
|
429
|
-
|
|
430
|
-
|
|
425
|
+
# Postfix operator handling
|
|
426
|
+
# ... >json - command output format option
|
|
427
|
+
# ... >>node01.local - intercon: command execution on remote device by hostname/IP address
|
|
428
|
+
arg_list, json_flag = (arg_list[:-1], True) if arg_list[-1] == '>json' else (arg_list, False)
|
|
429
|
+
arg_list, intercon_target = (arg_list[:-1], arg_list[-1].replace(">>", "")) if arg_list[-1].startswith('>>') else (arg_list, None)
|
|
431
430
|
json_flag = jsonify if isinstance(jsonify, bool) else json_flag
|
|
431
|
+
|
|
432
|
+
# INTERCONNECT
|
|
433
|
+
if intercon_target:
|
|
434
|
+
if Manager.INTERCON is None:
|
|
435
|
+
from InterConnect import send_cmd
|
|
436
|
+
Manager.INTERCON = send_cmd
|
|
437
|
+
try:
|
|
438
|
+
out = Manager.INTERCON(host=intercon_target, cmd=arg_list)
|
|
439
|
+
except Exception as e:
|
|
440
|
+
out = {}
|
|
441
|
+
errlog_add(f"[ERR] Intercon: {e}")
|
|
442
|
+
return True, out
|
|
443
|
+
|
|
432
444
|
# MODULES
|
|
433
445
|
if arg_list[0] == 'modules':
|
|
434
446
|
return True, list((m.strip().replace('LM_', '') for m in modules if m.startswith('LM_'))) + ['task']
|
|
447
|
+
|
|
435
448
|
# Handle task manipulation commands: list, kill, show - return True -> Command handled
|
|
436
449
|
if 'task' == arg_list[0]:
|
|
437
450
|
arg_len = len(arg_list)
|
|
@@ -448,13 +461,13 @@ def exec_builtins(func):
|
|
|
448
461
|
if 'show' == arg_list[1]:
|
|
449
462
|
return True, Manager.show(tag=arg_list[2])
|
|
450
463
|
return True, "Invalid task cmd! Help: task list / kill <taskID> / show <taskID>"
|
|
464
|
+
|
|
451
465
|
# Call the decorated function with the additional flag
|
|
452
466
|
return func(arg_list, json_flag)
|
|
453
467
|
return wrapper
|
|
454
468
|
|
|
455
469
|
|
|
456
|
-
|
|
457
|
-
def lm_exec(arg_list, jsonify):
|
|
470
|
+
def lm_exec(arg_list:list, jsonify:bool=None):
|
|
458
471
|
"""
|
|
459
472
|
Main LM executor function with
|
|
460
473
|
- async (background)
|
|
@@ -489,6 +502,7 @@ def lm_exec(arg_list, jsonify):
|
|
|
489
502
|
return state, out
|
|
490
503
|
|
|
491
504
|
|
|
505
|
+
@exec_builtins
|
|
492
506
|
def _exec_lm_core(cmd_list, jsonify):
|
|
493
507
|
"""
|
|
494
508
|
[CORE] Single command executor: MODULE.FUNCTION...
|
|
@@ -535,11 +549,12 @@ def _exec_lm_core(cmd_list, jsonify):
|
|
|
535
549
|
# ------------ LM output format: dict(jsonify) / str(raw) ------------- #
|
|
536
550
|
# Handle LM output data
|
|
537
551
|
if isinstance(lm_output, dict):
|
|
538
|
-
#
|
|
552
|
+
# jsonify (True) json output, (False) default, "human readable" output)
|
|
539
553
|
lm_output = dumps(lm_output) if jsonify else '\n'.join(
|
|
540
554
|
[f" {key}: {value}" for key, value in lm_output.items()])
|
|
541
555
|
if lm_func == 'help':
|
|
542
|
-
# Special case
|
|
556
|
+
# Special case:
|
|
557
|
+
# jsonify (True) json output, (False) default, "human readable" formatted output)
|
|
543
558
|
lm_output = dumps(lm_output) if jsonify else '\n'.join([f" {out}," for out in lm_output])
|
|
544
559
|
# Return LM exec result
|
|
545
560
|
return True, str(lm_output)
|
|
@@ -582,7 +597,7 @@ def exec_lm_pipe(taskstr):
|
|
|
582
597
|
for cmd in (cmd.strip().split() for cmd in taskstr.split(';') if len(cmd) > 0):
|
|
583
598
|
if len(cmd) > 0 and cmd[0].startswith("#"):
|
|
584
599
|
console_write(f"[SKIP] exec_lm_pipe: {' '.join(cmd)}")
|
|
585
|
-
|
|
600
|
+
continue
|
|
586
601
|
if not lm_exec(cmd)[0]:
|
|
587
602
|
errlog_add(f"[WARN] exec_lm_pipe: {cmd}")
|
|
588
603
|
except Exception as e:
|
micrOS/source/Web.py
CHANGED
|
@@ -102,8 +102,9 @@ class WebEngine:
|
|
|
102
102
|
cmd = url.replace('/rest', '')
|
|
103
103
|
if len(cmd) > 1:
|
|
104
104
|
# REST sub-parameter handling (rest commands)
|
|
105
|
-
cmd = (cmd.replace('/', ' ').replace('
|
|
106
|
-
.replace('%E2%80%
|
|
105
|
+
cmd = (cmd.replace('/', ' ').replace('-', ' ').replace("%3E", ">")
|
|
106
|
+
.replace('%22', '"').replace('%E2%80%9C', '"').replace('%E2%80%9D', '"')
|
|
107
|
+
.strip().split())
|
|
107
108
|
# EXECUTE COMMAND - LoadModule
|
|
108
109
|
if WebEngine.AUTH:
|
|
109
110
|
state, out = lm_exec(cmd, jsonify=True) if lm_is_loaded(cmd[0]) else (True, 'Auth:Protected')
|
|
Binary file
|
|
Binary file
|
micrOS/source/microIO.py
CHANGED
|
@@ -10,7 +10,8 @@ Designed by Marcell Ban aka BxNxM
|
|
|
10
10
|
# IMPORTS #
|
|
11
11
|
#################################################################
|
|
12
12
|
from sys import platform
|
|
13
|
-
from uos import
|
|
13
|
+
from uos import uname
|
|
14
|
+
from Files import ilist_fs
|
|
14
15
|
from Logger import syslog
|
|
15
16
|
|
|
16
17
|
#################################################################
|
|
@@ -65,7 +66,7 @@ def set_pinmap(map_data=None):
|
|
|
65
66
|
|
|
66
67
|
# SELECT LOOKUP TABLE BASED ON PLATFORM / User input
|
|
67
68
|
if isinstance(io_file, str) and io_file != 'n/a':
|
|
68
|
-
if f"IO_{io_file}" in [io.split('.')[0] for io in
|
|
69
|
+
if f"IO_{io_file}" in [io.split('.')[0] for io in ilist_fs(type_filter='f', select="IO")]:
|
|
69
70
|
PinMap.MAPPING_LUT = io_file
|
|
70
71
|
return PinMap.MAPPING_LUT
|
|
71
72
|
PinMap.MAPPING_LUT = detect_platform()
|
micrOS/source/urequests.py
CHANGED
|
@@ -197,10 +197,19 @@ async def arequest(method:str, url:str, data:str=None, json=None, headers:dict=N
|
|
|
197
197
|
addr = _host_to_addr(host, port)
|
|
198
198
|
reader, writer = None, None
|
|
199
199
|
|
|
200
|
+
# Open a connection
|
|
200
201
|
try:
|
|
201
|
-
# Open a connection
|
|
202
202
|
reader, writer = await asyncio.open_connection(addr[0], port, ssl=(proto == 'https:'))
|
|
203
|
+
except Exception as e:
|
|
204
|
+
# Refresh host address & reconnect
|
|
205
|
+
if "EHOSTUNREACH" in str(e):
|
|
206
|
+
addr = _host_to_addr(host, port, force=True)
|
|
207
|
+
reader, writer = await asyncio.open_connection(addr[0], port, ssl=(proto == 'https:'))
|
|
208
|
+
else:
|
|
209
|
+
errlog_add(f"[ERR] arequest connection: {e}")
|
|
203
210
|
|
|
211
|
+
# Send request + Wait for the response
|
|
212
|
+
try:
|
|
204
213
|
# Build the HTTP request
|
|
205
214
|
http_request = _build_request(host, method, path, headers, data, json)
|
|
206
215
|
|
|
@@ -1,6 +1,6 @@
|
|
|
1
|
-
Metadata-Version: 2.
|
|
1
|
+
Metadata-Version: 2.4
|
|
2
2
|
Name: micrOSDevToolKit
|
|
3
|
-
Version: 2.
|
|
3
|
+
Version: 2.10.5
|
|
4
4
|
Summary: Development and deployment environment for micrOS, the diy micropython automation OS (IoT)
|
|
5
5
|
Home-page: https://github.com/BxNxM/micrOS
|
|
6
6
|
Author: Marcell Ban
|
|
@@ -31,6 +31,7 @@ Dynamic: description
|
|
|
31
31
|
Dynamic: description-content-type
|
|
32
32
|
Dynamic: home-page
|
|
33
33
|
Dynamic: license
|
|
34
|
+
Dynamic: license-file
|
|
34
35
|
Dynamic: project-url
|
|
35
36
|
Dynamic: requires-dist
|
|
36
37
|
Dynamic: summary
|
|
@@ -494,11 +495,11 @@ Version **3.0.0-0** `micrOS-Autonomous`
|
|
|
494
495
|
- (1) Async SSL/TLS integration (micropython 1.22+ required) [DONE]
|
|
495
496
|
- urequest module async redesign for rest clients [OK]
|
|
496
497
|
- LM_telegram (Notify) + server (listener - chatbot) [OK]
|
|
497
|
-
- (2) ESP-NOW (peer-to-peer communication) integration into InterCon [PoC][TODO]
|
|
498
|
-
- (3) New intercon syntax - command level integration: [
|
|
498
|
+
- (2) ESP-NOW (peer-to-peer communication) integration into InterCon [PoC:OK][TODO]
|
|
499
|
+
- (3) New intercon syntax - command level integration: [DONE]
|
|
499
500
|
- rgb toggle >>RingLight.local
|
|
500
|
-
- similar as: intercon sendcmd host="RingLight.local" cmd="rgb toggle"
|
|
501
|
-
- (4) Create multi level project structure (curret is flat fs) [TODO] FS
|
|
501
|
+
- similar as (obsolete): intercon sendcmd host="RingLight.local" cmd="rgb toggle"
|
|
502
|
+
- (4) Create multi level project structure (curret is flat fs) [TODO?] FS
|
|
502
503
|
- New micrOS FS structure:
|
|
503
504
|
- Note:
|
|
504
505
|
- On device (boot) micrOS Hooks.py/os_dir_fs_hook (check+correct) [Phase1-FS:TODO]
|
|
@@ -528,6 +529,9 @@ Version **3.0.0-0** `micrOS-Autonomous`
|
|
|
528
529
|
- *.js
|
|
529
530
|
- *.css
|
|
530
531
|
|
|
532
|
+
- /logs
|
|
533
|
+
- still there (created runtime)
|
|
534
|
+
|
|
531
535
|
- (5) Proper mip installer support (/lib) [TODO]
|
|
532
536
|
- Note: Autonomous package management over wifi (github)
|
|
533
537
|
- pacman download
|
|
@@ -731,8 +735,6 @@ devToolKit.py -c -p '--dev BedLamp help'
|
|
|
731
735
|
help
|
|
732
736
|
dht22
|
|
733
737
|
help
|
|
734
|
-
intercon
|
|
735
|
-
help
|
|
736
738
|
robustness
|
|
737
739
|
help
|
|
738
740
|
system
|
|
@@ -862,8 +864,6 @@ BedLamp $ help
|
|
|
862
864
|
help
|
|
863
865
|
dht22
|
|
864
866
|
help
|
|
865
|
-
intercon
|
|
866
|
-
help
|
|
867
867
|
robustness
|
|
868
868
|
help
|
|
869
869
|
system
|
|
@@ -954,10 +954,9 @@ micrOS Load Module resources
|
|
|
954
954
|
43 105 LM_lmpacman.py (mlint: True) (pylint: 8.38) (ref.: 0)
|
|
955
955
|
44 176 LM_gameOfLife.py (mlint: True) (pylint: 9.29) (ref.: 2)
|
|
956
956
|
45 58 LM_catgame.py (mlint: True) (pylint: 8.46) (ref.: 0)
|
|
957
|
-
46
|
|
958
|
-
47
|
|
959
|
-
48
|
|
960
|
-
49 34 LM_sdcard.py (mlint: True) (pylint: 7.88) (ref.: 0)
|
|
957
|
+
46 43 LM_ds18.py (mlint: True) (pylint: 5.0) (ref.: 2)
|
|
958
|
+
47 250 LM_i2s_mic.py (mlint: False) (pylint: 8.71) (ref.: 1)
|
|
959
|
+
48 34 LM_sdcard.py (mlint: True) (pylint: 7.88) (ref.: 0)
|
|
961
960
|
|
|
962
961
|
SUM CODE LINES (WITH COMMENTS, WITHOUT EMPTY LINES): 6822
|
|
963
962
|
```
|
|
@@ -1048,7 +1047,6 @@ micrOS/toolkit/workspace/precompiled
|
|
|
1048
1047
|
│ ├── LM_esp32.py
|
|
1049
1048
|
│ ├── LM_genIO.mpy
|
|
1050
1049
|
│ ├── LM_i2c.py
|
|
1051
|
-
│ ├── LM_intercon.mpy
|
|
1052
1050
|
│ ├── LM_light_sensor.mpy
|
|
1053
1051
|
│ ├── LM_neoeffects.mpy
|
|
1054
1052
|
│ ├── LM_neopixel.mpy
|