micrOSDevToolKit 2.9.1__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 (368) 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/esp32-20251209-v1.27.0.bin +0 -0
  4. micrOS/micropython/esp32c3-20251209-v1.27.0.bin +0 -0
  5. micrOS/micropython/esp32c6-20251209-v1.27.0.bin +0 -0
  6. micrOS/micropython/esp32s2-20251209-v1.27.0.bin +0 -0
  7. micrOS/micropython/esp32s2-LOLIN_MINI-20251209-v1.27.0.bin +0 -0
  8. micrOS/micropython/{esp32s3-20241129-v1.24.1.bin → esp32s3-4MBflash-20241129-v1.24.1.bin} +0 -0
  9. micrOS/micropython/esp32s3-8MBflash-20251209-v1.27.0.bin +0 -0
  10. micrOS/micropython/esp32s3_spiram_oct-20251209-v1.27.0.bin +0 -0
  11. micrOS/micropython/rpi-pico-w-20251209-v1.27.0.uf2 +0 -0
  12. micrOS/micropython/tinypico-20251209-v1.27.0.bin +0 -0
  13. micrOS/release_info/micrOS_ReleaseInfo/system_analysis_sum.json +167 -163
  14. micrOS/source/Auth.py +37 -0
  15. micrOS/source/Common.py +361 -116
  16. micrOS/source/Config.py +32 -22
  17. micrOS/source/Debug.py +50 -94
  18. micrOS/source/Espnow.py +377 -100
  19. micrOS/source/Files.py +207 -0
  20. micrOS/source/Hooks.py +48 -20
  21. micrOS/source/InterConnect.py +126 -42
  22. micrOS/source/Interrupts.py +6 -6
  23. micrOS/source/Logger.py +63 -26
  24. micrOS/source/Network.py +41 -21
  25. micrOS/source/Notify.py +48 -22
  26. micrOS/source/Pacman.py +326 -0
  27. micrOS/source/Scheduler.py +14 -54
  28. micrOS/source/Server.py +67 -69
  29. micrOS/source/Shell.py +99 -91
  30. micrOS/source/Tasks.py +141 -95
  31. micrOS/source/Time.py +19 -18
  32. micrOS/source/Types.py +53 -9
  33. micrOS/source/Web.py +381 -76
  34. micrOS/source/__pycache__/Common.cpython-312.pyc +0 -0
  35. micrOS/source/__pycache__/Debug.cpython-312.pyc +0 -0
  36. micrOS/source/__pycache__/Files.cpython-312.pyc +0 -0
  37. micrOS/source/__pycache__/Logger.cpython-312.pyc +0 -0
  38. micrOS/source/__pycache__/Scheduler.cpython-312.pyc +0 -0
  39. micrOS/source/__pycache__/Server.cpython-312.pyc +0 -0
  40. micrOS/source/__pycache__/Shell.cpython-312.pyc +0 -0
  41. micrOS/source/__pycache__/replhelper.cpython-312.pyc +0 -0
  42. micrOS/source/config/_git.keep +0 -0
  43. micrOS/source/helpers.py +132 -0
  44. micrOS/source/micrOS.py +17 -7
  45. micrOS/source/micrOSloader.py +5 -12
  46. micrOS/source/microIO.py +44 -20
  47. micrOS/source/modules/IO_esp32c6.py +38 -0
  48. micrOS/source/{IO_esp32s3.py → modules/IO_esp32s3.py} +37 -1
  49. micrOS/source/{IO_m5stamp.py → modules/IO_m5stamp.py} +35 -1
  50. micrOS/source/{IO_qtpy.py → modules/IO_qtpy.py} +22 -17
  51. micrOS/source/{IO_tinypico.py → modules/IO_tinypico.py} +38 -0
  52. micrOS/source/modules/LM_L298N.py +161 -0
  53. {toolkit/workspace/precompiled → micrOS/source/modules}/LM_L9110_DCmotor.py +3 -3
  54. micrOS/source/{LM_OV2640.py → modules/LM_OV2640.py} +45 -27
  55. micrOS/source/{LM_VL53L0X.py → modules/LM_VL53L0X.py} +3 -3
  56. micrOS/source/{LM_aht10.py → modules/LM_aht10.py} +2 -2
  57. micrOS/source/{LM_bme280.py → modules/LM_bme280.py} +3 -3
  58. micrOS/source/{LM_buzzer.py → modules/LM_buzzer.py} +18 -25
  59. micrOS/source/{LM_cct.py → modules/LM_cct.py} +17 -21
  60. micrOS/source/modules/LM_cluster.py +255 -0
  61. micrOS/source/{LM_co2.py → modules/LM_co2.py} +3 -3
  62. micrOS/source/{LM_dht11.py → modules/LM_dht11.py} +2 -2
  63. micrOS/source/{LM_dht22.py → modules/LM_dht22.py} +2 -2
  64. micrOS/source/{LM_dimmer.py → modules/LM_dimmer.py} +9 -9
  65. micrOS/source/{LM_distance.py → modules/LM_distance.py} +4 -6
  66. micrOS/source/{LM_ds18.py → modules/LM_ds18.py} +2 -2
  67. micrOS/source/{LM_esp32.py → modules/LM_esp32.py} +5 -0
  68. micrOS/source/modules/LM_espnow.py +53 -0
  69. micrOS/source/modules/LM_fileserver.py +265 -0
  70. micrOS/source/{LM_genIO.py → modules/LM_genIO.py} +52 -37
  71. micrOS/source/{LM_haptic.py → modules/LM_haptic.py} +2 -2
  72. {toolkit/workspace/precompiled → micrOS/source/modules}/LM_i2c.py +5 -4
  73. micrOS/source/{LM_i2s_mic.py → modules/LM_i2s_mic.py} +6 -7
  74. micrOS/source/{LM_ld2410.py → modules/LM_ld2410.py} +2 -2
  75. micrOS/source/{LM_light_sensor.py → modules/LM_light_sensor.py} +10 -21
  76. micrOS/source/modules/LM_mh_z19c.py +198 -0
  77. micrOS/source/modules/LM_neoeffects.py +284 -0
  78. micrOS/source/{LM_neopixel.py → modules/LM_neopixel.py} +19 -23
  79. micrOS/source/{LM_oled.py → modules/LM_oled.py} +2 -2
  80. micrOS/source/{LM_oled_sh1106.py → modules/LM_oled_sh1106.py} +3 -3
  81. micrOS/source/{LM_oled_ui.py → modules/LM_oled_ui.py} +72 -64
  82. micrOS/source/modules/LM_pacman.py +320 -0
  83. micrOS/source/{LM_presence.py → modules/LM_presence.py} +11 -15
  84. micrOS/source/modules/LM_qmi8658.py +204 -0
  85. micrOS/source/{LM_rencoder.py → modules/LM_rencoder.py} +2 -2
  86. micrOS/source/{LM_rest.py → modules/LM_rest.py} +4 -6
  87. micrOS/source/{LM_rgb.py → modules/LM_rgb.py} +21 -29
  88. micrOS/source/{LM_roboarm.py → modules/LM_roboarm.py} +8 -8
  89. micrOS/source/modules/LM_robustness.py +137 -0
  90. micrOS/source/{LM_servo.py → modules/LM_servo.py} +3 -3
  91. micrOS/source/{LM_stepper.py → modules/LM_stepper.py} +5 -5
  92. micrOS/source/{LM_switch.py → modules/LM_switch.py} +11 -9
  93. micrOS/source/{LM_system.py → modules/LM_system.py} +38 -32
  94. micrOS/source/modules/LM_tcs3472.py +187 -0
  95. micrOS/source/{LM_telegram.py → modules/LM_telegram.py} +164 -116
  96. micrOS/source/{LM_trackball.py → modules/LM_trackball.py} +3 -3
  97. micrOS/source/{LM_veml7700.py → modules/LM_veml7700.py} +2 -2
  98. micrOS/source/modules/LM_web.py +38 -0
  99. micrOS/source/urequests.py +39 -15
  100. {toolkit/workspace/precompiled → micrOS/source/web}/dashboard.html +4 -0
  101. micrOS/source/web/editor.js +440 -0
  102. micrOS/source/web/filesui.html +178 -0
  103. micrOS/source/web/filesui.js +338 -0
  104. {toolkit/workspace/precompiled → micrOS/source/web}/index.html +44 -2
  105. micrOS/source/{uapi.js → web/uapi.js} +48 -7
  106. micrOS/source/{ustyle.css → web/ustyle.css} +6 -3
  107. micrOS/utests/__init__.py +0 -0
  108. micrOS/utests/test_scheduler.py +435 -0
  109. {micrOSDevToolKit-2.9.1.data → microsdevtoolkit-2.26.1.data}/scripts/devToolKit.py +33 -3
  110. {micrOSDevToolKit-2.9.1.dist-info → microsdevtoolkit-2.26.1.dist-info}/METADATA +327 -268
  111. microsdevtoolkit-2.26.1.dist-info/RECORD +396 -0
  112. {micrOSDevToolKit-2.9.1.dist-info → microsdevtoolkit-2.26.1.dist-info}/WHEEL +1 -1
  113. toolkit/DevEnvCompile.py +63 -33
  114. toolkit/DevEnvOTA.py +58 -22
  115. toolkit/DevEnvUSB.py +110 -55
  116. toolkit/Gateway.py +6 -6
  117. toolkit/LM_to_compile.dat +6 -4
  118. toolkit/MicrOSDevEnv.py +127 -57
  119. toolkit/WebRepl.py +73 -0
  120. toolkit/dashboard_apps/BackupRestore.py +20 -35
  121. toolkit/dashboard_apps/CCTDemo.py +12 -17
  122. toolkit/dashboard_apps/CCTTest.py +20 -24
  123. toolkit/dashboard_apps/CamStream.py +2 -6
  124. toolkit/dashboard_apps/CatGame.py +14 -16
  125. toolkit/dashboard_apps/Dimmer.py +11 -21
  126. toolkit/dashboard_apps/GetVersion.py +11 -19
  127. toolkit/dashboard_apps/MicrophoneTest.py +1 -6
  128. toolkit/dashboard_apps/NeoEffectsDemo.py +22 -35
  129. toolkit/dashboard_apps/NeopixelTest.py +20 -25
  130. toolkit/dashboard_apps/PresenceTest.py +2 -8
  131. toolkit/dashboard_apps/QMI8685_GYRO.py +68 -0
  132. toolkit/dashboard_apps/RGBTest.py +20 -24
  133. toolkit/dashboard_apps/RoboArm.py +24 -32
  134. toolkit/dashboard_apps/SED_test.py +10 -14
  135. toolkit/dashboard_apps/SensorsTest.py +61 -0
  136. toolkit/dashboard_apps/SystemTest.py +202 -105
  137. toolkit/dashboard_apps/Template_app.py +11 -23
  138. toolkit/dashboard_apps/_app_base.py +34 -0
  139. toolkit/dashboard_apps/_gyro_visualizer.py +78 -0
  140. toolkit/dashboard_apps/uLightDemo.py +15 -24
  141. toolkit/index.html +4 -4
  142. toolkit/lib/LocalMachine.py +6 -1
  143. toolkit/lib/MicrosFiles.py +46 -0
  144. toolkit/lib/Repository.py +64 -0
  145. toolkit/lib/TerminalColors.py +4 -0
  146. toolkit/lib/macroScript.py +6 -0
  147. toolkit/lib/micrOSClient.py +123 -50
  148. toolkit/lib/micrOSClientHistory.py +156 -0
  149. toolkit/lib/pip_package_installer.py +5 -2
  150. toolkit/micrOSdashboard.py +12 -17
  151. toolkit/micrOSlint.py +20 -8
  152. toolkit/simulator_lib/__pycache__/IO_darwin.cpython-312.pyc +0 -0
  153. toolkit/simulator_lib/__pycache__/aioespnow.cpython-312.pyc +0 -0
  154. toolkit/simulator_lib/__pycache__/framebuf.cpython-312.pyc +0 -0
  155. toolkit/simulator_lib/__pycache__/machine.cpython-312.pyc +0 -0
  156. toolkit/simulator_lib/__pycache__/micropython.cpython-312.pyc +0 -0
  157. toolkit/simulator_lib/__pycache__/mip.cpython-312.pyc +0 -0
  158. toolkit/simulator_lib/__pycache__/neopixel.cpython-312.pyc +0 -0
  159. toolkit/simulator_lib/__pycache__/network.cpython-312.pyc +0 -0
  160. toolkit/simulator_lib/__pycache__/sim_common.cpython-312.pyc +0 -0
  161. toolkit/simulator_lib/__pycache__/simgc.cpython-312.pyc +0 -0
  162. toolkit/simulator_lib/__pycache__/simulator.cpython-312.pyc +0 -0
  163. toolkit/simulator_lib/__pycache__/uasyncio.cpython-312.pyc +0 -0
  164. toolkit/simulator_lib/__pycache__/uos.cpython-312.pyc +0 -0
  165. toolkit/simulator_lib/__pycache__/urandom.cpython-312.pyc +0 -0
  166. toolkit/simulator_lib/__pycache__/usocket.cpython-312.pyc +0 -0
  167. toolkit/simulator_lib/__pycache__/ussl.cpython-312.pyc +0 -0
  168. toolkit/simulator_lib/aioespnow.py +28 -0
  169. toolkit/simulator_lib/dht.py +1 -1
  170. toolkit/simulator_lib/framebuf.py +49 -1
  171. toolkit/simulator_lib/machine.py +17 -2
  172. toolkit/simulator_lib/micropython.py +3 -3
  173. toolkit/simulator_lib/mip.py +165 -0
  174. toolkit/simulator_lib/neopixel.py +3 -2
  175. toolkit/simulator_lib/network.py +2 -1
  176. toolkit/simulator_lib/node_config.json +2 -3
  177. toolkit/simulator_lib/ntptime.py +1 -1
  178. toolkit/simulator_lib/{sim_console.py → sim_common.py} +2 -3
  179. toolkit/simulator_lib/simgc.py +6 -2
  180. toolkit/simulator_lib/simulator.py +137 -59
  181. toolkit/simulator_lib/uasyncio.py +33 -2
  182. toolkit/simulator_lib/uos.py +147 -0
  183. toolkit/simulator_lib/urandom.py +4 -0
  184. toolkit/socketClient.py +43 -23
  185. toolkit/user_data/webhooks/generic.py +1 -1
  186. toolkit/user_data/webhooks/macro.py +1 -1
  187. toolkit/user_data/webhooks/template.py +1 -1
  188. toolkit/workspace/precompiled/Auth.mpy +0 -0
  189. toolkit/workspace/precompiled/Common.mpy +0 -0
  190. toolkit/workspace/precompiled/Config.mpy +0 -0
  191. toolkit/workspace/precompiled/Debug.mpy +0 -0
  192. toolkit/workspace/precompiled/Espnow.mpy +0 -0
  193. toolkit/workspace/precompiled/Files.mpy +0 -0
  194. toolkit/workspace/precompiled/Hooks.mpy +0 -0
  195. toolkit/workspace/precompiled/InterConnect.mpy +0 -0
  196. toolkit/workspace/precompiled/Interrupts.mpy +0 -0
  197. toolkit/workspace/precompiled/Logger.mpy +0 -0
  198. toolkit/workspace/precompiled/Network.mpy +0 -0
  199. toolkit/workspace/precompiled/Notify.mpy +0 -0
  200. toolkit/workspace/precompiled/Pacman.mpy +0 -0
  201. toolkit/workspace/precompiled/Scheduler.mpy +0 -0
  202. toolkit/workspace/precompiled/Server.mpy +0 -0
  203. toolkit/workspace/precompiled/Shell.mpy +0 -0
  204. toolkit/workspace/precompiled/Tasks.mpy +0 -0
  205. toolkit/workspace/precompiled/Time.mpy +0 -0
  206. toolkit/workspace/precompiled/Types.mpy +0 -0
  207. toolkit/workspace/precompiled/Web.mpy +0 -0
  208. toolkit/workspace/precompiled/_mpy.version +1 -1
  209. toolkit/workspace/precompiled/config/_git.keep +0 -0
  210. toolkit/workspace/precompiled/helpers.mpy +0 -0
  211. toolkit/workspace/precompiled/micrOS.mpy +0 -0
  212. toolkit/workspace/precompiled/micrOSloader.mpy +0 -0
  213. toolkit/workspace/precompiled/microIO.mpy +0 -0
  214. toolkit/workspace/precompiled/{IO_esp32.mpy → modules/IO_esp32.mpy} +0 -0
  215. toolkit/workspace/precompiled/{IO_esp32c3.mpy → modules/IO_esp32c3.mpy} +0 -0
  216. toolkit/workspace/precompiled/modules/IO_esp32c6.mpy +0 -0
  217. toolkit/workspace/precompiled/{IO_esp32s2.mpy → modules/IO_esp32s2.mpy} +0 -0
  218. toolkit/workspace/precompiled/modules/IO_esp32s3.mpy +0 -0
  219. toolkit/workspace/precompiled/modules/IO_m5stamp.mpy +0 -0
  220. toolkit/workspace/precompiled/modules/IO_qtpy.mpy +0 -0
  221. toolkit/workspace/precompiled/modules/IO_rp2.mpy +0 -0
  222. toolkit/workspace/precompiled/modules/IO_tinypico.mpy +0 -0
  223. toolkit/workspace/precompiled/modules/LM_L298N.mpy +0 -0
  224. {micrOS/source → toolkit/workspace/precompiled/modules}/LM_L9110_DCmotor.py +3 -3
  225. toolkit/workspace/precompiled/modules/LM_OV2640.mpy +0 -0
  226. toolkit/workspace/precompiled/{LM_VL53L0X.py → modules/LM_VL53L0X.py} +3 -3
  227. toolkit/workspace/precompiled/{LM_aht10.mpy → modules/LM_aht10.mpy} +0 -0
  228. toolkit/workspace/precompiled/{LM_bme280.mpy → modules/LM_bme280.mpy} +0 -0
  229. toolkit/workspace/precompiled/{LM_buzzer.mpy → modules/LM_buzzer.mpy} +0 -0
  230. toolkit/workspace/precompiled/modules/LM_cct.mpy +0 -0
  231. toolkit/workspace/precompiled/modules/LM_cluster.mpy +0 -0
  232. toolkit/workspace/precompiled/{LM_co2.mpy → modules/LM_co2.mpy} +0 -0
  233. toolkit/workspace/precompiled/{LM_dht11.mpy → modules/LM_dht11.mpy} +0 -0
  234. toolkit/workspace/precompiled/{LM_dht22.mpy → modules/LM_dht22.mpy} +0 -0
  235. toolkit/workspace/precompiled/modules/LM_dimmer.mpy +0 -0
  236. toolkit/workspace/precompiled/modules/LM_distance.mpy +0 -0
  237. toolkit/workspace/precompiled/{LM_ds18.mpy → modules/LM_ds18.mpy} +0 -0
  238. toolkit/workspace/precompiled/{LM_esp32.py → modules/LM_esp32.py} +5 -0
  239. toolkit/workspace/precompiled/modules/LM_espnow.py +53 -0
  240. toolkit/workspace/precompiled/modules/LM_fileserver.mpy +0 -0
  241. toolkit/workspace/precompiled/{LM_gameOfLife.mpy → modules/LM_gameOfLife.mpy} +0 -0
  242. toolkit/workspace/precompiled/modules/LM_genIO.mpy +0 -0
  243. toolkit/workspace/precompiled/{LM_haptic.mpy → modules/LM_haptic.mpy} +0 -0
  244. {micrOS/source → toolkit/workspace/precompiled/modules}/LM_i2c.py +5 -4
  245. toolkit/workspace/precompiled/modules/LM_i2s_mic.mpy +0 -0
  246. toolkit/workspace/precompiled/{LM_ld2410.mpy → modules/LM_ld2410.mpy} +0 -0
  247. toolkit/workspace/precompiled/modules/LM_light_sensor.mpy +0 -0
  248. toolkit/workspace/precompiled/modules/LM_mh_z19c.py +198 -0
  249. toolkit/workspace/precompiled/modules/LM_neoeffects.mpy +0 -0
  250. toolkit/workspace/precompiled/modules/LM_neopixel.mpy +0 -0
  251. toolkit/workspace/precompiled/{LM_oled.mpy → modules/LM_oled.mpy} +0 -0
  252. toolkit/workspace/precompiled/{LM_oled_sh1106.mpy → modules/LM_oled_sh1106.mpy} +0 -0
  253. toolkit/workspace/precompiled/modules/LM_oled_ui.mpy +0 -0
  254. toolkit/workspace/precompiled/modules/LM_pacman.mpy +0 -0
  255. toolkit/workspace/precompiled/modules/LM_presence.mpy +0 -0
  256. toolkit/workspace/precompiled/modules/LM_qmi8658.py +204 -0
  257. toolkit/workspace/precompiled/{LM_rencoder.py → modules/LM_rencoder.py} +2 -2
  258. toolkit/workspace/precompiled/modules/LM_rest.mpy +0 -0
  259. toolkit/workspace/precompiled/modules/LM_rgb.mpy +0 -0
  260. toolkit/workspace/precompiled/{LM_rgbcct.mpy → modules/LM_rgbcct.mpy} +0 -0
  261. toolkit/workspace/precompiled/modules/LM_roboarm.mpy +0 -0
  262. toolkit/workspace/precompiled/modules/LM_robustness.py +137 -0
  263. toolkit/workspace/precompiled/{LM_servo.mpy → modules/LM_servo.mpy} +0 -0
  264. toolkit/workspace/precompiled/{LM_sound_event.mpy → modules/LM_sound_event.mpy} +0 -0
  265. toolkit/workspace/precompiled/{LM_stepper.mpy → modules/LM_stepper.mpy} +0 -0
  266. toolkit/workspace/precompiled/modules/LM_switch.mpy +0 -0
  267. toolkit/workspace/precompiled/modules/LM_system.mpy +0 -0
  268. toolkit/workspace/precompiled/modules/LM_tcs3472.py +187 -0
  269. toolkit/workspace/precompiled/modules/LM_telegram.mpy +0 -0
  270. toolkit/workspace/precompiled/{LM_tinyrgb.mpy → modules/LM_tinyrgb.mpy} +0 -0
  271. toolkit/workspace/precompiled/{LM_trackball.mpy → modules/LM_trackball.mpy} +0 -0
  272. toolkit/workspace/precompiled/{LM_veml7700.mpy → modules/LM_veml7700.mpy} +0 -0
  273. toolkit/workspace/precompiled/modules/LM_web.mpy +0 -0
  274. toolkit/workspace/precompiled/urequests.mpy +0 -0
  275. {micrOS/source → toolkit/workspace/precompiled/web}/dashboard.html +4 -0
  276. toolkit/workspace/precompiled/web/editor.js +440 -0
  277. toolkit/workspace/precompiled/web/filesui.html +178 -0
  278. toolkit/workspace/precompiled/web/filesui.js +338 -0
  279. {micrOS/source → toolkit/workspace/precompiled/web}/index.html +44 -2
  280. toolkit/workspace/precompiled/{uapi.js → web/uapi.js} +48 -7
  281. toolkit/workspace/precompiled/{ustyle.css → web/ustyle.css} +6 -3
  282. micrOS/micropython/esp32-20241129-v1.24.1.bin +0 -0
  283. micrOS/micropython/esp32c3-20240222-v1.22.2.bin +0 -0
  284. micrOS/micropython/esp32s2-20240602-v1.23.0.bin +0 -0
  285. micrOS/micropython/esp32s2-LOLIN_MINI-20220618-v1.19.1.bin +0 -0
  286. micrOS/micropython/esp32s2-LOLIN_MINI-20240602-v1.23.0.bin +0 -0
  287. micrOS/micropython/esp32s3-20240105-v1.22.1.bin +0 -0
  288. micrOS/micropython/esp32s3_spiram_oct-20231005-v1.21.0.bin +0 -0
  289. micrOS/micropython/esp32s3_spiram_oct-20241129-v1.24.1.bin +0 -0
  290. micrOS/micropython/rpi-pico-w-20241129-v1.24.1.uf2 +0 -0
  291. micrOS/micropython/tinypico-20241129-v1.24.1.bin +0 -0
  292. micrOS/source/LM_L298N_DCmotor.py +0 -86
  293. micrOS/source/LM_catgame.py +0 -75
  294. micrOS/source/LM_dashboard_be.py +0 -37
  295. micrOS/source/LM_demo.py +0 -97
  296. micrOS/source/LM_espnow.py +0 -23
  297. micrOS/source/LM_intercon.py +0 -57
  298. micrOS/source/LM_keychain.py +0 -322
  299. micrOS/source/LM_lmpacman.py +0 -126
  300. micrOS/source/LM_neoeffects.py +0 -331
  301. micrOS/source/LM_oledui.py +0 -972
  302. micrOS/source/LM_pet_feeder.py +0 -78
  303. micrOS/source/LM_ph_sensor.py +0 -51
  304. micrOS/source/LM_robustness.py +0 -74
  305. micrOS/source/reset.py +0 -11
  306. micrOSDevToolKit-2.9.1.dist-info/RECORD +0 -365
  307. toolkit/dashboard_apps/AirQualityBME280.py +0 -36
  308. toolkit/dashboard_apps/AirQualityDHT22_CO2.py +0 -36
  309. toolkit/lib/file_extensions.py +0 -16
  310. toolkit/simulator_lib/__pycache__/sim_console.cpython-312.pyc +0 -0
  311. toolkit/simulator_lib/__pycache__/sim_console.cpython-38.pyc +0 -0
  312. toolkit/simulator_lib/__pycache__/sim_console.cpython-39.pyc +0 -0
  313. toolkit/workspace/precompiled/IO_esp32s3.mpy +0 -0
  314. toolkit/workspace/precompiled/IO_m5stamp.mpy +0 -0
  315. toolkit/workspace/precompiled/IO_qtpy.mpy +0 -0
  316. toolkit/workspace/precompiled/IO_rp2.mpy +0 -0
  317. toolkit/workspace/precompiled/IO_tinypico.mpy +0 -0
  318. toolkit/workspace/precompiled/LM_L298N_DCmotor.mpy +0 -0
  319. toolkit/workspace/precompiled/LM_OV2640.mpy +0 -0
  320. toolkit/workspace/precompiled/LM_catgame.py +0 -75
  321. toolkit/workspace/precompiled/LM_cct.mpy +0 -0
  322. toolkit/workspace/precompiled/LM_dashboard_be.py +0 -37
  323. toolkit/workspace/precompiled/LM_demo.py +0 -97
  324. toolkit/workspace/precompiled/LM_dimmer.mpy +0 -0
  325. toolkit/workspace/precompiled/LM_distance.mpy +0 -0
  326. toolkit/workspace/precompiled/LM_espnow.py +0 -23
  327. toolkit/workspace/precompiled/LM_genIO.mpy +0 -0
  328. toolkit/workspace/precompiled/LM_i2s_mic.mpy +0 -0
  329. toolkit/workspace/precompiled/LM_intercon.mpy +0 -0
  330. toolkit/workspace/precompiled/LM_keychain.mpy +0 -0
  331. toolkit/workspace/precompiled/LM_light_sensor.mpy +0 -0
  332. toolkit/workspace/precompiled/LM_lmpacman.mpy +0 -0
  333. toolkit/workspace/precompiled/LM_neoeffects.mpy +0 -0
  334. toolkit/workspace/precompiled/LM_neopixel.mpy +0 -0
  335. toolkit/workspace/precompiled/LM_oled_ui.mpy +0 -0
  336. toolkit/workspace/precompiled/LM_oledui.mpy +0 -0
  337. toolkit/workspace/precompiled/LM_pet_feeder.py +0 -78
  338. toolkit/workspace/precompiled/LM_ph_sensor.py +0 -51
  339. toolkit/workspace/precompiled/LM_presence.mpy +0 -0
  340. toolkit/workspace/precompiled/LM_rest.mpy +0 -0
  341. toolkit/workspace/precompiled/LM_rgb.mpy +0 -0
  342. toolkit/workspace/precompiled/LM_roboarm.mpy +0 -0
  343. toolkit/workspace/precompiled/LM_robustness.py +0 -74
  344. toolkit/workspace/precompiled/LM_switch.mpy +0 -0
  345. toolkit/workspace/precompiled/LM_system.mpy +0 -0
  346. toolkit/workspace/precompiled/LM_telegram.mpy +0 -0
  347. toolkit/workspace/precompiled/node_config.json +0 -1
  348. toolkit/workspace/precompiled/reset.mpy +0 -0
  349. /micrOS/source/{IO_esp32.py → modules/IO_esp32.py} +0 -0
  350. /micrOS/source/{IO_esp32c3.py → modules/IO_esp32c3.py} +0 -0
  351. /micrOS/source/{IO_esp32s2.py → modules/IO_esp32s2.py} +0 -0
  352. /micrOS/source/{IO_rp2.py → modules/IO_rp2.py} +0 -0
  353. /micrOS/source/{LM_gameOfLife.py → modules/LM_gameOfLife.py} +0 -0
  354. /micrOS/source/{LM_rgbcct.py → modules/LM_rgbcct.py} +0 -0
  355. /micrOS/source/{LM_rp2w.py → modules/LM_rp2w.py} +0 -0
  356. /micrOS/source/{LM_sdcard.py → modules/LM_sdcard.py} +0 -0
  357. /micrOS/source/{LM_sound_event.py → modules/LM_sound_event.py} +0 -0
  358. /micrOS/source/{LM_tinyrgb.py → modules/LM_tinyrgb.py} +0 -0
  359. /micrOS/source/{udashboard.js → web/udashboard.js} +0 -0
  360. /micrOS/source/{uwidgets.js → web/uwidgets.js} +0 -0
  361. /micrOS/source/{uwidgets_pro.js → web/uwidgets_pro.js} +0 -0
  362. {micrOSDevToolKit-2.9.1.dist-info → microsdevtoolkit-2.26.1.dist-info/licenses}/LICENSE +0 -0
  363. {micrOSDevToolKit-2.9.1.dist-info → microsdevtoolkit-2.26.1.dist-info}/top_level.txt +0 -0
  364. /toolkit/workspace/precompiled/{LM_rp2w.py → modules/LM_rp2w.py} +0 -0
  365. /toolkit/workspace/precompiled/{LM_sdcard.py → modules/LM_sdcard.py} +0 -0
  366. /toolkit/workspace/precompiled/{udashboard.js → web/udashboard.js} +0 -0
  367. /toolkit/workspace/precompiled/{uwidgets.js → web/uwidgets.js} +0 -0
  368. /toolkit/workspace/precompiled/{uwidgets_pro.js → web/uwidgets_pro.js} +0 -0
