micrOSDevToolKit 2.10.5__py3-none-any.whl → 2.11.0__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.

Files changed (110) hide show
  1. env/driver_cp210x/macOS_VCP_Driver/SiLabsUSBDriverDisk.dmg +0 -0
  2. env/driver_cp210x/macOS_VCP_Driver/macOS_VCP_Driver_Release_Notes.txt +17 -1
  3. micrOS/micropython/esp32c6-GENERIC-20250415-v1.25.0.bin +0 -0
  4. micrOS/micropython/esp32s3-4MBflash-20241129-v1.24.1.bin +0 -0
  5. micrOS/release_info/micrOS_ReleaseInfo/system_analysis_sum.json +47 -51
  6. micrOS/source/Common.py +262 -87
  7. micrOS/source/Debug.py +44 -88
  8. micrOS/source/Espnow.py +1 -1
  9. micrOS/source/Files.py +21 -2
  10. micrOS/source/Hooks.py +60 -17
  11. micrOS/source/IO_esp32c6.py +16 -0
  12. micrOS/source/IO_esp32s3.py +37 -1
  13. micrOS/source/IO_m5stamp.py +35 -1
  14. micrOS/source/IO_qtpy.py +22 -17
  15. micrOS/source/IO_s3matrix.py +21 -0
  16. micrOS/source/IO_tinypico.py +38 -0
  17. micrOS/source/LM_VL53L0X.py +1 -1
  18. micrOS/source/LM_buzzer.py +6 -7
  19. micrOS/source/LM_cct.py +6 -5
  20. micrOS/source/LM_dimmer.py +6 -5
  21. micrOS/source/LM_espnow.py +15 -10
  22. micrOS/source/LM_i2c.py +3 -2
  23. micrOS/source/LM_neoeffects.py +173 -230
  24. micrOS/source/LM_neomatrix.py +305 -0
  25. micrOS/source/LM_neopixel.py +10 -10
  26. micrOS/source/LM_oled_ui.py +18 -5
  27. micrOS/source/LM_pacman.py +25 -21
  28. micrOS/source/LM_qmi8658.py +204 -0
  29. micrOS/source/LM_rest.py +3 -3
  30. micrOS/source/LM_rgb.py +6 -6
  31. micrOS/source/LM_roboarm.py +5 -4
  32. micrOS/source/LM_switch.py +6 -4
  33. micrOS/source/LM_tcs3472.py +75 -0
  34. micrOS/source/LM_telegram.py +5 -4
  35. micrOS/source/Logger.py +46 -32
  36. micrOS/source/Shell.py +11 -10
  37. micrOS/source/Tasks.py +7 -4
  38. micrOS/source/Time.py +5 -3
  39. micrOS/source/__pycache__/Common.cpython-312.pyc +0 -0
  40. micrOS/source/__pycache__/Logger.cpython-312.pyc +0 -0
  41. micrOS/source/micrOS.py +5 -2
  42. micrOS/source/microIO.py +8 -6
  43. {microsdevtoolkit-2.10.5.dist-info → microsdevtoolkit-2.11.0.dist-info}/METADATA +2 -1
  44. {microsdevtoolkit-2.10.5.dist-info → microsdevtoolkit-2.11.0.dist-info}/RECORD +101 -96
  45. toolkit/DevEnvUSB.py +5 -0
  46. toolkit/Gateway.py +3 -3
  47. toolkit/LM_to_compile.dat +1 -0
  48. toolkit/dashboard_apps/NeoEffectsDemo.py +8 -15
  49. toolkit/dashboard_apps/QMI8685_GYRO.py +68 -0
  50. toolkit/dashboard_apps/_app_base.py +2 -2
  51. toolkit/dashboard_apps/_gyro_visualizer.py +78 -0
  52. toolkit/simulator_lib/__pycache__/IO_darwin.cpython-312.pyc +0 -0
  53. toolkit/simulator_lib/__pycache__/machine.cpython-312.pyc +0 -0
  54. toolkit/simulator_lib/__pycache__/neopixel.cpython-312.pyc +0 -0
  55. toolkit/simulator_lib/__pycache__/sim_console.cpython-312.pyc +0 -0
  56. toolkit/simulator_lib/machine.py +0 -1
  57. toolkit/simulator_lib/neopixel.py +3 -2
  58. toolkit/socketClient.py +3 -2
  59. toolkit/user_data/webhooks/generic.py +1 -1
  60. toolkit/user_data/webhooks/macro.py +1 -1
  61. toolkit/user_data/webhooks/template.py +1 -1
  62. toolkit/workspace/precompiled/Common.mpy +0 -0
  63. toolkit/workspace/precompiled/Debug.mpy +0 -0
  64. toolkit/workspace/precompiled/Espnow.mpy +0 -0
  65. toolkit/workspace/precompiled/Files.mpy +0 -0
  66. toolkit/workspace/precompiled/Hooks.mpy +0 -0
  67. toolkit/workspace/precompiled/IO_esp32c6.mpy +0 -0
  68. toolkit/workspace/precompiled/IO_esp32s3.mpy +0 -0
  69. toolkit/workspace/precompiled/IO_m5stamp.mpy +0 -0
  70. toolkit/workspace/precompiled/IO_qtpy.mpy +0 -0
  71. toolkit/workspace/precompiled/IO_s3matrix.mpy +0 -0
  72. toolkit/workspace/precompiled/IO_tinypico.mpy +0 -0
  73. toolkit/workspace/precompiled/LM_VL53L0X.py +1 -1
  74. toolkit/workspace/precompiled/LM_buzzer.mpy +0 -0
  75. toolkit/workspace/precompiled/LM_cct.mpy +0 -0
  76. toolkit/workspace/precompiled/LM_dimmer.mpy +0 -0
  77. toolkit/workspace/precompiled/LM_espnow.py +15 -10
  78. toolkit/workspace/precompiled/LM_i2c.py +3 -2
  79. toolkit/workspace/precompiled/LM_neoeffects.mpy +0 -0
  80. toolkit/workspace/precompiled/LM_neomatrix.mpy +0 -0
  81. toolkit/workspace/precompiled/LM_neopixel.mpy +0 -0
  82. toolkit/workspace/precompiled/LM_oled_ui.mpy +0 -0
  83. toolkit/workspace/precompiled/LM_pacman.mpy +0 -0
  84. toolkit/workspace/precompiled/LM_qmi8658.py +204 -0
  85. toolkit/workspace/precompiled/LM_rest.mpy +0 -0
  86. toolkit/workspace/precompiled/LM_rgb.mpy +0 -0
  87. toolkit/workspace/precompiled/LM_roboarm.mpy +0 -0
  88. toolkit/workspace/precompiled/LM_switch.mpy +0 -0
  89. toolkit/workspace/precompiled/LM_tcs3472.py +75 -0
  90. toolkit/workspace/precompiled/LM_telegram.mpy +0 -0
  91. toolkit/workspace/precompiled/Logger.mpy +0 -0
  92. toolkit/workspace/precompiled/Shell.mpy +0 -0
  93. toolkit/workspace/precompiled/Tasks.mpy +0 -0
  94. toolkit/workspace/precompiled/Time.mpy +0 -0
  95. toolkit/workspace/precompiled/micrOS.mpy +0 -0
  96. toolkit/workspace/precompiled/microIO.mpy +0 -0
  97. micrOS/micropython/esp32s3-20240105-v1.22.1.bin +0 -0
  98. micrOS/source/LM_catgame.py +0 -75
  99. micrOS/source/LM_demo.py +0 -97
  100. micrOS/source/LM_intercon.py +0 -60
  101. micrOS/source/LM_ph_sensor.py +0 -51
  102. toolkit/workspace/precompiled/LM_catgame.py +0 -75
  103. toolkit/workspace/precompiled/LM_demo.py +0 -97
  104. toolkit/workspace/precompiled/LM_intercon.mpy +0 -0
  105. toolkit/workspace/precompiled/LM_ph_sensor.py +0 -51
  106. /micrOS/micropython/{esp32s3-20241129-v1.24.1.bin → esp32s3-8MBflash-20241129-v1.24.1.bin} +0 -0
  107. {microsdevtoolkit-2.10.5.data → microsdevtoolkit-2.11.0.data}/scripts/devToolKit.py +0 -0
  108. {microsdevtoolkit-2.10.5.dist-info → microsdevtoolkit-2.11.0.dist-info}/WHEEL +0 -0
  109. {microsdevtoolkit-2.10.5.dist-info → microsdevtoolkit-2.11.0.dist-info}/licenses/LICENSE +0 -0
  110. {microsdevtoolkit-2.10.5.dist-info → microsdevtoolkit-2.11.0.dist-info}/top_level.txt +0 -0
