micrOSDevToolKit 2.1.5__py3-none-any.whl → 2.26.1__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.
Files changed (400) hide show
  1. env/driver_cp210x/.DS_Store +0 -0
  2. env/driver_cp210x/macOS_VCP_Driver/SiLabsUSBDriverDisk.dmg +0 -0
  3. env/driver_cp210x/macOS_VCP_Driver/macOS_VCP_Driver_Release_Notes.txt +17 -1
  4. micrOS/micropython/esp32-20251209-v1.27.0.bin +0 -0
  5. micrOS/micropython/esp32c3-20251209-v1.27.0.bin +0 -0
  6. micrOS/micropython/esp32c6-20251209-v1.27.0.bin +0 -0
  7. micrOS/micropython/esp32s2-20251209-v1.27.0.bin +0 -0
  8. micrOS/micropython/esp32s2-LOLIN_MINI-20251209-v1.27.0.bin +0 -0
  9. micrOS/micropython/esp32s3-4MBflash-20241129-v1.24.1.bin +0 -0
  10. micrOS/micropython/esp32s3-8MBflash-20251209-v1.27.0.bin +0 -0
  11. micrOS/micropython/esp32s3_spiram_oct-20251209-v1.27.0.bin +0 -0
  12. micrOS/micropython/rpi-pico-w-20251209-v1.27.0.uf2 +0 -0
  13. micrOS/micropython/tinypico-20251209-v1.27.0.bin +0 -0
  14. micrOS/release_info/micrOS_ReleaseInfo/system_analysis_sum.json +191 -151
  15. micrOS/source/Auth.py +37 -0
  16. micrOS/source/Common.py +376 -102
  17. micrOS/source/Config.py +55 -25
  18. micrOS/source/Debug.py +54 -193
  19. micrOS/source/Espnow.py +404 -0
  20. micrOS/source/Files.py +207 -0
  21. micrOS/source/Hooks.py +88 -16
  22. micrOS/source/InterConnect.py +130 -46
  23. micrOS/source/Interrupts.py +8 -8
  24. micrOS/source/Logger.py +131 -0
  25. micrOS/source/Network.py +41 -21
  26. micrOS/source/Notify.py +74 -198
  27. micrOS/source/Pacman.py +326 -0
  28. micrOS/source/Scheduler.py +18 -55
  29. micrOS/source/Server.py +84 -217
  30. micrOS/source/Shell.py +103 -93
  31. micrOS/source/Tasks.py +239 -173
  32. micrOS/source/Time.py +21 -22
  33. micrOS/source/Types.py +89 -54
  34. micrOS/source/Web.py +485 -0
  35. micrOS/source/__pycache__/Common.cpython-312.pyc +0 -0
  36. micrOS/source/__pycache__/Debug.cpython-312.pyc +0 -0
  37. micrOS/source/__pycache__/Files.cpython-312.pyc +0 -0
  38. micrOS/source/__pycache__/Logger.cpython-312.pyc +0 -0
  39. micrOS/source/__pycache__/Scheduler.cpython-312.pyc +0 -0
  40. micrOS/source/__pycache__/Server.cpython-312.pyc +0 -0
  41. micrOS/source/__pycache__/Shell.cpython-312.pyc +0 -0
  42. micrOS/source/__pycache__/replhelper.cpython-312.pyc +0 -0
  43. micrOS/source/helpers.py +132 -0
  44. micrOS/source/micrOS.py +25 -21
  45. micrOS/source/micrOSloader.py +14 -23
  46. micrOS/source/microIO.py +94 -57
  47. toolkit/simulator_lib/LP_darwin.py → micrOS/source/modules/IO_esp32.py +22 -11
  48. micrOS/source/{IO_esp32c3.py → modules/IO_esp32c3.py} +6 -1
  49. micrOS/source/modules/IO_esp32c6.py +38 -0
  50. micrOS/source/{IO_esp32s2.py → modules/IO_esp32s2.py} +6 -1
  51. micrOS/source/{IO_esp32s3.py → modules/IO_esp32s3.py} +43 -2
  52. micrOS/source/modules/IO_m5stamp.py +86 -0
  53. micrOS/source/{IO_qtpy.py → modules/IO_qtpy.py} +28 -18
  54. micrOS/source/{IO_tinypico.py → modules/IO_tinypico.py} +48 -3
  55. micrOS/source/modules/LM_L298N.py +161 -0
  56. {toolkit/workspace/precompiled → micrOS/source/modules}/LM_L9110_DCmotor.py +4 -4
  57. micrOS/source/{LM_OV2640.py → modules/LM_OV2640.py} +53 -42
  58. micrOS/source/{LM_VL53L0X.py → modules/LM_VL53L0X.py} +5 -5
  59. micrOS/source/{LM_aht10.py → modules/LM_aht10.py} +12 -4
  60. micrOS/source/{LM_bme280.py → modules/LM_bme280.py} +13 -25
  61. micrOS/source/{LM_buzzer.py → modules/LM_buzzer.py} +42 -40
  62. micrOS/source/{LM_cct.py → modules/LM_cct.py} +22 -27
  63. micrOS/source/modules/LM_cluster.py +255 -0
  64. micrOS/source/{LM_co2.py → modules/LM_co2.py} +13 -6
  65. micrOS/source/{LM_dht11.py → modules/LM_dht11.py} +13 -29
  66. micrOS/source/{LM_dht22.py → modules/LM_dht22.py} +13 -28
  67. micrOS/source/{LM_dimmer.py → modules/LM_dimmer.py} +19 -16
  68. micrOS/source/modules/LM_distance.py +135 -0
  69. micrOS/source/{LM_ds18.py → modules/LM_ds18.py} +12 -4
  70. micrOS/source/{LM_esp32.py → modules/LM_esp32.py} +16 -4
  71. micrOS/source/modules/LM_espnow.py +53 -0
  72. micrOS/source/modules/LM_fileserver.py +265 -0
  73. micrOS/source/{LM_gameOfLife.py → modules/LM_gameOfLife.py} +5 -5
  74. micrOS/source/{LM_genIO.py → modules/LM_genIO.py} +49 -35
  75. micrOS/source/modules/LM_haptic.py +111 -0
  76. micrOS/source/modules/LM_i2c.py +61 -0
  77. micrOS/source/{LM_i2s_mic.py → modules/LM_i2s_mic.py} +20 -23
  78. micrOS/source/{LM_ld2410.py → modules/LM_ld2410.py} +3 -3
  79. micrOS/source/{LM_light_sensor.py → modules/LM_light_sensor.py} +22 -26
  80. micrOS/source/modules/LM_mh_z19c.py +198 -0
  81. micrOS/source/modules/LM_neoeffects.py +284 -0
  82. micrOS/source/{LM_neopixel.py → modules/LM_neopixel.py} +26 -31
  83. micrOS/source/{LM_oled.py → modules/LM_oled.py} +28 -20
  84. micrOS/source/{LM_oled_sh1106.py → modules/LM_oled_sh1106.py} +28 -24
  85. micrOS/source/{LM_oled_ui.py → modules/LM_oled_ui.py} +132 -174
  86. micrOS/source/modules/LM_pacman.py +320 -0
  87. micrOS/source/{LM_presence.py → modules/LM_presence.py} +24 -36
  88. micrOS/source/modules/LM_qmi8658.py +204 -0
  89. micrOS/source/{LM_rencoder.py → modules/LM_rencoder.py} +40 -11
  90. micrOS/source/modules/LM_rest.py +81 -0
  91. micrOS/source/{LM_rgb.py → modules/LM_rgb.py} +25 -34
  92. micrOS/source/{LM_rgbcct.py → modules/LM_rgbcct.py} +5 -5
  93. micrOS/source/{LM_roboarm.py → modules/LM_roboarm.py} +37 -45
  94. micrOS/source/modules/LM_robustness.py +137 -0
  95. micrOS/source/{LM_rp2w.py → modules/LM_rp2w.py} +3 -0
  96. micrOS/source/{LM_sdcard.py → modules/LM_sdcard.py} +3 -0
  97. micrOS/source/{LM_servo.py → modules/LM_servo.py} +4 -4
  98. micrOS/source/modules/LM_sound_event.py +751 -0
  99. micrOS/source/{LM_stepper.py → modules/LM_stepper.py} +8 -8
  100. micrOS/source/{LM_switch.py → modules/LM_switch.py} +21 -18
  101. micrOS/source/{LM_system.py → modules/LM_system.py} +96 -59
  102. micrOS/source/modules/LM_tcs3472.py +187 -0
  103. micrOS/source/modules/LM_telegram.py +388 -0
  104. micrOS/source/modules/LM_trackball.py +287 -0
  105. micrOS/source/modules/LM_veml7700.py +159 -0
  106. micrOS/source/modules/LM_web.py +38 -0
  107. micrOS/source/urequests.py +204 -91
  108. {toolkit/workspace/precompiled → micrOS/source/web}/dashboard.html +9 -4
  109. micrOS/source/web/editor.js +440 -0
  110. micrOS/source/web/filesui.html +178 -0
  111. micrOS/source/web/filesui.js +338 -0
  112. micrOS/source/{index.html → web/index.html} +44 -2
  113. micrOS/source/web/uapi.js +103 -0
  114. micrOS/source/web/udashboard.js +129 -0
  115. micrOS/source/web/ustyle.css +55 -0
  116. micrOS/source/web/uwidgets.js +172 -0
  117. micrOS/source/web/uwidgets_pro.js +99 -0
  118. micrOS/utests/__init__.py +0 -0
  119. micrOS/utests/test_scheduler.py +435 -0
  120. {micrOSDevToolKit-2.1.5.data → microsdevtoolkit-2.26.1.data}/scripts/devToolKit.py +47 -4
  121. {micrOSDevToolKit-2.1.5.dist-info → microsdevtoolkit-2.26.1.dist-info}/METADATA +392 -279
  122. microsdevtoolkit-2.26.1.dist-info/RECORD +396 -0
  123. {micrOSDevToolKit-2.1.5.dist-info → microsdevtoolkit-2.26.1.dist-info}/WHEEL +1 -1
  124. toolkit/DevEnvCompile.py +63 -33
  125. toolkit/DevEnvOTA.py +72 -22
  126. toolkit/DevEnvUSB.py +147 -77
  127. toolkit/Gateway.py +9 -9
  128. toolkit/LM_to_compile.dat +12 -4
  129. toolkit/MicrOSDevEnv.py +129 -51
  130. toolkit/WebRepl.py +73 -0
  131. toolkit/dashboard_apps/BackupRestore.py +171 -0
  132. toolkit/dashboard_apps/CCTDemo.py +12 -17
  133. toolkit/dashboard_apps/CCTTest.py +20 -24
  134. toolkit/dashboard_apps/CamStream.py +2 -6
  135. toolkit/dashboard_apps/CatGame.py +14 -16
  136. toolkit/dashboard_apps/Dimmer.py +11 -21
  137. toolkit/dashboard_apps/GetVersion.py +11 -19
  138. toolkit/dashboard_apps/MicrophoneTest.py +2 -7
  139. toolkit/dashboard_apps/NeoEffectsDemo.py +22 -35
  140. toolkit/dashboard_apps/NeopixelTest.py +20 -25
  141. toolkit/dashboard_apps/PresenceTest.py +2 -8
  142. toolkit/dashboard_apps/QMI8685_GYRO.py +68 -0
  143. toolkit/dashboard_apps/RGBTest.py +20 -24
  144. toolkit/dashboard_apps/RoboArm.py +24 -32
  145. toolkit/dashboard_apps/SED_test.py +10 -14
  146. toolkit/dashboard_apps/SensorsTest.py +61 -0
  147. toolkit/dashboard_apps/SystemTest.py +219 -117
  148. toolkit/dashboard_apps/Template_app.py +12 -19
  149. toolkit/dashboard_apps/_app_base.py +34 -0
  150. toolkit/dashboard_apps/_gyro_visualizer.py +78 -0
  151. toolkit/dashboard_apps/uLightDemo.py +15 -24
  152. toolkit/index.html +6 -5
  153. toolkit/lib/LocalMachine.py +6 -1
  154. toolkit/lib/MicrosFiles.py +46 -0
  155. toolkit/lib/Repository.py +64 -0
  156. toolkit/lib/TerminalColors.py +4 -0
  157. toolkit/lib/macroScript.py +371 -0
  158. toolkit/lib/micrOSClient.py +124 -51
  159. toolkit/lib/micrOSClientHistory.py +156 -0
  160. toolkit/lib/pip_package_installer.py +31 -4
  161. toolkit/micrOSdashboard.py +16 -21
  162. toolkit/micrOSlint.py +28 -10
  163. toolkit/simulator_lib/.DS_Store +0 -0
  164. micrOS/source/IO_esp32.py → toolkit/simulator_lib/IO_darwin.py +3 -0
  165. toolkit/simulator_lib/__pycache__/IO_darwin.cpython-312.pyc +0 -0
  166. toolkit/simulator_lib/__pycache__/aioespnow.cpython-312.pyc +0 -0
  167. toolkit/simulator_lib/__pycache__/camera.cpython-312.pyc +0 -0
  168. toolkit/simulator_lib/__pycache__/framebuf.cpython-312.pyc +0 -0
  169. toolkit/simulator_lib/__pycache__/machine.cpython-312.pyc +0 -0
  170. toolkit/simulator_lib/__pycache__/micropython.cpython-312.pyc +0 -0
  171. toolkit/simulator_lib/__pycache__/mip.cpython-312.pyc +0 -0
  172. toolkit/simulator_lib/__pycache__/neopixel.cpython-312.pyc +0 -0
  173. toolkit/simulator_lib/__pycache__/network.cpython-312.pyc +0 -0
  174. toolkit/simulator_lib/__pycache__/sim_common.cpython-312.pyc +0 -0
  175. toolkit/simulator_lib/__pycache__/simgc.cpython-312.pyc +0 -0
  176. toolkit/simulator_lib/__pycache__/simulator.cpython-312.pyc +0 -0
  177. toolkit/simulator_lib/__pycache__/uasyncio.cpython-312.pyc +0 -0
  178. toolkit/simulator_lib/__pycache__/uos.cpython-312.pyc +0 -0
  179. toolkit/simulator_lib/__pycache__/urandom.cpython-312.pyc +0 -0
  180. toolkit/simulator_lib/__pycache__/usocket.cpython-312.pyc +0 -0
  181. toolkit/simulator_lib/__pycache__/ussl.cpython-312.pyc +0 -0
  182. toolkit/simulator_lib/aioespnow.py +28 -0
  183. toolkit/simulator_lib/camera.py +84 -0
  184. toolkit/simulator_lib/dht.py +1 -1
  185. toolkit/simulator_lib/framebuf.py +49 -1
  186. toolkit/simulator_lib/machine.py +32 -2
  187. toolkit/simulator_lib/micropython.py +3 -3
  188. toolkit/simulator_lib/mip.py +165 -0
  189. toolkit/simulator_lib/neopixel.py +3 -2
  190. toolkit/simulator_lib/network.py +2 -1
  191. toolkit/simulator_lib/node_config.json +2 -3
  192. toolkit/simulator_lib/ntptime.py +1 -1
  193. toolkit/simulator_lib/{sim_console.py → sim_common.py} +2 -3
  194. toolkit/simulator_lib/simgc.py +6 -2
  195. toolkit/simulator_lib/simulator.py +138 -46
  196. toolkit/simulator_lib/uasyncio.py +34 -3
  197. toolkit/simulator_lib/uos.py +147 -0
  198. toolkit/simulator_lib/urandom.py +4 -0
  199. toolkit/simulator_lib/usocket.py +5 -1
  200. toolkit/simulator_lib/view01.jpg +0 -0
  201. toolkit/simulator_lib/view02.jpg +0 -0
  202. toolkit/socketClient.py +43 -23
  203. toolkit/user_data/webhooks/generic.py +1 -1
  204. toolkit/user_data/webhooks/macro.py +44 -0
  205. toolkit/user_data/webhooks/template.macro +20 -0
  206. toolkit/user_data/webhooks/template.py +1 -1
  207. toolkit/workspace/precompiled/Auth.mpy +0 -0
  208. toolkit/workspace/precompiled/Common.mpy +0 -0
  209. toolkit/workspace/precompiled/Config.mpy +0 -0
  210. toolkit/workspace/precompiled/Debug.mpy +0 -0
  211. toolkit/workspace/precompiled/Espnow.mpy +0 -0
  212. toolkit/workspace/precompiled/Files.mpy +0 -0
  213. toolkit/workspace/precompiled/Hooks.mpy +0 -0
  214. toolkit/workspace/precompiled/InterConnect.mpy +0 -0
  215. toolkit/workspace/precompiled/Interrupts.mpy +0 -0
  216. toolkit/workspace/precompiled/Logger.mpy +0 -0
  217. toolkit/workspace/precompiled/Network.mpy +0 -0
  218. toolkit/workspace/precompiled/Notify.mpy +0 -0
  219. toolkit/workspace/precompiled/Pacman.mpy +0 -0
  220. toolkit/workspace/precompiled/Scheduler.mpy +0 -0
  221. toolkit/workspace/precompiled/Server.mpy +0 -0
  222. toolkit/workspace/precompiled/Shell.mpy +0 -0
  223. toolkit/workspace/precompiled/Tasks.mpy +0 -0
  224. toolkit/workspace/precompiled/Time.mpy +0 -0
  225. toolkit/workspace/precompiled/Types.mpy +0 -0
  226. toolkit/workspace/precompiled/Web.mpy +0 -0
  227. toolkit/workspace/precompiled/_mpy.version +1 -1
  228. toolkit/workspace/precompiled/config/_git.keep +0 -0
  229. toolkit/workspace/precompiled/helpers.mpy +0 -0
  230. toolkit/workspace/precompiled/micrOS.mpy +0 -0
  231. toolkit/workspace/precompiled/micrOSloader.mpy +0 -0
  232. toolkit/workspace/precompiled/microIO.mpy +0 -0
  233. toolkit/workspace/precompiled/modules/IO_esp32.mpy +0 -0
  234. toolkit/workspace/precompiled/modules/IO_esp32c3.mpy +0 -0
  235. toolkit/workspace/precompiled/modules/IO_esp32c6.mpy +0 -0
  236. toolkit/workspace/precompiled/modules/IO_esp32s2.mpy +0 -0
  237. toolkit/workspace/precompiled/modules/IO_esp32s3.mpy +0 -0
  238. toolkit/workspace/precompiled/modules/IO_m5stamp.mpy +0 -0
  239. toolkit/workspace/precompiled/modules/IO_qtpy.mpy +0 -0
  240. toolkit/workspace/precompiled/modules/IO_rp2.mpy +0 -0
  241. toolkit/workspace/precompiled/modules/IO_tinypico.mpy +0 -0
  242. toolkit/workspace/precompiled/modules/LM_L298N.mpy +0 -0
  243. {micrOS/source → toolkit/workspace/precompiled/modules}/LM_L9110_DCmotor.py +4 -4
  244. toolkit/workspace/precompiled/modules/LM_OV2640.mpy +0 -0
  245. toolkit/workspace/precompiled/{LM_VL53L0X.py → modules/LM_VL53L0X.py} +5 -5
  246. toolkit/workspace/precompiled/modules/LM_aht10.mpy +0 -0
  247. toolkit/workspace/precompiled/modules/LM_bme280.mpy +0 -0
  248. toolkit/workspace/precompiled/{LM_buzzer.mpy → modules/LM_buzzer.mpy} +0 -0
  249. toolkit/workspace/precompiled/modules/LM_cct.mpy +0 -0
  250. toolkit/workspace/precompiled/modules/LM_cluster.mpy +0 -0
  251. toolkit/workspace/precompiled/modules/LM_co2.mpy +0 -0
  252. toolkit/workspace/precompiled/modules/LM_dht11.mpy +0 -0
  253. toolkit/workspace/precompiled/modules/LM_dht22.mpy +0 -0
  254. toolkit/workspace/precompiled/modules/LM_dimmer.mpy +0 -0
  255. toolkit/workspace/precompiled/modules/LM_distance.mpy +0 -0
  256. toolkit/workspace/precompiled/modules/LM_ds18.mpy +0 -0
  257. toolkit/workspace/precompiled/{LM_esp32.py → modules/LM_esp32.py} +16 -4
  258. toolkit/workspace/precompiled/modules/LM_espnow.py +53 -0
  259. toolkit/workspace/precompiled/modules/LM_fileserver.mpy +0 -0
  260. toolkit/workspace/precompiled/{LM_gameOfLife.mpy → modules/LM_gameOfLife.mpy} +0 -0
  261. toolkit/workspace/precompiled/modules/LM_genIO.mpy +0 -0
  262. toolkit/workspace/precompiled/modules/LM_haptic.mpy +0 -0
  263. toolkit/workspace/precompiled/modules/LM_i2c.py +61 -0
  264. toolkit/workspace/precompiled/modules/LM_i2s_mic.mpy +0 -0
  265. toolkit/workspace/precompiled/{LM_ld2410.mpy → modules/LM_ld2410.mpy} +0 -0
  266. toolkit/workspace/precompiled/modules/LM_light_sensor.mpy +0 -0
  267. toolkit/workspace/precompiled/modules/LM_mh_z19c.py +198 -0
  268. toolkit/workspace/precompiled/modules/LM_neoeffects.mpy +0 -0
  269. toolkit/workspace/precompiled/modules/LM_neopixel.mpy +0 -0
  270. toolkit/workspace/precompiled/modules/LM_oled.mpy +0 -0
  271. toolkit/workspace/precompiled/modules/LM_oled_sh1106.mpy +0 -0
  272. toolkit/workspace/precompiled/modules/LM_oled_ui.mpy +0 -0
  273. toolkit/workspace/precompiled/modules/LM_pacman.mpy +0 -0
  274. toolkit/workspace/precompiled/modules/LM_presence.mpy +0 -0
  275. toolkit/workspace/precompiled/modules/LM_qmi8658.py +204 -0
  276. toolkit/workspace/precompiled/{LM_rencoder.py → modules/LM_rencoder.py} +40 -11
  277. toolkit/workspace/precompiled/modules/LM_rest.mpy +0 -0
  278. toolkit/workspace/precompiled/modules/LM_rgb.mpy +0 -0
  279. toolkit/workspace/precompiled/{LM_rgbcct.mpy → modules/LM_rgbcct.mpy} +0 -0
  280. toolkit/workspace/precompiled/modules/LM_roboarm.mpy +0 -0
  281. toolkit/workspace/precompiled/modules/LM_robustness.py +137 -0
  282. toolkit/workspace/precompiled/{LM_rp2w.py → modules/LM_rp2w.py} +3 -0
  283. toolkit/workspace/precompiled/{LM_sdcard.py → modules/LM_sdcard.py} +3 -0
  284. toolkit/workspace/precompiled/{LM_servo.mpy → modules/LM_servo.mpy} +0 -0
  285. toolkit/workspace/precompiled/modules/LM_sound_event.mpy +0 -0
  286. toolkit/workspace/precompiled/{LM_stepper.mpy → modules/LM_stepper.mpy} +0 -0
  287. toolkit/workspace/precompiled/modules/LM_switch.mpy +0 -0
  288. toolkit/workspace/precompiled/modules/LM_system.mpy +0 -0
  289. toolkit/workspace/precompiled/modules/LM_tcs3472.py +187 -0
  290. toolkit/workspace/precompiled/modules/LM_telegram.mpy +0 -0
  291. toolkit/workspace/precompiled/{LM_tinyrgb.mpy → modules/LM_tinyrgb.mpy} +0 -0
  292. toolkit/workspace/precompiled/modules/LM_trackball.mpy +0 -0
  293. toolkit/workspace/precompiled/modules/LM_veml7700.mpy +0 -0
  294. toolkit/workspace/precompiled/modules/LM_web.mpy +0 -0
  295. toolkit/workspace/precompiled/urequests.mpy +0 -0
  296. {micrOS/source → toolkit/workspace/precompiled/web}/dashboard.html +9 -4
  297. toolkit/workspace/precompiled/web/editor.js +440 -0
  298. toolkit/workspace/precompiled/web/filesui.html +178 -0
  299. toolkit/workspace/precompiled/web/filesui.js +338 -0
  300. toolkit/workspace/precompiled/{index.html → web/index.html} +44 -2
  301. toolkit/workspace/precompiled/web/uapi.js +103 -0
  302. toolkit/workspace/precompiled/web/udashboard.js +129 -0
  303. toolkit/workspace/precompiled/web/ustyle.css +55 -0
  304. toolkit/workspace/precompiled/web/uwidgets.js +172 -0
  305. toolkit/workspace/precompiled/web/uwidgets_pro.js +99 -0
  306. env/driver_cp210x/CH34XSER_MAC/CH34X_DRV_INSTALL_INSTRUCTIONS.pdf +0 -0
  307. env/driver_cp210x/CH34XSER_MAC/CH34xVCPDriver.pkg +0 -0
  308. micrOS/micropython/esp32-20231005-v1.21.0.bin +0 -0
  309. micrOS/micropython/esp32c3-GENERIC-20240105-v1.22.1.bin +0 -0
  310. micrOS/micropython/esp32c3-GENERIC-20240222-v1.22.2.bin +0 -0
  311. micrOS/micropython/esp32s2-GENERIC-20240105-v1.22.1.bin +0 -0
  312. micrOS/micropython/esp32s2-LOLIN_MINI-20220618-v1.19.1.bin +0 -0
  313. micrOS/micropython/esp32s3-GENERIC-20240105-v1.22.1.bin +0 -0
  314. micrOS/micropython/esp32s3_spiram_oct-20231005-v1.21.0.bin +0 -0
  315. micrOS/micropython/rpi-pico-w-20231005-v1.21.0.uf2 +0 -0
  316. micrOS/micropython/tinypico-20231005-v1.21.0.bin +0 -0
  317. micrOS/micropython/tinypico-usbc-UM-20240105-v1.22.1.bin +0 -0
  318. micrOS/source/LM_L298N_DCmotor.py +0 -86
  319. micrOS/source/LM_catgame.py +0 -74
  320. micrOS/source/LM_dashboard_be.py +0 -37
  321. micrOS/source/LM_demo.py +0 -85
  322. micrOS/source/LM_distance.py +0 -88
  323. micrOS/source/LM_i2c.py +0 -44
  324. micrOS/source/LM_intercon.py +0 -57
  325. micrOS/source/LM_keychain.py +0 -318
  326. micrOS/source/LM_lmpacman.py +0 -126
  327. micrOS/source/LM_neoeffects.py +0 -327
  328. micrOS/source/LM_pet_feeder.py +0 -76
  329. micrOS/source/LM_ph_sensor.py +0 -51
  330. micrOS/source/LM_rest.py +0 -40
  331. micrOS/source/LM_robustness.py +0 -73
  332. micrOS/source/LM_telegram.py +0 -96
  333. micrOS/source/reset.py +0 -11
  334. micrOS/source/uapi.js +0 -76
  335. micrOS/source/udashboard.js +0 -137
  336. micrOS/source/ustyle.css +0 -28
  337. micrOS/source/uwidgets.js +0 -179
  338. micrOSDevToolKit-2.1.5.dist-info/RECORD +0 -337
  339. toolkit/dashboard_apps/AirQualityBME280.py +0 -36
  340. toolkit/dashboard_apps/AirQualityDHT22_CO2.py +0 -36
  341. toolkit/lib/file_extensions.py +0 -16
  342. toolkit/simulator_lib/__pycache__/LP_darwin.cpython-312.pyc +0 -0
  343. toolkit/simulator_lib/__pycache__/LP_darwin.cpython-38.pyc +0 -0
  344. toolkit/simulator_lib/__pycache__/LP_darwin.cpython-39.pyc +0 -0
  345. toolkit/simulator_lib/__pycache__/sim_console.cpython-312.pyc +0 -0
  346. toolkit/simulator_lib/__pycache__/sim_console.cpython-38.pyc +0 -0
  347. toolkit/simulator_lib/__pycache__/sim_console.cpython-39.pyc +0 -0
  348. toolkit/workspace/precompiled/IO_esp32.mpy +0 -0
  349. toolkit/workspace/precompiled/IO_esp32c3.mpy +0 -0
  350. toolkit/workspace/precompiled/IO_esp32s2.mpy +0 -0
  351. toolkit/workspace/precompiled/IO_esp32s3.mpy +0 -0
  352. toolkit/workspace/precompiled/IO_qtpy.mpy +0 -0
  353. toolkit/workspace/precompiled/IO_rp2.mpy +0 -0
  354. toolkit/workspace/precompiled/IO_tinypico.mpy +0 -0
  355. toolkit/workspace/precompiled/LM_L298N_DCmotor.mpy +0 -0
  356. toolkit/workspace/precompiled/LM_OV2640.mpy +0 -0
  357. toolkit/workspace/precompiled/LM_aht10.mpy +0 -0
  358. toolkit/workspace/precompiled/LM_bme280.mpy +0 -0
  359. toolkit/workspace/precompiled/LM_catgame.py +0 -74
  360. toolkit/workspace/precompiled/LM_cct.mpy +0 -0
  361. toolkit/workspace/precompiled/LM_co2.mpy +0 -0
  362. toolkit/workspace/precompiled/LM_dashboard_be.py +0 -37
  363. toolkit/workspace/precompiled/LM_demo.py +0 -85
  364. toolkit/workspace/precompiled/LM_dht11.mpy +0 -0
  365. toolkit/workspace/precompiled/LM_dht22.mpy +0 -0
  366. toolkit/workspace/precompiled/LM_dimmer.mpy +0 -0
  367. toolkit/workspace/precompiled/LM_distance.py +0 -88
  368. toolkit/workspace/precompiled/LM_ds18.mpy +0 -0
  369. toolkit/workspace/precompiled/LM_genIO.mpy +0 -0
  370. toolkit/workspace/precompiled/LM_i2c.py +0 -44
  371. toolkit/workspace/precompiled/LM_i2s_mic.mpy +0 -0
  372. toolkit/workspace/precompiled/LM_intercon.mpy +0 -0
  373. toolkit/workspace/precompiled/LM_keychain.mpy +0 -0
  374. toolkit/workspace/precompiled/LM_light_sensor.mpy +0 -0
  375. toolkit/workspace/precompiled/LM_lmpacman.mpy +0 -0
  376. toolkit/workspace/precompiled/LM_neoeffects.mpy +0 -0
  377. toolkit/workspace/precompiled/LM_neopixel.mpy +0 -0
  378. toolkit/workspace/precompiled/LM_oled.mpy +0 -0
  379. toolkit/workspace/precompiled/LM_oled_sh1106.mpy +0 -0
  380. toolkit/workspace/precompiled/LM_oled_ui.mpy +0 -0
  381. toolkit/workspace/precompiled/LM_pet_feeder.py +0 -76
  382. toolkit/workspace/precompiled/LM_ph_sensor.py +0 -51
  383. toolkit/workspace/precompiled/LM_presence.mpy +0 -0
  384. toolkit/workspace/precompiled/LM_rest.mpy +0 -0
  385. toolkit/workspace/precompiled/LM_rgb.mpy +0 -0
  386. toolkit/workspace/precompiled/LM_roboarm.mpy +0 -0
  387. toolkit/workspace/precompiled/LM_robustness.py +0 -73
  388. toolkit/workspace/precompiled/LM_switch.mpy +0 -0
  389. toolkit/workspace/precompiled/LM_system.mpy +0 -0
  390. toolkit/workspace/precompiled/LM_telegram.mpy +0 -0
  391. toolkit/workspace/precompiled/reset.mpy +0 -0
  392. toolkit/workspace/precompiled/uapi.js +0 -76
  393. toolkit/workspace/precompiled/udashboard.js +0 -137
  394. toolkit/workspace/precompiled/ustyle.css +0 -28
  395. toolkit/workspace/precompiled/uwidgets.js +0 -179
  396. /toolkit/user_data/node_config_archive/.include → /micrOS/source/config/_git.keep +0 -0
  397. /micrOS/source/{IO_rp2.py → modules/IO_rp2.py} +0 -0
  398. /micrOS/source/{LM_tinyrgb.py → modules/LM_tinyrgb.py} +0 -0
  399. {micrOSDevToolKit-2.1.5.dist-info → microsdevtoolkit-2.26.1.dist-info/licenses}/LICENSE +0 -0
  400. {micrOSDevToolKit-2.1.5.dist-info → microsdevtoolkit-2.26.1.dist-info}/top_level.txt +0 -0