@@ -1,8 +1,16 @@
1
1
  import asyncio
2
+ import ssl
2
3
 
4
+ ssl_context = ssl.create_default_context()
5
+ ssl_context.check_hostname = False # Disable hostname check
6
+ ssl_context.verify_mode = ssl.CERT_NONE # Disable certificate verification
7
+
8
+ class TimeoutError(Exception):
9
+ pass
3
10
 
4
11
  def open_connection(host, port, ssl=False):
5
- return asyncio.open_connection(host, port, ssl=ssl)
12
+ #return asyncio.open_connection(host, port, ssl=ssl)
13
+ return asyncio.open_connection(host, port, ssl=ssl_context if ssl else None)
6
14
 
7
15
 
8
16
  class Lock(asyncio.Lock):
@@ -13,6 +21,10 @@ class Event(asyncio.Event):
13
21
  pass
14
22
 
15
23
 
24
+ async def wait_for(fut, timeout):
25
+ return asyncio.wait_for(fut, timeout)
26
+
27
+
16
28
  async def sleep(sec):
17
29
  await asyncio.sleep(sec)
18
30
 
@@ -22,7 +34,26 @@ async def sleep_ms(ms):
22
34
 
23
35
 
24
36
  def get_event_loop():
25
- return asyncio.get_event_loop()
37
+ """
38
+ Returns asyncio.EventLoop
39
+ """
40
+ try:
41
+ # LEGACY: NOT WORKS FROM PYTHON 3.13
42
+ # BUT THIS IS THE MICROPYTHON WAY...
43
+ return asyncio.get_event_loop()
44
+ except Exception as e:
45
+ print(f"[SIM] get_event_loop exception: {e}")
46
+ # PYTHON <3.13 NEW WAY
47
+ try:
48
+ # Check running event loop
49
+ # MICROPYTHON HAS A SINGLE EVENT LOOP
50
+ loop = asyncio.get_running_loop()
51
+ except RuntimeError:
52
+ # Create event loop with new method
53
+ loop = asyncio.new_event_loop()
54
+ asyncio.set_event_loop(loop)
55
+ # return new "singleton" event loop
56
+ return loop
26
57
 