micrOS/source/Shell.py CHANGED
@@ -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.10.5-0'
28
+ MICROS_VERSION = '2.11.0-0'
29
29
 
30
30
  def __init__(self):
31
31
  """
@@ -106,7 +106,8 @@ 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
+ # INTERCON embedding: conf mode and remote call request check
110
+ is_local_cmd = self.__conf_mode or not msg_list[-1].startswith(">>")
110
111
 
111
112
  ##########################################
112
113
  # [1] Handle built-in shell commands #
@@ -114,7 +115,7 @@ class Shell:
114
115
  ##########################################
115
116
 
116
117
  # Hello message
117
- if local_cmd and msg_list[0] == 'hello':
118
+ if is_local_cmd and msg_list[0] == 'hello':
118
119
  # For low level device identification - hello msg
119
120
  await self.a_send(f"hello:{self.__devfid}:{self.__hwuid}")
120
121
  return True
@@ -127,34 +128,34 @@ class Shell:
127
128
  return True
128
129
 
129
130
  # Version handling
130
- if local_cmd and msg_list[0] == 'version':
131
+ if is_local_cmd and msg_list[0] == 'version':
131
132
  # For micrOS system version info
132
133
  await self.a_send(str(Shell.MICROS_VERSION))
133
134
  return True
134
135
 
135
136
  # Reboot micropython VM
136
- if local_cmd and msg_list[0] == 'reboot':
137
+ if is_local_cmd and msg_list[0] == 'reboot':
137
138
  hard = False
138
139
  if len(msg_list) >= 2 and "-h" in msg_list[1]:
139
140
  # reboot / reboot -h
140
141
  hard = True
141
142
  await self.reboot(hard)
142
143
 
143
- if local_cmd and msg_list[0].startswith('webrepl'):
144
+ if is_local_cmd and msg_list[0].startswith('webrepl'):
144
145
  if len(msg_list) == 2 and '-u' in msg_list[1]:
145
146
  await Shell.webrepl(msg_obj=self.a_send, update=True)
146
147
  return await Shell.webrepl(msg_obj=self.a_send)
147
148
 
148
149
  # CONFIGURE MODE STATE: ACCESS FOR NODE_CONFIG.JSON
149
- if local_cmd and msg_list[0].startswith('conf'):
150
+ if is_local_cmd and msg_list[0].startswith('conf'):
150
151
  self.__conf_mode = True
151
152
  return True
152
- if local_cmd and msg_list[0].startswith('noconf'):
153
+ if is_local_cmd and msg_list[0].startswith('noconf'):
153
154
  self.__conf_mode = False
154
155
  return True
155
156
 
156
157
  # HELP MSG
157
- if local_cmd and msg_list[0] == "help":
158
+ if is_local_cmd and msg_list[0] == "help":
158
159
  await self.a_send("[MICROS]")
159
160
  await self.a_send(" hello - hello msg - for device identification")
160
161
  await self.a_send(" modules - show active Load Modules")
@@ -185,7 +186,7 @@ class Shell:
185
186
 
186
187
  # [2] EXECUTE:
187
188
  # @1 Configure mode
188
- if local_cmd and self.__conf_mode and len(msg_list) > 0:
189
+ if is_local_cmd and self.__conf_mode and len(msg_list) > 0:
189
190
  # Lock thread under config handling is threads available
190
191
  return await Shell._configure(self.a_send, msg_list)
191
192
  # @2 Command mode
micrOS/source/Tasks.py CHANGED
@@ -98,9 +98,11 @@ class TaskBase:
98
98
  async def feed(sleep_ms=1):
99
99
  """