toolkit/Gateway.py CHANGED
@@ -17,7 +17,7 @@ try:
17
17
  from flask_basicauth import BasicAuth
18
18
  from datetime import datetime
19
19
  except Exception as e:
20
- print("Cannot load flask_basicauth->BasicAuth")
20
+ print("[GW-AUTH] Cannot load flask_basicauth->BasicAuth")
21
21
  BasicAuth = None
22
22
 
23
23
  try:
@@ -103,10 +103,10 @@ if BasicAuth is not None and (__rest_usr_name and __rest_usr_pwd):
103
103
  except Exception as e:
104
104
  response = {"ok": False, "Country": str(e)}
105
105
  if response["ok"] and response["Country"] in enabled_country_codes:
106
- print(f"\t[GW-AUTH] EXTERNAL LOGIN: ALLOW ({enabled_country_codes}) EXTERNAL IP FROM: {response}")
106
+ print(f"\t[GW-AUTH] EXTERNAL LOGIN: ALLOW ({enabled_country_codes}) EXTERNAL IP ({ip_address}) FROM: {response}")
107
107
  ADDRESS_CACHE[ip_address] = (True, response)
108
108
  return True, response
109
- print(f"\t[GW-AUTH] EXTERNAL LOGIN: DENY ({enabled_country_codes}) EXTERNAL IP FROM: {response}")
109
+ print(f"\t[GW-AUTH] EXTERNAL LOGIN: DENY - EXTERNAL IP ({ip_address}) FROM: {response}")
110
110
  ADDRESS_CACHE[ip_address] = (False, response)