27
58
 
28
59
  class Event:
@@ -0,0 +1,147 @@
1
+ import os
2
+ import stat as py_fs_stat
3
+
4
+ # https://docs.micropython.org/en/v1.9.2/pyboard/library/uos.html
5
+ # https://docs.micropython.org/en/v1.18/library/os.html
6
+
7
+ MOCK_SIM = False
8
+
9
+ def listdir(path=None):
10
+ if path is None:
11
+ return os.listdir()
12
+ path = __mock_sim_dir(path)
13
+ print(f"[uos.SIM] listdir: {path}")
14
+ return os.listdir(path)
15
+
16
+
17
+ def getcwd():
18
+ _cwd = os.getcwd()
19
+ if MOCK_SIM:
20
+ cwd = f"{_cwd}/../workspace/simulator/"
21
+ print(f"MOCK PATH: {cwd}")
22
+ elif "workspace/simulator" not in _cwd:
23
+ cwd = f"{_cwd}/toolkit/workspace/simulator/"
24
+ print(f"[uos.SIM] MOCK PATH: {_cwd} -> {cwd}")
25
+ else:
26
+ cwd = _cwd
27
+ return cwd
28
+
29
+
30
+ def __mock_sim_dir(path):
31
+ """
32
+ micropython sim hack
33
+ """
34
+ cwd = getcwd()
35
+ cwd = cwd if cwd.endswith(os.sep) else f"{cwd}{os.sep}" # CHECK AND FIX CWD / ENDING
36
+ if MOCK_SIM or "workspace/simulator" not in path:
37
+ path = f"{cwd}{path}"
38
+ if MOCK_SIM:
39
+ print(f"[!!!] [uos.SIM][MOCK:{MOCK_SIM}] CWD PATH HACK: {path}")
40
+ return path
41
+
42
+
43
+ def ilistdir(path):
44
+ buffer = []
45
+ for filename in listdir(path):
46
+ _name, _type, _inode = filename, stat(f"{path}/{filename}")[0], 0
47
+ print(f"[uos.SIM] ilistdir {path}: ({_name}, {_type:#x}, {_inode}")
48
+ buffer.append((_name, _type, _inode))
49
+ return tuple(buffer)
50
+
51
+
52
+ def mkdir(path):
53
+ print(f"[uos.SIM] mkdir: {path}")
54
+ return os.mkdir(path)
55
+
56
+
57
+ def remove(path):
58
+ path = __mock_sim_dir(path)
59
+ print(f"[uos.SIM] remove: {path}")
60
+ if "simulator" in path and path.replace('/', '').endswith('simulator'):
61
+ print(f"\t[uos.SIM] rmdir: Invalid path! {path}")
62
+ return False
63
+ return os.remove(path)
64
+
65
+
66
+ def rename(old_path, new_path):
67
+ old_path, new_path = __mock_sim_dir(old_path), __mock_sim_dir(new_path)
68
+ print(f"[uos.SIM] rename: {old_path} -> {new_path}")
69
+ os.rename(old_path, new_path)
70
+
71
+
72
+ def _stat_eval(stat_result):
73
+ """
74
+ micropython converter
75
+ """
76
+ micropython_file_identifier = {'dir': 0x4000, 'file': 0x8000}
77
+ file_type_0 = 0x0 # file type
78
+ file_size_6 = py_fs_stat.ST_SIZE # bytes
79
+ file_time_8 = py_fs_stat.ST_MTIME # file modified time - only on some micropython ports
80
+ file_time_9 = py_fs_stat.ST_CTIME # creation time - only on some micropython ports
81
+ # Check if it's a file
82
+ if py_fs_stat.S_ISREG(stat_result.st_mode):
83
+ # FILE
84
+ file_type_0 = micropython_file_identifier['file']
85
+ if py_fs_stat.S_ISDIR(stat_result.st_mode):
86
+ # DIRECTORY
87
+ file_type_0 = micropython_file_identifier['dir']
88
+ # https://github.com/micropython/micropython-lib/blob/master/python-stdlib/stat/stat.py
89
+ # 0 1 2 3 4 5 6 7 8 9
90
+ return file_type_0, 0, 0, 0, 0, 0, file_size_6, 0, file_time_8, file_time_9
91
+
92
+
93
+ def stat(path):
94
+ path = __mock_sim_dir(path)
95
+ stat_result = os.stat(path)
96
+ micropython_stat_result = _stat_eval(stat_result)
97
+ path_type = 'dir' if micropython_stat_result[0] & 0x4000 else 'file'
98
+ print(f"[uos.SIM] stat: {path} {path_type}({micropython_stat_result[0]:#x})")
99
+ return micropython_stat_result
100
+
101
+
102
+ def rmdir(path):
103
+ path = __mock_sim_dir(path)
104
+ print(f"[uos.SIM] rmdir: {path}")
105
+ if "simulator" in path and path.replace('/', '').endswith('simulator'):
106
+ print(f"\t[uos.SIM] rmdir: Invalid path! {path}")
107
+ return False
108
+ return os.rmdir(path)
109
+
110
+
111
+ def statvfs(path=None):
112
+ if path is None:
113
+ return os.statvfs(__mock_sim_dir(path))
114
+ return os.statvfs(path)
115
+
116
+
117
+ def uname():
118
+ return os.uname()
119
+
120
+
121
+ def sync():
122
+ print("[uos.SIM] sync - dummy")
123
+
124
+
125
+ def urandom(n):
126
+ print(f"[uos.SIM] sync {n}")
127
+ return os.urandom(n)
128
+
129
+
130
+ def dupterm(stream_object):
131
+ print("[uos.SIM] dupterm - dummy")
132
+
133
+
134
+ def mount(*args, **kwargs):
135
+ print("[uos.SIM] mount - dummy")
136
+
137
+
138
+ def umount(*args, **kwargs):
139
+ print("[uos.SIM] unmount - dummy")
140
+
141
+
142
+ if __name__ == "__main__":
143
+ MOCK_SIM = True
144
+ print(f"SIM root (mock: {MOCK_SIM}): {__mock_sim_dir('/')}\ngetcwd: {getcwd()}")
145
+ print(listdir("/"))
146
+ print(stat('/'))
147
+ print(ilistdir('/'))
@@ -0,0 +1,4 @@
1
+ import random as _random
2
+
3
+ def getrandbits(k):
4
+ return _random.getrandbits(k)
toolkit/socketClient.py CHANGED
@@ -4,7 +4,6 @@
4
4
  import sys