100
100
  Feed event loop
101
- :param sleep_ms: in millisecond (min: 1)
101
+ :param sleep_ms: in millisecond
102
102
  """
103
103
  # TODO: feed WDT - preemptive cooperative multitasking aka reboot if no feed until X time period
104
+ if sleep_ms <= 0:
105
+ return await asyncio.sleep(0.000_000_1) # 0 means: 100ns (Absolute minimum)
104
106
  return await asyncio.sleep_ms(sleep_ms)
105
107
 
106
108
  def __del__(self):
@@ -116,7 +118,7 @@ class NativeTask(TaskBase):
116
118
  - could be built in function or custom code from load modules
117
119
  """
118
120
 
119
- def create(self, callback=None, tag=None):
121
+ def create(self, callback:callable=None, tag:str=None) -> bool:
120
122
  """
121
123
  Create async task with coroutine callback (no queue limit check!)
122
124
  + async socket server task
@@ -166,7 +168,7 @@ class MagicTask(TaskBase):
166
168
  self.__inloop = False # [LM] Task while loop for LM callback
167
169
  self.__sleep = 20 # [LM] Task while loop - async wait (proc feed) [ms]
168
170
 
169
- def create(self, callback=None, loop=None, sleep=None):
171
+ def create(self, callback:list=None, loop:bool=None, sleep:int=None) -> bool:
170
172
  """