111
111
  return False, response
112
112
  # Return cached value:
@@ -154,7 +154,7 @@ class Hello(Resource):
154
154
 
155
155
  class SendCmd(Resource):
156
156
  """
157
- http://127.0.0.1:5000/sendcmd/micr240ac4f679e8OS/rgb+toggle
157
+ http://127.0.0.1:5005/sendcmd/micr240ac4f679e8OS/rgb+toggle
158
158
  {
159
159
  "cmd": [
160
160
  "rgb",
@@ -211,7 +211,7 @@ class ListDevices(Resource):
211
211
 
212
212
  def sort_devices(self):
213
213
  device_struct = socketClient.ConnectionData.list_devices()
214
- online_devices = socketClient.ConnectionData.nodes_status()
214
+ online_devices = socketClient.ConnectionData.nodes_status(feature_stat=False)
215
215
  filtered_devices = {"online": {}, "offline": {}}
216
216
  for uid, data in device_struct.items():
217
217
  if data[0] in online_devices:
@@ -554,9 +554,9 @@ class ForwardImg(Resource):
554
554
  for devid, dev_conn_data in ListDevices.DEVICE_CACHE['online'].items():
555
555
  # IP, PORT, FID
556
556
  device = dev_conn_data[2]
557
- response = SendCmd.runcmd(device, 'lmpacman module')['response']
557
+ response = SendCmd.runcmd(device, 'modules')['response']
558
558
  print(f"\n\n{response}\n\n")
559
- if 'LM_OV2640' in response:
559
+ if 'OV2640' in response:
560
560
  ForwardImg.CAM_DEVICES.add(device)
561
561
  return jsonify(list(ForwardImg.CAM_DEVICES))
562
562
 
@@ -621,11 +621,11 @@ api.add_resource(WebHook, '/webhooks', '/webhooks/<string:payload>', '/webhooks/
621
621
 
622
622
  def gateway(debug=True):
623
623
  global API_URL_CACHE
624
- API_URL_CACHE = f"http://{my_local_ip()}:5000"
624
+ API_URL_CACHE = f"http://{my_local_ip()}:5005"
625
625
  print("\n############### START MICROS GATEWAY ###############")
626
626
  print("# {} #".format(API_URL_CACHE))
627
627
  print("####################################################\n")
628
- app.run(debug=debug, use_reloader=debug, host='0.0.0.0', port=5000) # host='0.0.0.0' automatic, manual: host=my_local_ip()
628
+ app.run(debug=debug, use_reloader=debug, host='0.0.0.0', port=5005) # host='0.0.0.0' automatic, manual: host=my_local_ip()
629
629
 
630
630
 
631
631
  # driver function
toolkit/LM_to_compile.dat CHANGED
@@ -11,8 +11,6 @@ LM_bme280.py
11
11
  LM_co2.py
12
12
  LM_dht11.py
13
13
  LM_light_sensor.py
14
- LM_L298N_DCmotor.py
15
- LM_intercon.py
16
14
  LM_tinyrgb.py
17
15
  LM_repair.py
18
16
  LM_buzzer.py
@@ -25,12 +23,22 @@ LM_cct.py
25
23
  LM_presence.py
26
24
  LM_telegram.py
27
25
  LM_oled_sh1106.py
28
- LM_lmpacman.py
26
+ LM_pacman.py
29
27
  LM_aht10.py
30
28
  LM_rgbcct.py
31
29
  LM_OV2640.py
32
- LM_keychain.py
33
30
  LM_i2s_mic.py
34
31
  LM_rest.py
35
32
  LM_gameOfLife.py
36
33
  LM_ld2410.py
34
+ LM_sound_event.py
35
+ LM_trackball.py
36
+ LM_oledui.py
37
+ LM_haptic.py
38
+ LM_distance.py
39
+ LM_veml7700.py
40
+ LM_neomatrix.py
41
+ LM_L298N.py
42
+ LM_cluster.py
43
+ LM_fileserver.py
44
+ LM_web.py
toolkit/MicrOSDevEnv.py CHANGED
@@ -35,13 +35,13 @@ class MicrOSDevTool(OTA, USB):
35
35
  #####################################################
36
36
  # DevEnv METHODS #
37
37
  #####################################################
38
- def precompile_micros(self):
39
- micros_dev_env = Compile.is_mpycross_available()
38
+ def precompile_micros(self, cleanup=True):
39
+ micros_dev_env = Compile().is_mpycross_available()
40
40
  if not micros_dev_env:
41
41
  self.console("SKIP PRECOMPILE - DEV ENV INACTIVE\n\t-> mpy-cross not available", state='warn')
42
42
  return True
43
43
  self.console("PRECOMPILE - DEV ENV ACTIVE: mpy-cross available", state='ok')
44
- state = super(MicrOSDevTool, self).precompile_micros()
44
+ state = super(MicrOSDevTool, self).precompile_micros(cleanup)
45
45
  # Drops Segmentation fault: 11 error: simulator doc gen... TODO
46
46
  self.LM_functions_static_dump_gen()
47
47
  return state
@@ -62,8 +62,16 @@ class MicrOSDevTool(OTA, USB):
62
62
  if f.endswith('.json'):
63
63
  continue
64
64
  f_path = os.path.join(self.micrOS_dir_path, f)
65
- self.console("[SIM] Copy micrOS resources: {} -> {}".format(f_path, self.micros_sim_workspace))
66
- LocalMachine.FileHandler().copy(f_path, self.micros_sim_workspace)
65
+ if f.startswith("_") or f.startswith("."):
66
+ # SKIP files startswith `_` and `.`
67
+ continue
68
+ _, f_type = LocalMachine.FileHandler.path_is_exists(f_path)
69
+ target_dir = self.micros_sim_workspace
70
+ if f_type == "d":
71
+ target_dir = os.path.join(self.micros_sim_workspace, f)
72
+ self.console(f"[SIM] Copy micrOS resources: {f_path} -> {target_dir}")
73
+ if not LocalMachine.FileHandler().copy(f_path, target_dir):
74
+ self.console(f"[ERROR] Failed to copy: {f_path}")
67
75
 
68
76
  if prepare_only:
69
77
  # In case of automatic node_conf creation
@@ -128,53 +136,103 @@ class MicrOSDevTool(OTA, USB):
128
136
  self.console("[ERROR] micrOS SIM\n{}".format(e))
129
137
  workdir_handler.popd()
130
138
 
131
- def LM_functions_static_dump_gen(self):
132
- """
133
- Generate static module-function provider json description: sfuncman.json
134
- [!] name dependency with micrOS internal manual provider
135
- """
136
-
137
- if not os.path.isdir(self.sfuncman_output_path):
138
- self.console('DOC GEN DISABLED', state="WARN")
139
- return
140
-
141
- repo_version = self.get_micros_version_from_repo()
142
- static_help_json_path = os.path.join(self.sfuncman_output_path, 'sfuncman_{}.json'.format(repo_version))
143
- static_help_html_path = os.path.join(self.sfuncman_output_path, 'sfuncman.html')
139
+ def _build_doc_load_module_structure(self):
140
+
141
+ def _is_private_func(_line):
142
+ nonlocal decorator, line
143
+ if 'def ' in line and 'def _' not in line:
144
+ if "async" in line and decorator is not None and "@micro_task" in decorator:
145
+ # Enable (adjust) async task method with publish_micro_task decorator
146
+ line = line.replace("async", "").strip()
147
+ return False
148
+ if '(self' in line or '(cls' in _line or (decorator is not None and "staticmethod" in decorator):
149
+ # Ignore class methods
150
+ return True
151
+ return False
152
+ # Ignore non functions, and hidden functions (starts with _)
153
+ return True
144
154
 
145
155
  # [PARSING] Collect Load Module function structure buffer
146
- modules_to_doc = (i.split('.')[0] for i in LocalMachine.FileHandler.list_dir(self.micrOS_dir_path) if
147
- i.startswith('LM_') and (i.endswith('.py')))
156
+ modules_sim_path = os.path.join(self.micros_sim_workspace, "modules")
157
+ if LocalMachine.FileHandler.path_is_exists(modules_sim_path):
158
+ modules_path = modules_sim_path
159
+ else:
160
+ modules_path = os.path.join(self.micrOS_dir_path, "modules")
161
+ self.console(f"[DOC-GEN] INPUT MODULES PATH: {modules_path}")
162
+ modules_to_doc = [i.split('.')[0] for i in LocalMachine.FileHandler.list_dir(modules_path) if
163
+ i.startswith('LM_') and (i.endswith('.py'))]
148
164
  module_function_dict = {}
149
165
  for LM in modules_to_doc:
150
- LMpath = '{}/{}.py'.format(self.micrOS_dir_path, LM)
166
+ LMpath = '{}/{}.py'.format(modules_path, LM)
151
167
  try:
152
168
  module_name = LM.replace('LM_', '')
153
169
  module_function_dict[module_name] = {}
154
170
  with open(LMpath, 'r') as f:
171
+ decorator = None
155
172
  while True:
156
173
  line = f.readline()
157
174
  if not line:
158
175
  break
159
- if 'def ' in line and 'def _' not in line:
160
- if '(self' in line or '(cls' in line:
161
- continue
162
- # Gen proper func name
163
- command = '{}'.format(line.split(')')[0]).replace("def", '').strip()
164
- command = command.replace('(', ' ') \
165
- .replace(',', '') \
166
- .replace('msgobj=None', '') \
167
- .replace('force=True', '')
168
- func = command.strip().split()[0]
169
- param = ' '.join(command.strip().split()[1:])
170
- # Save record
171
- if module_function_dict[module_name].get(func, None) is None:
172
- module_function_dict[module_name][func] = {}
173
- module_function_dict[module_name][func]['param(s)'] = param if len(param) > 0 else ""
176
+ if _is_private_func(line):
177
+ if line.strip().startswith("@"):
178
+ decorator = line.strip()
179
+ else:
180
+ decorator = None
181
+ continue
182
+
183
+ # Gen proper func name
184
+ command = '{}'.format(line.split(')')[0]).replace("def", '').strip()
185
+ command = command.replace('(', ' ') \
186
+ .replace(',', '') \
187
+ .replace('msgobj=None', '') \
188
+ .replace('force=True', '')
189
+ func = command.strip().split()[0]
190
+ param = ' '.join(command.strip().split()[1:])
191
+ # Save record
192
+ if module_function_dict[module_name].get(func, None) is None:
193
+ module_function_dict[module_name][func] = {}
194
+ module_function_dict[module_name][func]['param(s)'] = param if len(param) > 0 else ""
195
+
174
196
  # Create / update module data fields
175
- module_function_dict[module_name]['img'] = f"https://github.com/BxNxM/micrOS/blob/master/media/lms/{module_name}.png?raw=true"
197
+ module_function_dict[module_name][
198
+ 'img'] = f"https://github.com/BxNxM/micrOS/blob/master/media/lms/{module_name}.png?raw=true"
176
199
  except Exception as e:
177
200
  self.console("STATIC micrOS HELP GEN: LM [{}] PARSER ERROR: {}".format(LM, e))
201
+ self.console(f"[DOC-GEN] Detected modules: {module_function_dict.keys()}")
202
+ return module_function_dict
203
+
204
+ def LM_functions_static_dump_gen(self):
205
+ """
206
+ Generate static module-function provider json description: sfuncman.json
207
+ [!] name dependency with micrOS internal manual provider
208
+ """
209
+
210
+ def _my_json_to_html(mod_func_dict):
211
+ import json2html
212
+ table_attributes = 'border="1" cellspacing="1" cellpadding="5" width="80%"'
213
+
214
+ sorted_modules_w_data = dict(sorted(mod_func_dict.items(), key=lambda item: item[0].lower()))
215
+ module_shortcuts = ' | '.join(
216
+ f'<a href="#{mod_name.replace(" ", "_")}">{mod_name}</a>'
217
+ for mod_name in sorted_modules_w_data)
218
+ html_tables = module_shortcuts + "<br><hr><br>"
219
+ for key, value in sorted_modules_w_data.items():
220
+ anchor = key.replace(" ", "_") # Replace spaces with underscores for a valid anchor
221
+ html_tables += f'\n<br><br>\n<h2 id="{anchor}"><a href="#{anchor}">{key}</a></h2>\n'
222
+ html_tables += json2html.json2html.convert(json=value,
223
+ table_attributes=table_attributes,
224
+ clubbing=True,
225
+ escape=False,
226
+ encode=False)
227
+ return html_tables
228
+
229
+ if not os.path.isdir(self.sfuncman_output_path):
230
+ self.console('DOC GEN DISABLED', state="WARN")
231
+ return
232
+
233
+ repo_version = self.get_micros_version_from_repo()
234
+ static_help_json_path = os.path.join(self.sfuncman_output_path, 'sfuncman_{}.json'.format(repo_version))
235
+ static_help_html_path = os.path.join(self.sfuncman_output_path, 'sfuncman.html')
178
236
 
179
237
  # Prepare (update simulator workspace)
180
238
  self.simulator(prepare_only=True)
@@ -183,6 +241,7 @@ class MicrOSDevTool(OTA, USB):
183
241
  import simulator
184
242
  sim_proc = simulator.micrOSIM(doc_resolve=True)
185
243
  # Generate function doc-strings and pinmap info
244
+ module_function_dict = self._build_doc_load_module_structure()
186
245
  _out = sim_proc.gen_lm_doc_json_html(module_function_dict)
187
246
  if _out is None:
188
247
  self.console("#########################", state='ERR')
@@ -190,10 +249,15 @@ class MicrOSDevTool(OTA, USB):
190
249
  self.console("# -[micrOSIM][DOC ERR]- #", state='ERR')
191
250
  self.console("#########################", state='ERR')
192
251
  module_function_dict_html = module_function_dict
252
+ module_function_dict_ext = {}
253
+ module_function_dict_html_ext = {}
193
254
  else:
194
255
  # Unpack output
195
- module_function_dict, module_function_dict_html = _out
256
+ (module_function_dict, module_function_dict_html,
257
+ module_function_dict_ext, module_function_dict_html_ext) = _out
196
258
 
259
+ # Merge built-in and external packages at json dco level (unified document) - external modules has annotation by default
260
+ module_function_dict.update(module_function_dict_ext)
197
261
  hardcoded_manual = {"task": {"list": {"doc": "list micrOS tasks by taskID", "param(s)": ""},
198
262
  "kill": {"doc": "kill / stop micrOS task", "param(s)": "taskID"},
199
263
  "img": "https://github.com/BxNxM/micrOS/blob/master/media/lms/tasks.png?raw=true"}
@@ -209,12 +273,10 @@ class MicrOSDevTool(OTA, USB):
209
273
  _url = hardcoded_manual["task"]["img"]
210
274
  hardcoded_manual['task']['img'] = f'<img src="{_url}" alt="tasks" height=150>'
211
275
  module_function_dict_html.update(hardcoded_manual)
212
- module_function_json = json.dumps(module_function_dict_html, indent=4)
213
- import json2html
214
- table_attributes = 'border="1" cellspacing="1" cellpadding="5" width="80%"'
215
- html_table = json2html.json2html.convert(json=module_function_json,
216
- table_attributes=table_attributes,
217
- clubbing=True, escape=False, encode=False)
276
+ html_tables = _my_json_to_html(module_function_dict_html)
277
+ html_tables_ext = _my_json_to_html(module_function_dict_html_ext)
278
+ if len(html_tables_ext) > 0:
279
+ html_tables_ext = '<br><h2 id="external-modules"> External modules (packages).:</h2>' + html_tables_ext
218
280
 
219
281
  # http://corelangs.com/css/table/tablecolor.html
220
282
  # http://corelangs.com/css/table/tablecolor.html
@@ -248,22 +310,38 @@ micrOS Load Modules
248
310
  </p>
249
311
 
250
312
  <h2>
251
- Logical pin names aka pin map
313
+ microIO Pin-Mapping (names to integers)
252
314
  </h2>
253
- <b> Implements hardware independent periphery handling in Load Modules.<br>
315
+ <b> Multi-platform pinmap IO handling feature - resolve pin number by name (tag)<br>
254
316
  <b>[i] Use 'module_name pinmap()' function to get pins on a runtime system (micrOS shell) and start DIY</b>
255
317
  <ul>
256
- <li><a href="https://github.com/BxNxM/micrOS/blob/master/micrOS/source/LP_esp32.py" target="_blank">esp32</a></li>
257
- <li><a href="https://github.com/BxNxM/micrOS/blob/master/micrOS/source/LP_esp32s2.py" target="_blank">esp32s2</a></li>
258
- <li><a href="https://github.com/BxNxM/micrOS/blob/master/micrOS/source/LP_tinypico.py" target="_blank">tinypico</a></li>
259
- <li><a href="https://github.com/BxNxM/micrOS/blob/master/micrOS/source/LP_rp2.py" target="_blank">rp2 (experimental)</a></li>
318
+ <li><a href="https://github.com/BxNxM/micrOS/blob/master/micrOS/source/modules/IO_m5stamp.py" target="_blank">m5stamp</a></li>
319
+ <li><a href="https://github.com/BxNxM/micrOS/blob/master/micrOS/source/modules/IO_tinypico.py" target="_blank">tinypico</a></li>
320
+ <li><a href="https://github.com/BxNxM/micrOS/blob/master/micrOS/source/modules/IO_s3matrix.py" target="_blank">s3matrix</a></li>
321
+
322
+ <li><a href="https://github.com/BxNxM/micrOS/blob/master/micrOS/source/modules/IO_esp32.py" target="_blank">esp32</a></li>
323
+ <li><a href="https://github.com/BxNxM/micrOS/blob/master/micrOS/source/modules/IO_esp32s3.py" target="_blank">esp32s3</a></li>
324
+ <li><a href="https://github.com/BxNxM/micrOS/blob/master/micrOS/source/modules/IO_esp32c3.py" target="_blank">esp32c3</a></li>
325
+ <li><a href="https://github.com/BxNxM/micrOS/blob/master/micrOS/source/modules/IO_esp32c6.py" target="_blank">esp32c6</a></li>
326
+ <li><a href="https://github.com/BxNxM/micrOS/blob/master/micrOS/source/modules/IO_esp32s2.py" target="_blank">esp32s2</a></li>
327
+ <li><a href="https://github.com/BxNxM/micrOS/blob/master/micrOS/source/modules/IO_rp2.py" target="_blank">rp2 (experimental)</a></li>
260
328
  </ul>
261
329
 
330
+ <h2>External package support</h2>
331
+ <a href="#external-modules">Go to external packages</a>
332
+ &nbsp;|&nbsp;
333
+ <a href="https://github.com/BxNxM/micrOSPackages" target="_blank">
334
+ View Packages on GitHub
335
+ </a>
336
+ <br>
337
+
338
+ <h2> Built-in control modules for various peripheries.: </h2>
339
+
262
340
  """