5
5
  import socket
6
6
  import os
7
- import select
8
7
  import time
9
8
  import json
10
9
  import threading
@@ -186,8 +185,8 @@ class ConnectionData:
186
185
  return None, None, None, None
187
186
 
188
187
  @staticmethod
189
- def nodes_status():
190
- spr_offset1 = 30
188
+ def nodes_status(feature_stat=True):
189
+ spr_offset1 = 25
191
190
  spr_offset2 = 57
192
191
 
193
192
  def _dev_status(ip, port, fuid, uid):
@@ -200,6 +199,10 @@ class ConnectionData:
200
199
  Colors.WARN, Colors.NC)
201
200
  version_data = '<n/a>'
202
201
  elapsed_time = 'n/a'
202
+ webui_state = 'n/a'
203
+ espnow_state = 'n/a'
204
+ cron_state = 'n/a'
205
+ timirq_state = 'n/a'
203
206
  online_ip = None
204
207
 
205
208
  # is online
@@ -207,25 +210,40 @@ class ConnectionData:
207
210
  # get version data
208
211
  online_ip = ip
209
212
  try:
213
+ connection = SocketDictClient(host=ip, port=port, silent_mode=True, tout=3)
214
+ # Get version and elapsed time data
210
215
  start_comm = time.time()
