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
@@ -0,0 +1,255 @@
1
+ """
2
+ micrOS ESPNow cluster module.
3
+ -- STA/AP Channel sync [OK]
4
+ -- wifi settings sync [OK]
5
+ -- health (cluster availability) [OK]
6
+ -- cluster run <cmd> [OK]
7
+ ShellCli (socket) extension (todo)
8
+ -- health (cluster availability)
9
+ """
10
+
11
+ from binascii import hexlify
12
+ from machine import soft_reset
13
+ from Config import cfgget, cfgput
14
+ from Network import _select_available_wifi_nw, ifconfig, WLAN, STA_IF, AP_IF
15
+ from Common import micro_task, exec_cmd, syslog
16
+ if cfgget("espnow"):
17
+ from Espnow import ESPNowSS
18
+ ESPNOW = ESPNowSS()
19
+ else:
20
+ ESPNOW = None
21
+
22
+ class Cluster:
23
+ CHANNEL = 6 # Leader channel to align with
24
+ ANCHOR_SSID_POSTFIX = "-mCSA" # micrOS (Wifi) Channel Sync Anchor
25
+ ANCHOR_ENABLED = False # Anchor indicator
26
+ REFRESH_MS = 20 * 60_000 # 20min - refresh channel sync period (AP mode)
27
+
28
+ #########################################################
29
+ # CLUSTER - LOCAL EXECUTION "ON TARGET" #
30
+ #########################################################
31
+
32
+ @micro_task("cluster", _wrap=True)
33
+ async def _reboot(tag:str):
34
+ """
35
+ Restart in the background
36
+ (Enable function return before restart...)
37
+ """
38
+ with micro_task(tag) as my_task:
39
+ await my_task.feed(5000)
40
+ soft_reset()
41
+
42
+
43
+ def _update_wifi(ssid:str, pwd:str):
44
+ """
45
+ Local Config Setter - Add WiFi settings
46
+ :param ssid: str - SSID
47
+ :param pwd: str - Password
48
+ """
49
+ def _update_sta_config():
50
+ nonlocal _ssid, _pwd
51
+ essids = cfgget("staessid")
52
+ passwords = cfgget("stapwd")
53
+ if _ssid in essids:
54
+ # [INFO] No password refresh is supported
55
+ return f"Wifi already known: {ssid}"
56
+ # Deserialize wifi settings from config file
57
+ essids_list = essids.split(";")
58
+ passwords_list = passwords.split(";")
59
+ # Extend with new wifi settings
60
+ essids_list.append(_ssid)
61
+ passwords_list.append(_pwd)
62
+ # Serialize back wifi settings to config file
63
+ cfgput("staessid",";".join(essids_list))
64
+ cfgput("stapwd", ";".join(passwords_list))
65
+ # REBOOT
66
+ _reboot()
67
+ return "Soft reboot, apply wifi settings"
68
+
69
+ if ';' in ssid or ';' in pwd:
70
+ return "Unsupported character in ssid or pwd ;"
71
+ # Check Wifi settings
72
+ if cfgget("nwmd").upper() == "STA":
73
+ # Check current wifi state
74
+ if ifconfig()[0] == "STA":
75
+ return "Device already connected to WiFi"
76
+ # Validate wifi essid is available
77
+ _ssid, _pwd = _select_available_wifi_nw(ssid, pwd)
78
+ if _ssid is None:
79
+ return f"Wifi SSID not available: {ssid}"
80
+ return _update_sta_config()
81
+ return "Wifi is in Access Point mode, skip sync"
82
+
83
+
84
+ def _run(cmd:str):
85
+ state, out = exec_cmd(cmd.split(), secure=True)
86
+ return f"[{'OK' if state else 'NOK'}] {out}"
87
+
88
+
89
+ @micro_task("cluster", _wrap=True)
90
+ async def _align_channel(tag:str, sta:STA_IF, ap:AP_IF):
91
+ _initialized = False
92
+
93
+ with micro_task(tag) as my_task:
94
+ while True:
95
+ my_task.out = "Sync in progress..."
96
+ ch = Cluster.CHANNEL
97
+ _refresh_ms = Cluster.REFRESH_MS
98
+ for s, b, c, *_ in sta.scan():
99
+ sta_name = (s.decode() if isinstance(s, bytes) else s)
100
+ if sta_name.endswith(Cluster.ANCHOR_SSID_POSTFIX):
101
+ my_task.out = f"Anchor {sta_name} channel: {c} (refresh: {int(_refresh_ms/60_000)}min)"
102
+ ch = c
103
+ break
104
+
105
+ if not _initialized or ch != Cluster.CHANNEL:
106
+ Cluster.CHANNEL = ch
107
+ if not sta.isconnected():
108
+ # ENABLE ESPNOW STA MAC ACCESS - AFTER THIS ALL DEVICES CAN REACH EACH OTHER ON STA MAC ADDRESS
109
+ try: sta.config(channel=ch)
110
+ except Exception as e:
111
+ my_task.out = f"STA Failed to set {ch} channel: {e}"
112
+ # ensure AP advertises/operates on the same channel (important when STA not connected yet)
113
+ try: ap.config(channel=ch)
114
+ except Exception as e:
115
+ my_task.out = f"AP Failed to set {ch} channel: {e}"
116
+ _initialized = True
117
+ await my_task.feed(_refresh_ms)
118
+
119
+
120
+ @micro_task("cluster", _wrap=True)
121
+ async def _network(tag:str, anchor=False):
122
+ """
123
+ Support hybrid AP/STA ESPNow communication
124
+ For ESPNow communication all device should use the same Wifi channel!
125
+ - LEADER: STA*/AP mode - *channel is set by the router and can change
126
+ - AP deices should use the same channel as ANCHOR (discovery by leader/anchor(STA) over AP anchor)
127
+ - ESPNOW: STA mac addresses are stored on ANCHOR
128
+ :param anchor: enable anchor mode (AP) for ESPNow channel synchronization
129
+ """
130
+ def _conf_ap_anchor():
131
+ _ap = WLAN(AP_IF)
132
+ if not _ap.active(): _ap.active(True)
133
+ anchor_ssid = f"{cfgget('devfid')}{Cluster.ANCHOR_SSID_POSTFIX}"
134
+ try:
135
+ _ap.config(essid=anchor_ssid, password=cfgget("appwd"), authmode=3, max_clients=5)
136
+ return True
137
+ except Exception as e:
138
+ syslog(f"[ERR] Anchor configuration failed: {e}")
139
+ return False
140
+ def _enable_sta():
141
+ sta = WLAN(STA_IF)
142
+ if not sta.active(): sta.active(True)
143
+ return sta
144
+
145
+ with micro_task(tag) as my_task:
146
+ # CONFIGURE WIFI CHANNEL SYNC ROLES
147
+ my_task.out = "Configure cluster network"
148
+ micros_nw = ifconfig()[0]
149
+ # MICROS in STA MODE
150
+ if micros_nw == "STA":
151
+ if anchor:
152
+ # CREATE CHANNEL ANCHOR - AP channel is inherited from STA
153
+ Cluster.ANCHOR_ENABLED = _conf_ap_anchor()
154
+ else:
155
+ # MICROS in AP MODE: CLUSTER FOLLOWER - WIFI CHANNEL SYNC WITH ANCHOR
156
+ ap, sta = WLAN(AP_IF), _enable_sta()
157
+ # Sync Channel with Cluster Anchor
158
+ _align_channel(sta, ap)
159
+ if anchor:
160
+ # MICROS in AP MODE - RECONFIGURE AP NAME to match Anchor
161
+ # EXPERIMENTAL FEATURE: Scans and Advertise the channel as well.
162
+ Cluster.ANCHOR_ENABLED = _conf_ap_anchor()
163
+ my_task.out = status()
164
+
165
+ #########################################################
166
+ # CLUSTER WIDE FEATURES #
167
+ #########################################################
168
+
169
+ def sync_wifi():
170
+ """
171
+ ESPNow Cluster Wifi Settings Sync for Station (STA) Connection Mode
172
+ - Join devices to the same wifi network...
173
+ """
174
+ if ESPNOW is None:
175
+ return "ESPNow is disabled"
176
+ # Check current wifi state
177
+ if ifconfig()[0] != "STA":
178
+ return "No WiFi STA Connection: no verified settings to share"
179
+ # [1] Get current wifi ssid and password
180
+ _ssid, _pwd = _select_available_wifi_nw(cfgget("staessid"), cfgget("stapwd"))
181
+ # [2] Send command: 'cluster _update_wifi "<ssid>" "<pwd>"'
182
+ command = f"cluster _update_wifi '{_ssid}' '{_pwd}'"
183
+ sync_tasks = ESPNOW.cluster_send(command)
184
+ return sync_tasks
185
+
186
+
187
+ def run(cmd:str):
188
+ """
189
+ Run a command on the cluster
190
+ :param cmd: str - command to run on the cluster
191
+ Example: cmd='system heartbeat'
192
+ """
193
+ command = f"cluster _run '{cmd}'"
194
+ sync_tasks = ESPNOW.cluster_send(command)
195
+ return sync_tasks
196
+
197
+
198
+ def health():
199
+ """
200
+ Simple connection check
201
+ - with default espnow-micros hello message
202
+ """
203
+ if ESPNOW is None:
204
+ return "ESPNow is disabled"
205
+ return ESPNOW.cluster_send("hello")
206
+
207
+
208
+ def members():
209
+ """
210
+ List all members in the cluster
211
+ """
212
+ if ESPNOW is None:
213
+ return "ESPNow is disabled"
214
+ return {hexlify(mac, ':').decode(): name for mac, name in ESPNOW.devices.items()}
215
+
216
+
217
+ def status():
218
+ """
219
+ Cluster setup status
220
+ """
221
+ nw_if = ifconfig()[0]
222
+ cluster_settings = {"channel": Cluster.CHANNEL, "primary_nw": nw_if,
223
+ "anchor": Cluster.ANCHOR_ENABLED}
224
+ if nw_if == "AP":
225
+ cluster_settings["refresh"] = Cluster.REFRESH_MS
226
+ return cluster_settings
227
+
228
+
229
+ def load(anchor:bool=False, refresh:int=None):
230
+ """
231
+ Enable ESPNow protocol 'cluster' module access
232
+ :param anchor: create AP as Channel Anchor (Channel Leader Role)
233
+ :param refresh: refresh channel sync period in minute (AP)
234
+ """
235
+ if ESPNOW is None:
236
+ return "ESPNow is disabled"
237
+ if refresh is not None:
238
+ Cluster.REFRESH_MS = 60_000 if refresh < 1 else refresh * 60_000
239
+ # Configure cluster network - after micrOS network setup
240
+ _network(anchor)
241
+ return f"Enable cluster module access"
242
+
243
+
244
+ def help(widgets=True):
245
+ """
246
+ [BETA]
247
+ Show help for cluster commands
248
+ """
249
+ return ("load anchor=False refresh=20",
250
+ "run 'command'",
251
+ "sync_wifi",
252
+ "health",
253
+ "members",
254
+ "status",
255
+ "[Info] Get command results:\n\ttask show con.espnow.*")
@@ -1,7 +1,7 @@
1
1
  from math import pow