263
341
  html_body_end = """</body>
264
342
  </html>"""
265
343
 
266
- html_page = html_body_start + html_table + html_body_end
344
+ html_page = html_body_start + html_tables + html_tables_ext + html_body_end
267
345
  # Write html to file
268
346
  with open(static_help_html_path, 'w') as f:
269
347
  f.write(html_page)
toolkit/WebRepl.py ADDED
@@ -0,0 +1,73 @@
1
+ import sys
2
+ import os
3
+
4
+ MYDIR = os.path.dirname(__file__)
5
+ print("Module [WebRepl] path: {} __package__: {} __name__: {} __file__: {}".format(
6
+ sys.path[0], __package__, __name__, MYDIR))
7
+ try:
8
+ from .lib.TerminalColors import Colors
9
+ from .lib.LocalMachine import FileHandler, CommandHandler, SimplePopPushd
10
+ from .socketClient import ConnectionData
11
+ except Exception as e:
12
+ print("Import warning __name__:{}: {}".format(__name__, e))
13
+ from lib.TerminalColors import Colors
14
+ from lib.LocalMachine import FileHandler, CommandHandler, SimplePopPushd
15
+ from socketClient import ConnectionData
16
+
17
+ WEBREPL_DIR = os.path.join(MYDIR, "workspace/webrepl")
18
+ MAKE_HTML_WEBPAGE_PATH = os.path.join(WEBREPL_DIR, "make_html_js.py")
19
+ WEBREPL_WEBPAGE_PATH = os.path.join(WEBREPL_DIR, "webrepl.html")
20
+
21
+ def init_webrepl_frontend():
22
+ webrepldir_handler = SimplePopPushd()
23
+ webrepldir_handler.pushd(WEBREPL_DIR)
24
+
25
+ is_exists, ftype = FileHandler.path_is_exists(MAKE_HTML_WEBPAGE_PATH)
26
+ if is_exists and ftype == 'f':
27
+ print("RUN webrepl/make_html_js.py")
28
+ exitcode, _, stderr = CommandHandler.run_command(f"{sys.executable} {MAKE_HTML_WEBPAGE_PATH}", shell=True)
29
+ webrepldir_handler.popd()
30
+ if exitcode == 0:
31
+ return True
32
+ print(f"Cannot init {MAKE_HTML_WEBPAGE_PATH}: {stderr}")
33
+ return False
34
+ print(f"WEBREPL MAKE MISSING: {MAKE_HTML_WEBPAGE_PATH}")
35
+ return False
36
+
37
+ def open_webrepl_webpage(address=None, port=8266):
38
+ # file:///Users/usrname/micrOS/micrOS/toolkit/workspace/webrepl/webrepl.html#10.0.1.76:8266
39
+ fuid = ''
40
+ if address is None:
41
+ try:
42
+ address, _, fuid, _ = ConnectionData.select_device()
43
+ except KeyboardInterrupt:
44
+ address = None
45
+
46
+ device = "" if address is None else f"#{address}:{port}"
47
+ webrepl_html = f"file://{WEBREPL_WEBPAGE_PATH}{device}"
48
+ is_exists, ftype = FileHandler.path_is_exists(WEBREPL_WEBPAGE_PATH)
49
+ if is_exists and ftype == "f":
50
+ print(f"OPEN {fuid} webrepl {webrepl_html}")
51
+ if sys.platform == "darwin":
52
+ CommandHandler.run_command(f"open '{webrepl_html}'", shell=True)
53
+ elif sys.platform == "win32":
54
+ CommandHandler.run_command(f"start {webrepl_html}", shell=True)
55
+ elif sys.platform == "linux":
56
+ CommandHandler.run_command(f"xdg-open {webrepl_html}", shell=True)
57
+ else:
58
+ print("Unsupported OS")
59
+ return False
60
+ return True
61
+ print(f"{WEBREPL_WEBPAGE_PATH} not exists.")
62
+ return False
63
+
64
+
65
+ def open_webrepl():
66
+ state = init_webrepl_frontend()
67
+ if state:
68
+ open_webrepl_webpage()
69
+
70
+
71
+
72
+ if __name__ == "__main__":
73
+ open_webrepl()
@@ -0,0 +1,171 @@
1
+ #!/usr/bin/env python3
2
+
3
+ import os
4
+ import sys
5
+ import json
6
+ MYPATH = os.path.dirname(os.path.abspath(__file__))
7
+ BACKUP_DIR = os.path.join(MYPATH, "../user_data/node_config_archive/")
8
+ sys.path.append(os.path.join(MYPATH, '../lib/'))
9
+ from TerminalColors import Colors
10
+
11
+ try:
12
+ from ._app_base import AppBase
13
+ except:
14
+ from _app_base import AppBase
15
+
16
+ CLIENT = None
17
+
18
+
19
+ ###########################################################
20
+ def _value_type(value):
21
+ value = value.strip()
22
+ if value == "True": # Bool
23
+ return True
24
+ if value == "False": # Bool
25
+ return False
26
+ try:
27
+ value = int(value) # integer
28
+ return value
29
+ except Exception:
30
+ pass
31
+ return value # string
32
+
33
+
34
+ def backup():
35
+ device = CLIENT.get_device()
36
+ print(f"\tBackup name format: {device}-<tag>-node_config.json")
37
+ print(f"\t\t tag is optional (press simply enter): {device}-node_config.json")
38
+ backup_tag = input(f"\tFill backup tag for {device}: ").strip()
39
+ backup_tag = "" if len(backup_tag) == 0 else f"-{backup_tag}"
40
+ backup_name = f"{device}{backup_tag}-node_config.json"
41
+ backup_path = os.path.join(BACKUP_DIR, backup_name)
42
+ print(f"\tBackup path: {backup_path}")
43
+
44
+ status, answer = CLIENT.run(["conf", "dump"])
45
+ if status:
46
+ configuration = {line.split(":")[0].strip(): _value_type(':'.join(line.split(":")[1:])) for line in answer.strip().split("\n") if ":" in line}
47
+ with open(backup_path, 'w') as f:
48
+ f.write(json.dumps(configuration, indent=4))
49
+ else:
50
+ print(f"{Colors.ERR} Cannot get node config:{Colors.NC} {status}: {answer}")
51
+ print(f"{Colors.OKGREEN}Backup was successfully saved:{Colors.NC} {backup_path}")
52
+
53
+
54
+ def restore():
55
+ device = CLIENT.get_device()
56
+ print(f"\tRestore backup for: {device}")
57
+ diff_config = {}
58
+
59
+ # SELECT AND LOAD CONFIG BACKUP
60
+ backup_list = os.listdir(BACKUP_DIR)
61
+ for i, json_backup in enumerate(backup_list):
62
+ print(f"[{i}] {json_backup}")
63
+ opt = input("Select backup number to restore: ")
64
+ try:
65
+ opt = int(opt)
66
+ except Exception as e:
67
+ print(f"{Colors.ERR}INVALID INDEX:{Colors.NC} {e}")
68
+ return
69
+ backup_path = os.path.join(BACKUP_DIR, backup_list[opt])
70
+ with open(backup_path, 'r') as f:
71
+ backup_dict = json.load(f)
72
+ print(f"SELECTED CONFIG: {backup_path}")
73
+ print(f"BACKUP CONFIG DICT:\n{backup_dict}")
74
+
75
+ # LOAD LIVE DEVICE CONFIG - create config diff
76
+ status, answer = CLIENT.run(["conf", "dump"])
77
+ if not status:
78
+ return f"Cannot load live device config"
79
+ live_configuration = {line.split(":")[0].strip(): _value_type(':'.join(line.split(":")[1:])) for line in answer.strip().split("\n") if ":" in line}
80
+
81
+ for key, live_value in live_configuration.items():
82
+ if key in ("version", "devip", "hwuid", "version", "devfid"): # IGNORE KEYS
83
+ continue
84
+ bckp_value = backup_dict.get(key, None)
85
+ if bckp_value is None or bckp_value == live_value:
86
+ continue
87
+ print(f"\tDIFF: {key} : {live_value} -> {bckp_value}")
88
+ diff_config[key] = bckp_value
89
+
90
+ if len(diff_config.keys()) == 0:
91
+ print(f"{Colors.OKGREEN}No diff in config - skip restore{Colors.NC}")
92
+ return
93
+ verify = input(f"{Colors.WARN}APPLY DIFFS?{Colors.NC} [Y/n]: ")
94
+ if verify != "Y":
95
+ print(f"{Colors.WARN}SKIP restore...{Colors.NC}")
96
+ return
97
+
98
+ print(f"PACKAGE CONFIG DIFFS...{device}")
99
+ conf_cmd_list = ["conf"]
100
+ for key, value in diff_config.items():
101
+ print(f"\tADD {key} : {value}")
102
+ conf_cmd_list.append(f"{key} {value}")
103
+ conf_cmd_list.append("reboot")
104
+
105
+ # Restore
106
+ print(f"APPLY CONFIG DIFFS...{device}")
107
+ status, answer = CLIENT.run(conf_cmd_list)
108
+ if status:
109
+ print(f"{Colors.OKGREEN}Backup was successfully restored:{Colors.NC} {backup_path}\nRebooting...")
110
+ else:
111
+ print(f"{Colors.ERR}Restore error:{Colors.NC} {status}: {answer}")
112
+
113
+
114
+
115
+ def delete_backup():
116
+ backup_list = os.listdir(BACKUP_DIR)
117
+ for i, json_backup in enumerate(backup_list):
118
+ print(f"[{i}] {json_backup}")
119
+ opt = input("Select backup number to delete: ")
120
+ try:
121
+ opt = int(opt)
122
+ except Exception as e:
123
+ print(f"{Colors.ERR}INVALID INDEX:{Colors.NC} {e}")
124
+ return
125
+ remove_path = os.path.join(BACKUP_DIR, backup_list[opt])
126
+ print(f"Remove: {remove_path}")
127
+ os.remove(remove_path)
128
+ print(f"{Colors.OKGREEN}Backup was successfully deleted{Colors.NC}")
129
+
130
+ ###########################################################
131
+
132
+
133
+ def app(devfid=None, pwd=None):
134
+ """
135
+ devfid: selected device input
136
+ send command(s) over socket connection [socketClient.run(args)]
137
+ list load module commands and send in single connection
138
+ """
139
+ global CLIENT
140
+ CLIENT = AppBase(device=devfid, password=pwd)
141
+
142
+ print(f"{Colors.WARN}Backup & Restore management{Colors.NC}\n")
143
+ while True:
144
+ print(f"{Colors.UNDERLINE}Operations on {CLIENT.get_device()}{Colors.NC}")
145
+ print("\t[1] Backup")
146
+ print("\t[2] Restore")
147
+ print("\t[3] Delete backups")
148
+ print("\t[4] Exit")
149
+ opt = input(f"{Colors.BOLD}Select operation{Colors.NC}: ")
150
+ try:
151
+ opt = int(opt)
152
+ except Exception as e:
153
+ return f"{Colors.ERR}INVALID OPTION:{Colors.NC} {opt}: {e}"
154
+ if opt == 1:
155
+ print(f"{Colors.BOLD}=== BACKUP ==={Colors.NC}")
156
+ backup()
157
+ elif opt == 2:
158
+ print(f"{Colors.BOLD}=== RESTORE ==={Colors.NC}")
159
+ restore()
160
+ elif opt == 3:
161
+ print(f"{Colors.BOLD}=== DELETE ==={Colors.NC}")
162
+ delete_backup()
163
+ elif opt == 4:
164
+ break
165
+ else:
166
+ return f"{Colors.ERR}UNKNOWN OPTION:{Colors.NC} {opt}"
167
+ return f"{Colors.OKGREEN}Bye!{Colors.NC}"
168
+
169
+
170
+ if __name__ == "__main__":
171
+ app()
@@ -2,38 +2,33 @@
2
2
 