211
- version_data = SocketDictClient(host=ip, port=port, silent_mode=True, tout=3).non_interactive(['version'])
216
+ version_data = connection.non_interactive(['version'])
212
217
  elapsed_time = "{:.3f}".format(time.time() - start_comm)
213
- except:
214
- pass
218
+ if feature_stat:
219
+ # Get active features info
220
+ webui_state = connection.non_interactive(['conf', 'webui'])
221
+ espnow_state = connection.non_interactive(['conf', 'espnow'])
222
+ cron_state = connection.non_interactive(['conf', 'cron'])
223
+ timirq_state = connection.non_interactive(['conf', 'timirq'])
224
+ except Exception as e:
225
+ print(f"Getting device version {fuid}:{uid} error: {e}")
215
226
 
216
227
  # Generate line printout
217
228
  base_info = "{uid}{spr1}{fuid}".format(uid=uid, spr1=spacer1, fuid=fuid)
218
229
  spacer1 = " " * (spr_offset2 - len(base_info))
219
- data_line_str = "{base}{spr2}{ip}\t{stat}\t\t{version}\t\t{elapt}" \
220
- .format(base=base_info, spr2=spacer1, ip=ip,
221
- stat=is_online, version=version_data, elapt=elapsed_time)
230
+ spacer2 = "\t" if len(version_data) > 7 else "\t\t"
231
+ feature_info = ""
232
+ if feature_stat:
233
+ _on_str = f"{Colors.OKGREEN}{Colors.BOLD}ON {Colors.NC}"
234
+ _off_str = f"{Colors.BOLD}OFF{Colors.NC}"
235
+ _fspacer = " "*6
236
+ bool2str = lambda x: _on_str if x.strip() == "True" else _off_str if x != "n/a" else x
237
+ feature_info = f"\t\t{bool2str(webui_state)}{_fspacer}{bool2str(espnow_state)}{_fspacer}{bool2str(cron_state)}{_fspacer}{bool2str(timirq_state)}"
238
+ data_line_str = f"{base_info}{spacer1}{ip}\t{is_online}\t\t{version_data}{spacer2}{elapsed_time}{feature_info}"
222
239
  return data_line_str, online_ip