171
173
  Create async task with function callback (with queue limit check)
172
174
  - wrap (sync) function into async task (task_wrapper)
@@ -295,11 +297,12 @@ class Manager:
295
297
  my_task.done.set()
296
298
 
297
299
  @staticmethod
298
- def create_task(callback, tag=None, loop=False, delay=None):
300
+ def create_task(callback, tag:str=None, loop:bool=False, delay:int=None):
299
301
  """
300
302
  Primary interface
301
303
  Generic task creator method
302
304
  Create async Task with coroutine/list(lm call) callback
305
+ :param callback: list|callable
303
306
  """
304
307
  if isinstance(callback, list):
305
308
  # Check queue if task is Load Module
micrOS/source/Time.py CHANGED
@@ -16,12 +16,14 @@ from utime import sleep_ms, time, mktime, localtime
16
16
  from Config import cfgput, cfgget
17
17
  from Debug import errlog_add, console_write
18
18
  from urequests import get as http_get
19
+ from Files import OSPath, path_join
19
20
 
20
21
 
21
22
  class Sun:
22
23
  TIME = {}
23
24
  UTC = cfgget('utc') # STORED IN MINUTE
24
25
  BOOTIME = None # Initialize BOOTIME: Not SUN, but for system uptime
26
+ FILE_CACHE = path_join(OSPath.DATA, 'sun.cache')
25
27
 
26
28
 
27
29
  def set_time(year, month, mday, hour, minute, sec):
@@ -89,14 +91,14 @@ def ntp_time():
89
91
 
90
92
  def __sun_cache(mode):
91
93
  """
92
- pds - persistent data structure
94
+ File cache
93
95
  modes:
94
96
  r - recover, s - save
95
97
  """
96
98
  if mode == 's':
97
99
  # SAVE CACHE
98
100
  try:
99
- with open('sun.pds', 'w') as f:
101
+ with open(Sun.FILE_CACHE, 'w') as f:
100
102
  cache = {k:tuple([str(t) for t in v]) for k, v in Sun.TIME.items()}
101
103
  f.write(';'.join([f'{k}:{"-".join(v)}' for k, v in cache.items()]))
102
104
  except:
@@ -104,7 +106,7 @@ def __sun_cache(mode):
104
106
  return
105
107
  try:
106
108
  # RESTORE CACHE
107
- with open('sun.pds', 'r') as f:
109
+ with open(Sun.FILE_CACHE, 'r') as f:
108
110
  buff = {data.split(':')[0]: data.split(':')[1].split('-')
109
111
  for data in f.read().strip().split(';')}
110
112
  for k, v in buff.items():
micrOS/source/micrOS.py CHANGED
@@ -9,7 +9,7 @@ Designed by Marcell Ban aka BxNxM
9
9
  #################################################################
10
10
  from Time import ntp_time, suntime