2
2
  from sys import platform
3
3
  from machine import ADC, Pin
4
- from microIO import resolve_pin, pinmap_search
4
+ from microIO import bind_pin, pinmap_search
5
5
  from Types import resolve
6
6
 
7
7
  #########################################
@@ -20,10 +20,10 @@ def __get_resistance():
20
20
  global __ADC, __ADC_PROP
21
21
  if __ADC is None:
22
22
  if 'esp8266' in platform:
23
- __ADC = ADC(resolve_pin('co2')) # 1V measure range
23
+ __ADC = ADC(bind_pin('co2')) # 1V measure range
24
24
  __ADC_PROP = (1023, 1.0)
25
25
  else:
26
- __ADC = ADC(Pin(resolve_pin('co2')))
26
+ __ADC = ADC(Pin(bind_pin('co2')))
27
27
  __ADC.atten(ADC.ATTN_11DB) # 3.6V measure range
28
28
  __ADC.width(ADC.WIDTH_10BIT) # Default 10 bit ADC
29
29
  __ADC_PROP = (1023, 3.6)
@@ -1,4 +1,4 @@
1
- from microIO import resolve_pin, pinmap_search
1
+ from microIO import bind_pin, pinmap_search
2
2
  from Common import data_logger
3
3
  from Types import resolve