223
240
  return None
224
241
 
225
242
  nodes_dict = ConnectionData.read_micrOS_device_cache()
226
- spacer1 = " " * (spr_offset1 - 14)
227
- print("{cols} [ UID ]{spr1}[ FUID ]\t\t[ IP ]\t\t[ STATUS ]\t[ VERSION ]\t[COMM SEC]{cole}"
228
- .format(spr1=spacer1, cols=Colors.OKBLUE + Colors.BOLD, cole=Colors.NC))
243
+ spacer1 = " " * (spr_offset1 - 8)
244
+ feature_header_str = "\t[WEBUI | ESPNOW | CRON | TIMIRQ]" if feature_stat else ""
245
+ print("{cols}[ UID ]{spr1}[ FUID ]\t\t[ IP ]\t\t[ STATUS ]\t[ VERSION ]\t[COMM SEC]{features}{cole}"
246
+ .format(spr1=spacer1, cols=Colors.OKBLUE + Colors.BOLD, features=feature_header_str, cole=Colors.NC))
229
247
 
230
248
  # Start parallel status queries
231
249
  query_list = []
@@ -341,7 +359,7 @@ class SocketDictClient:
341
359
  #########################################################
342
360
 
343
361
 
344
- def main(args, host='127.0.0.1', port=9008, timeout=3, pwd=None, verbose=False):
362
+ def main(args, host='127.0.0.1', port=9008, timeout=5, pwd=None, verbose=False):
345
363
  """ main connection wrapper function """