3
3
  import os
4
4
  import sys
5
- import time
6
5
  MYPATH = os.path.dirname(os.path.abspath(__file__))
7
- sys.path.append(os.path.dirname(MYPATH))
8
- import socketClient
9
6
  sys.path.append(os.path.join(MYPATH, '../lib/'))
10
- from TerminalColors import Colors
11
7
 
12
- # FILL OUT
13
- DEVICE = 'node01'
8
+ try:
9
+ from ._app_base import AppBase
10
+ except:
11
+ from _app_base import AppBase
14
12
 
13
+ CLIENT = None
15
14
 
16
- def base_cmd():
17
- return ['--dev', DEVICE]
18
15
 
19
-
20
- def app(devfid=None):
16
+ def app(devfid=None, pwd=None):
21
17
  """
22
18
  devfid: selected device input
23
19
  send command(s) over socket connection [socketClient.run(args)]
24
20
  list load module commands and send in single connection
25
21
  """
26
- global DEVICE
27
- if devfid is not None:
28
- DEVICE = devfid
22
+ global CLIENT
23
+ CLIENT = AppBase(device=devfid, password=pwd)
29
24
 
30
- status, answer = socketClient.run(base_cmd() + ['cct white 50 400',
25
+ status, answer = CLIENT.run(['cct white 50 400',
31
26
  'cct brightness 50'])
32
- status, answer = socketClient.run(base_cmd() + ['cct brightness 100', 'cct brightness 20',
27
+ status, answer = CLIENT.run(['cct brightness 100', 'cct brightness 20',
33
28
  'cct brightness 60'])
34
- status, answer = socketClient.run(base_cmd() + ['cct white 400 50',
29
+ status, answer = CLIENT.run(['cct white 400 50',
35
30
  'cct brightness 100', 'cct brightness 20'])
36
- status, answer = socketClient.run(base_cmd() + ['cct white 600 700',
31
+ status, answer = CLIENT.run(['cct white 600 700',
37
32
  'cct white 50 300'])
38
33
 
39
34