4
4
 
@@ -14,7 +14,7 @@ def __init_DHT11():
14
14
  if __DHT_OBJ is None:
15
15
  from dht import DHT11
16
16
  from machine import Pin
17
- __DHT_OBJ = DHT11(Pin(resolve_pin('dhtpin')))
17
+ __DHT_OBJ = DHT11(Pin(bind_pin('dhtpin')))
18
18
  return __DHT_OBJ
19
19
 
20
20
 
@@ -1,4 +1,4 @@
1
- from microIO import resolve_pin, pinmap_search
1
+ from microIO import bind_pin, pinmap_search
2
2
  from Common import data_logger
3
3
  from Types import resolve
4
4
 
@@ -14,7 +14,7 @@ def __init_DHT22():
14
14
  if __DHT_OBJ is None:
15
15
  from dht import DHT22
16
16
  from machine import Pin
17
- __DHT_OBJ = DHT22(Pin(resolve_pin('dhtpin')))
17
+ __DHT_OBJ = DHT22(Pin(bind_pin('dhtpin')))
18
18
  return __DHT_OBJ
19
19
 
20
20
 
@@ -1,6 +1,6 @@
1
1
  from sys import platform
2
- from microIO import resolve_pin, pinmap_search
3
- from Common import transition_gen, micro_task
2
+ from microIO import bind_pin, pinmap_search
3
+ from Common import transition_gen, micro_task, data_dir
4
4
  from utime import sleep_ms