346
364
  answer_msg = None
347
365
 
@@ -388,7 +406,6 @@ def socket_commandline_args(arg_list):
388
406
  arg = 'status'
389
407
  keywords = list(return_action_dict.keys())
390
408
  if arg in keywords:
391
- print(arg)
392
409
  if return_action_dict[arg] is None:
393
410
  return_action_dict[arg] = arg_list[i+1]
394
411
  _skip = True
@@ -418,25 +435,28 @@ def socket_commandline_args(arg_list):
418
435
  print("--list / list\t\t- list mocrOS devices")
419
436
  print("HINT:\t\t\t- In non interactive mode just list command(s) as last parameters.\n\t\t\t"
420
437
  "Also you can pipe commands with <a> separator.")
421
- print("HINT:\t\t\t\t- Example: --dev node01 system clock")
422
- print("HINT:\t\t\t\t- Example: --dev node01 --pwd ADmin123 system clock")
438
+ print("HINT:\t\t\t\t- Example: --dev node01 'system clock'")
439
+ print("HINT:\t\t\t\t- Example: --dev node01 --pwd ADmin123 'system clock'")
423
440
  sys.exit(0)
424
- if '<a>' in command_buffer:
425
- return ' '.join(command_buffer), return_action_dict
426
- return ' <a> '.join(command_buffer), return_action_dict
441
+ result = command_buffer, return_action_dict
442
+ print(f"SocketClient: {result}")
443
+ return result
427
444
 
428
445
 
429
- def run(arg_list=[], timeout=5):
446
+ def run(arg_list=None, timeout=10, verbose=False):
430
447
  """ Run from code
431
448
  - Handles extra command line arguments
432
449
  """
450
+ if arg_list is None:
451
+ arg_list = []
433
452
  #print("Socket run (raw): {}".format(arg_list))
434
453
  args, action = socket_commandline_args(arg_list)
435
454
  host, port, fid, uid = ConnectionData.auto_execute(search=action['search'], status=action['status'], dev=action['device_tag'])
436
455
  output = False, ''
437
456
  try:
438
457
  #print("Socket run (args): {}".format(args))
439
- output = main(args, host=host, port=port, timeout=timeout, pwd=action['password'], verbose=action['verbose'])
458
+ verbose = verbose or action['verbose']
459
+ output = main(args, host=host, port=port, timeout=timeout, pwd=action['password'], verbose=verbose)
440
460
  except Exception as e:
441
461
  if "TimeOut" in str(e):
442
462
  print("Resolve device by host ... {}.local {}:{}:{}".format(fid, host, port, uid))
@@ -451,5 +471,5 @@ def connection_metrics(host):
451
471
 
452
472
  if __name__ == "__main__":
453
473
  """Runs in individual - direct execution mode"""
454
- arg_list = sys.argv[1:]
455
- run(arg_list=arg_list)
474
+ arglist = sys.argv[1:]
475
+ run(arg_list=arglist)
@@ -2,7 +2,7 @@
2
2
 