11
11
  from Tasks import Manager
12
- from Hooks import bootup, profiling_info
12
+ from Hooks import bootup, profiling_info, enableESPNow
13
13
  from Network import auto_nw_config
14
14
  from Server import Server
15
15
  from Interrupts import enableInterrupt, enableCron, initEventIRQs
@@ -74,7 +74,10 @@ def micrOS():
74
74
 
75
75
  # [Server] as async task
76
76
  aio.create_task(Server().run_server(), tag='server')
77
- profiling_info(label='[memUsage] SYSTEM IS UP')
77
+
78
+ # [ESPNow] server as async task
79
+ enableESPNow()
80
+ profiling_info(label='[memUsage] SYSTEM IS UP AND RUNNING')
78
81
 
79
82
  # [EVENT LOOP] Start async event loop
80
83
  aio.run_forever()
micrOS/source/microIO.py CHANGED
@@ -30,17 +30,19 @@ def detect_platform():
30
30
  """
31
31
  Unified platform detection for micrOS
32
32
  """
33
- if 'esp32' in platform:
33
+ if 'esp32' in platform: # esp32 family
34
34
  board = str(uname()[-1]).lower()
35
35
  if 'tinypico' in board:
36
- return 'tinypico' # esp32 family - tinypico
36
+ return 'tinypico'
37
37
  if 'esp32s2' in board:
38
- return 'esp32s2' # esp32 family - esp32S2
38
+ return 'esp32s2'
39
39
  if 'esp32s3' in board:
40
- return 'esp32s3' # esp32 family - esp32s3
40
+ return 'esp32s3'
41
41
  if 'esp32c3' in board:
42
- return 'esp32c3' # esp32 family - esp32c3
43
- return 'esp32' # esp32 family - general
42
+ return 'esp32c3'
43
+ if 'esp32c6' in board:
44
+ return 'esp32c6'
45
+ return 'esp32' # esp32 family: general
44
46
  return platform # esp8266 or something else
45
47
 
46
48
 
@@ -1,6 +1,6 @@
1
1
  Metadata-Version: 2.4
2
2
  Name: micrOSDevToolKit
3
- Version: 2.10.5
3
+ Version: 2.11.0
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
@@ -404,6 +404,7 @@ These parameters controlls micrOS core functionalities, so you can define an ent
404
404
  | **`appwd`** | `ADmin123` `<str>` | Yes | Device system password.: Used in AP password (access point mode) + webrepl password + micrOS auth
405
405
  | **`boothook`** | `n/a` `<str>` | Yes | Add Load Module execution(s) to the boot sequence. Separator `;`. Examples: `rgb load; cct load` but you can call any load module function here if you want to run it at boot time.
406
406
  | **`webui`** | `False` `bool` | Yes | Launch http rest server on port 80 (in parallel with micrOS shell on port 9008 aka `socport`). It has 2 endpoints: / aka main page (index.html) and /rest aka rest (json) interface for load module execution. Example: `<devfid>.local` or `<devfid>.local/rest` + optional parameters: `/rgb/toggle`. **Apple shortcuts compatible**
407
+ | **`espnow`** | `False` `bool` | Yes | Enable **ESPNow communication protocol**. It starts `espnow.server` task, that can receive espnow messages and execute Load Module commands. It is an extension for **InterCon** feature example: `system heartbeat >>target.local`.
407
408
  | | |
408
409
  | **`cron`** | `False` `<bool>` | Yes | Enable timestamp based Load Module execution aka Cron scheduler (linux terminology), Timer(1) hardware interrupt enabler.
409
410
  | **`crontasks`** | `n/a` `<str>` | Yes | Cron scheduler input, task format: `WD:H:M:S!module function` e.g.: `1:8:0:0!system heartbeat`, task separator in case of multiple tasks: `;`. [WD:0-6, H:0-23, M:0-59, S:0-59] in case of each use: `*`. Instead `WD:H:M:S` you can use suntime tags: `sunset`, `sunrise`, optional offset: `sunset+-<minutes>`, `sunrise+-<minutes>`, example: `sunset-30!system heartbeat`. Range of days: WD can be conrete day number or range like: 0-2 means Monday to Wednesday.