5
5
  from Types import resolve
6
6
 
@@ -15,6 +15,7 @@ class Data:
15
15
  PERSISTENT_CACHE = False
16
16
  DIMM_TASK_TAG = "dimmer._tran"
17
17
  TASK_STATE = False
18
+ FILE_CACHE = data_dir('dimmer.cache')
18
19
 
19
20
 
20
21
  #########################################
@@ -24,7 +25,7 @@ class Data:
24
25
  def __dimmer_init():
25
26
  if Data.DIMMER_OBJ is None:
26
27
  from machine import Pin, PWM
27
- dimmer_pin = Pin(resolve_pin('dim_1'))
28
+ dimmer_pin = Pin(bind_pin('dim_1'))
28
29
  if platform == 'esp8266':
29
30
  Data.DIMMER_OBJ = PWM(dimmer_pin, freq=1024)
30
31
  else:
@@ -34,7 +35,7 @@ def __dimmer_init():
34
35
 
35
36
  def __persistent_cache_manager(mode='r'):
36
37
  """
37
- pds - persistent data structure
38
+ File cache
38
39
  modes:
39
40
  r - recover, s - save
40
41
  """
@@ -42,12 +43,12 @@ def __persistent_cache_manager(mode='r'):
42
43
  return
43
44
  if mode == 's':
44
45
  # SAVE CACHE
45
- with open('dimmer.pds', 'w') as f:
46
+ with open(Data.FILE_CACHE, 'w') as f:
46
47
  f.write(','.join([str(k) for k in Data.DIMMER_CACHE]))
47
48
  return
48
49
  try:
49
50
  # RESTORE CACHE
50
- with open('dimmer.pds', 'r') as f:
51
+ with open(Data.FILE_CACHE, 'r') as f:
51
52
  Data.DIMMER_CACHE = [int(data) for data in f.read().strip().split(',')]
52
53
  except:
53
54
  pass
@@ -71,7 +72,7 @@ def load(cache=None):
71
72
  """
72
73
  Initialize dimmer module
73
74
  :param cache bool: file state machine cache: True/False/None(default: automatic True)
74
- - Load .pds (state machine cache) for this load module
75
+ - Load .cache (state machine cache) for this load module
75
76
  - Apply loaded states to gpio pins (boot function)
76
77
  :return str: Cache state
77
78
  """
@@ -183,8 +184,7 @@ def transition(value, sec=1.0, wake=False):
183
184
  # Create transition generator and calculate step_ms
184
185
  fade_gen, fade_step_ms = transition_gen(from_dim, value, interval_sec=sec)
185
186
  # [!] ASYNC TASK CREATION [1*] with async task callback + taskID (TAG) handling
186
- state = micro_task(tag=Data.DIMM_TASK_TAG, task=_task(ms_period=fade_step_ms, iterable=fade_gen))
187
- return "Starting transition" if state else "Transition already running"
187
+ return micro_task(tag=Data.DIMM_TASK_TAG, task=_task(ms_period=fade_step_ms, iterable=fade_gen))
188
188
 
189
189
 
190
190
  def subscribe_presence():
@@ -1,6 +1,6 @@
1
1
  from machine import Pin, time_pulse_us
2
2
  from utime import sleep_us
3
- from microIO import resolve_pin, pinmap_search
3
+ from microIO import bind_pin, pinmap_search
4
4
  from Common import micro_task
5
5
  from Types import resolve
6
6
 
@@ -14,8 +14,8 @@ def __init_HCSR04():
14
14
  """
15
15
  global __TRIGGER_OBJ, __ECHO_OBJ
16
16
  if __TRIGGER_OBJ is None or __ECHO_OBJ is None:
17
- trigger_pin = resolve_pin('hcsrtrig')
18
- echo_pin = resolve_pin('hcsrecho')
17
+ trigger_pin = bind_pin('hcsrtrig')
18
+ echo_pin = bind_pin('hcsrecho')
19
19
  # Init trigger pin (out)
20
20
  __TRIGGER_OBJ = Pin(trigger_pin, mode=Pin.OUT, pull=None)
21
21
  __TRIGGER_OBJ.value(0)
@@ -70,9 +70,7 @@ def start_dimmer_indicator(idle_distance=180):
70
70
  """Distance visualization on LED brightness (LM_dimmer)"""
71
71
  from LM_dimmer import set_value
72
72
  # [!] ASYNC TASK CREATION [1*] with async task callback + taskID (TAG) handling
73
- state = micro_task(tag="distance.visual", task=__task(period_ms=200, dimmer=set_value, idle_cm=idle_distance))
74
- return "Starting" if state else "Already running"
75
-
73
+ return micro_task(tag="distance.visual", task=__task(period_ms=200, dimmer=set_value, idle_cm=idle_distance))
76
74
 
77
75
 
78
76
  #########################
@@ -1,5 +1,5 @@
1
1
  import machine, onewire, ds18x20, time
2
- from microIO import resolve_pin, pinmap_search
2
+ from microIO import bind_pin, pinmap_search
3
3
  from Types import resolve
4
4
 
5
5
  DS_OBJ = None
@@ -8,7 +8,7 @@ DS_OBJ = None
8
8
  def __init_DS18():
9
9
  global DS_OBJ
10
10
  if DS_OBJ is None:
11
- ds_pin = machine.Pin(resolve_pin('ds18'))
11
+ ds_pin = machine.Pin(bind_pin('ds18'))
12
12
  DS_OBJ = ds18x20.DS18X20(onewire.OneWire(ds_pin))
13
13
  return DS_OBJ
14
14
 
@@ -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')