3
3
  """
4
4
  Generic webhook for socketClient that can invoke LoadModule calls remotely from any device.
5
- Example: http://10.0.1.61:5000/webhooks/generic/TinyDevBoard+system+clock
5
+ Example: http://10.0.1.61:5005/webhooks/generic/TinyDevBoard+system+clock
6
6
  """
7
7
 
8
8
  import sys, os
@@ -3,7 +3,7 @@
3
3
  """
4
4
  Template for webhook creation
5
5
  - replies with basic response message
6
- Example: http://10.0.1.61:5000/webhooks/template
6
+ Example: http://10.0.1.61:5005/webhooks/template
7
7
  """
8
8
 
9
9
  import sys, os
@@ -3,7 +3,7 @@
3
3
  """
4
4
  Template for webhook creation
5
5
  - replies with basic response message
6
- Example: http://10.0.1.61:5000/webhooks/template
6
+ Example: http://10.0.1.61:5005/webhooks/template
7
7
  """
8
8
 
9
9
  import sys, os
Binary file
Binary file
Binary file
Binary file
Binary file
Binary file
Binary file
Binary file
Binary file
Binary file
Binary file
Binary file
Binary file
Binary file
Binary file
Binary file
Binary file
Binary file
@@ -1 +1 @@
1
- 1.20.0
1
+ 1.24.1
File without changes
Binary file
Binary file
@@ -1,4 +1,4 @@
1
- from microIO import resolve_pin, pinmap_search
1
+ from microIO import bind_pin, pinmap_search
2
2
 
3
3
  #########################################
4
4
  # ANALOG DIMMER CONTROLLER PARAMS #
@@ -15,8 +15,8 @@ def __l9110_init():
15
15
  global __L9110_OBJS
16
16
  if len(__L9110_OBJS) == 0:
17
17
  from machine import Pin, PWM
18
- __L9110_OBJS.append(PWM(Pin(resolve_pin('l9110dir_1')), freq=1024))
19
- __L9110_OBJS.append(PWM(Pin(resolve_pin('l9110dir_2')), freq=1024))
18
+ __L9110_OBJS.append(PWM(Pin(bind_pin('l9110dir_1')), freq=1024))
19
+ __L9110_OBJS.append(PWM(Pin(bind_pin('l9110dir_2')), freq=1024))
20
20
  __L9110_OBJS[0].duty(0) # Set default speed (PWM)
21
21
  __L9110_OBJS[1].duty(0) # Set default speed (PWM)
22
22
  return __L9110_OBJS
@@ -2,7 +2,7 @@ from micropython import const
2
2
  import ustruct
3
3
  import utime
4
4
  from machine import I2C, Pin
5
- from microIO import resolve_pin, pinmap_search
5
+ from microIO import bind_pin, pinmap_search
6
6
 
7
7
  __TOF_OBJ = None
8
8
 
@@ -31,7 +31,7 @@ class TimeoutError(RuntimeError):
31
31
 
32
32
  class VL53L0X:
33
33
  def __init__(self, address=57):
34
- self.i2c = I2C(-1, Pin(resolve_pin('i2c_scl')), Pin(resolve_pin('i2c_sda')), freq=9600)
34
+ self.i2c = I2C(-1, Pin(bind_pin('i2c_scl')), Pin(bind_pin('i2c_sda')), freq=9600)
35
35
  self.address = address
36
36
  self.init()
37
37
  self._started = False
@@ -343,7 +343,7 @@ class VL53L0X:
343
343
 
344
344
  def measure():
345
345
  """
346
- Experimental
346
+ Experimental - Time of Flight Distance Sensor
347
347
  """
348
348
  global __TOF_OBJ
349
349
  if __TOF_OBJ is None:
@@ -18,6 +18,11 @@ def temp():
18
18
  """
19
19
  Measure CPU temperature
20
20
  """
21
+ try:
22
+ cpu_temp = esp32.mcu_temperature()
23
+ return {'MCU temp [C]': int(cpu_temp)}
24
+ except:
25
+ pass
21
26
  try:
22
27
  raw_temp = esp32.raw_temperature()
23
28
  except Exception as e:
@@ -0,0 +1,53 @@
1
+ from Espnow import ESPNowSS
2
+ ESPNOW = ESPNowSS()
3
+
4
+
5
+ def send(peer:bytes|str, cmd:str='modules'):
6
+ """
7
+ Send message to peer (by mac address)
8
+ :param peer: mac address of espnow device
9
+ :param cmd: message string/load module call
10
+ """
11
+ return ESPNOW.send(peer, cmd)
12
+
13
+ def stats():
14
+ """
15
+ Get ESPNOW stats
16
+ """
17
+ return ESPNOW.stats()
18
+
19
+
20
+ def members():
21
+ """
22
+ Get ESPNow devices
23
+ """
24
+ return ESPNOW.members()
25
+
26
+
27
+ def handshake(peer:bytes|str):
28
+ """
29
+ Handshake with ESPNow Peer
30
+ :param peer: mac address of espnow device
31
+ - device name detection
32
+ - address:name caching
33
+ """
34
+ return ESPNOW.handshake(peer)
35
+
36
+
37
+ def remove(peer:bytes):
38
+ """
39
+ Remove peer by binary mac address
40
+ :param peer: binary mac address of espnow device
41
+ """
42
+ return ESPNOW.remove_peer(peer)
43
+
44
+
45
+ def help():
46
+ """
47
+ ESPNOW sender/receiver with LM execution
48
+ """
49
+ return ('handshake peer=<mac-address>',
50
+ 'send peer=<peer-name> cmd="hello"',
51
+ 'remove peer=<binary-mac-address>',
52
+ 'stats',
53
+ 'members')
@@ -1,4 +1,4 @@
1
- from microIO import resolve_pin, pinmap_search
1
+ from microIO import bind_pin, pinmap_search
2
2
 
3
3
  __I2C = None
4
4
 
@@ -7,7 +7,7 @@ def __init():
7
7
  global __I2C
8
8
  if __I2C is None:
9
9
  from machine import Pin, I2C
10
- __I2C = I2C(-1, Pin(resolve_pin('i2c_scl')), Pin(resolve_pin('i2c_sda')))
10
+ __I2C = I2C(-1, Pin(bind_pin('i2c_scl')), Pin(bind_pin('i2c_sda')))
11
11
  return __I2C
12
12
 
13
13
 
@@ -24,8 +24,9 @@ def discover():
24
24
  """
25
25
  Discover devices
26
26
  """
27
- known_addresses = {hex(0x0A): "trackball", hex(0x3c): "oled",
28
- hex(0x76): "bme280", hex(0x10): 'veml7700'}
27
+ known_addresses = {hex(0x0A): "TRACKBALL", hex(0x3c): "OLED",
28
+ hex(0x76): "BME280", hex(0x10): 'VEML7700',
29
+ hex(0x6b): "QMI8658", hex(0x29): 'TCS3472'}
29
30
  devices = scan()
30
31
  output = {"unknown": []}
31
32
  for k in devices: