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.
- env/driver_cp210x/.DS_Store +0 -0
- env/driver_cp210x/macOS_VCP_Driver/SiLabsUSBDriverDisk.dmg +0 -0
- env/driver_cp210x/macOS_VCP_Driver/macOS_VCP_Driver_Release_Notes.txt +17 -1
- micrOS/micropython/esp32-20251209-v1.27.0.bin +0 -0
- micrOS/micropython/esp32c3-20251209-v1.27.0.bin +0 -0
- micrOS/micropython/esp32c6-20251209-v1.27.0.bin +0 -0
- micrOS/micropython/esp32s2-20251209-v1.27.0.bin +0 -0
- micrOS/micropython/esp32s2-LOLIN_MINI-20251209-v1.27.0.bin +0 -0
- micrOS/micropython/esp32s3-4MBflash-20241129-v1.24.1.bin +0 -0
- micrOS/micropython/esp32s3-8MBflash-20251209-v1.27.0.bin +0 -0
- micrOS/micropython/esp32s3_spiram_oct-20251209-v1.27.0.bin +0 -0
- micrOS/micropython/rpi-pico-w-20251209-v1.27.0.uf2 +0 -0
- micrOS/micropython/tinypico-20251209-v1.27.0.bin +0 -0
- micrOS/release_info/micrOS_ReleaseInfo/system_analysis_sum.json +191 -151
- micrOS/source/Auth.py +37 -0
- micrOS/source/Common.py +376 -102
- micrOS/source/Config.py +55 -25
- micrOS/source/Debug.py +54 -193
- micrOS/source/Espnow.py +404 -0
- micrOS/source/Files.py +207 -0
- micrOS/source/Hooks.py +88 -16
- micrOS/source/InterConnect.py +130 -46
- micrOS/source/Interrupts.py +8 -8
- micrOS/source/Logger.py +131 -0
- micrOS/source/Network.py +41 -21
- micrOS/source/Notify.py +74 -198
- micrOS/source/Pacman.py +326 -0
- micrOS/source/Scheduler.py +18 -55
- micrOS/source/Server.py +84 -217
- micrOS/source/Shell.py +103 -93
- micrOS/source/Tasks.py +239 -173
- micrOS/source/Time.py +21 -22
- micrOS/source/Types.py +89 -54
- micrOS/source/Web.py +485 -0
- micrOS/source/__pycache__/Common.cpython-312.pyc +0 -0
- micrOS/source/__pycache__/Debug.cpython-312.pyc +0 -0
- micrOS/source/__pycache__/Files.cpython-312.pyc +0 -0
- micrOS/source/__pycache__/Logger.cpython-312.pyc +0 -0
- micrOS/source/__pycache__/Scheduler.cpython-312.pyc +0 -0
- micrOS/source/__pycache__/Server.cpython-312.pyc +0 -0
- micrOS/source/__pycache__/Shell.cpython-312.pyc +0 -0
- micrOS/source/__pycache__/replhelper.cpython-312.pyc +0 -0
- micrOS/source/helpers.py +132 -0
- micrOS/source/micrOS.py +25 -21
- micrOS/source/micrOSloader.py +14 -23
- micrOS/source/microIO.py +94 -57
- toolkit/simulator_lib/LP_darwin.py → micrOS/source/modules/IO_esp32.py +22 -11
- micrOS/source/{IO_esp32c3.py → modules/IO_esp32c3.py} +6 -1
- micrOS/source/modules/IO_esp32c6.py +38 -0
- micrOS/source/{IO_esp32s2.py → modules/IO_esp32s2.py} +6 -1
- micrOS/source/{IO_esp32s3.py → modules/IO_esp32s3.py} +43 -2
- micrOS/source/modules/IO_m5stamp.py +86 -0
- micrOS/source/{IO_qtpy.py → modules/IO_qtpy.py} +28 -18
- micrOS/source/{IO_tinypico.py → modules/IO_tinypico.py} +48 -3
- micrOS/source/modules/LM_L298N.py +161 -0
- {toolkit/workspace/precompiled → micrOS/source/modules}/LM_L9110_DCmotor.py +4 -4
- micrOS/source/{LM_OV2640.py → modules/LM_OV2640.py} +53 -42
- micrOS/source/{LM_VL53L0X.py → modules/LM_VL53L0X.py} +5 -5
- micrOS/source/{LM_aht10.py → modules/LM_aht10.py} +12 -4
- micrOS/source/{LM_bme280.py → modules/LM_bme280.py} +13 -25
- micrOS/source/{LM_buzzer.py → modules/LM_buzzer.py} +42 -40
- micrOS/source/{LM_cct.py → modules/LM_cct.py} +22 -27
- micrOS/source/modules/LM_cluster.py +255 -0
- micrOS/source/{LM_co2.py → modules/LM_co2.py} +13 -6
- micrOS/source/{LM_dht11.py → modules/LM_dht11.py} +13 -29
- micrOS/source/{LM_dht22.py → modules/LM_dht22.py} +13 -28
- micrOS/source/{LM_dimmer.py → modules/LM_dimmer.py} +19 -16
- micrOS/source/modules/LM_distance.py +135 -0
- micrOS/source/{LM_ds18.py → modules/LM_ds18.py} +12 -4
- micrOS/source/{LM_esp32.py → modules/LM_esp32.py} +16 -4
- micrOS/source/modules/LM_espnow.py +53 -0
- micrOS/source/modules/LM_fileserver.py +265 -0
- micrOS/source/{LM_gameOfLife.py → modules/LM_gameOfLife.py} +5 -5
- micrOS/source/{LM_genIO.py → modules/LM_genIO.py} +49 -35
- micrOS/source/modules/LM_haptic.py +111 -0
- micrOS/source/modules/LM_i2c.py +61 -0
- micrOS/source/{LM_i2s_mic.py → modules/LM_i2s_mic.py} +20 -23
- micrOS/source/{LM_ld2410.py → modules/LM_ld2410.py} +3 -3
- micrOS/source/{LM_light_sensor.py → modules/LM_light_sensor.py} +22 -26
- micrOS/source/modules/LM_mh_z19c.py +198 -0
- micrOS/source/modules/LM_neoeffects.py +284 -0
- micrOS/source/{LM_neopixel.py → modules/LM_neopixel.py} +26 -31
- micrOS/source/{LM_oled.py → modules/LM_oled.py} +28 -20
- micrOS/source/{LM_oled_sh1106.py → modules/LM_oled_sh1106.py} +28 -24
- micrOS/source/{LM_oled_ui.py → modules/LM_oled_ui.py} +132 -174
- micrOS/source/modules/LM_pacman.py +320 -0
- micrOS/source/{LM_presence.py → modules/LM_presence.py} +24 -36
- micrOS/source/modules/LM_qmi8658.py +204 -0
- micrOS/source/{LM_rencoder.py → modules/LM_rencoder.py} +40 -11
- micrOS/source/modules/LM_rest.py +81 -0
- micrOS/source/{LM_rgb.py → modules/LM_rgb.py} +25 -34
- micrOS/source/{LM_rgbcct.py → modules/LM_rgbcct.py} +5 -5
- micrOS/source/{LM_roboarm.py → modules/LM_roboarm.py} +37 -45
- micrOS/source/modules/LM_robustness.py +137 -0
- micrOS/source/{LM_rp2w.py → modules/LM_rp2w.py} +3 -0
- micrOS/source/{LM_sdcard.py → modules/LM_sdcard.py} +3 -0
- micrOS/source/{LM_servo.py → modules/LM_servo.py} +4 -4
- micrOS/source/modules/LM_sound_event.py +751 -0
- micrOS/source/{LM_stepper.py → modules/LM_stepper.py} +8 -8
- micrOS/source/{LM_switch.py → modules/LM_switch.py} +21 -18
- micrOS/source/{LM_system.py → modules/LM_system.py} +96 -59
- micrOS/source/modules/LM_tcs3472.py +187 -0
- micrOS/source/modules/LM_telegram.py +388 -0
- micrOS/source/modules/LM_trackball.py +287 -0
- micrOS/source/modules/LM_veml7700.py +159 -0
- micrOS/source/modules/LM_web.py +38 -0
- micrOS/source/urequests.py +204 -91
- {toolkit/workspace/precompiled → micrOS/source/web}/dashboard.html +9 -4
- micrOS/source/web/editor.js +440 -0
- micrOS/source/web/filesui.html +178 -0
- micrOS/source/web/filesui.js +338 -0
- micrOS/source/{index.html → web/index.html} +44 -2
- micrOS/source/web/uapi.js +103 -0
- micrOS/source/web/udashboard.js +129 -0
- micrOS/source/web/ustyle.css +55 -0
- micrOS/source/web/uwidgets.js +172 -0
- micrOS/source/web/uwidgets_pro.js +99 -0
- micrOS/utests/__init__.py +0 -0
- micrOS/utests/test_scheduler.py +435 -0
- {micrOSDevToolKit-2.1.5.data → microsdevtoolkit-2.26.1.data}/scripts/devToolKit.py +47 -4
- {micrOSDevToolKit-2.1.5.dist-info → microsdevtoolkit-2.26.1.dist-info}/METADATA +392 -279
- microsdevtoolkit-2.26.1.dist-info/RECORD +396 -0
- {micrOSDevToolKit-2.1.5.dist-info → microsdevtoolkit-2.26.1.dist-info}/WHEEL +1 -1
- toolkit/DevEnvCompile.py +63 -33
- toolkit/DevEnvOTA.py +72 -22
- toolkit/DevEnvUSB.py +147 -77
- toolkit/Gateway.py +9 -9
- toolkit/LM_to_compile.dat +12 -4
- toolkit/MicrOSDevEnv.py +129 -51
- toolkit/WebRepl.py +73 -0
- toolkit/dashboard_apps/BackupRestore.py +171 -0
- toolkit/dashboard_apps/CCTDemo.py +12 -17
- toolkit/dashboard_apps/CCTTest.py +20 -24
- toolkit/dashboard_apps/CamStream.py +2 -6
- toolkit/dashboard_apps/CatGame.py +14 -16
- toolkit/dashboard_apps/Dimmer.py +11 -21
- toolkit/dashboard_apps/GetVersion.py +11 -19
- toolkit/dashboard_apps/MicrophoneTest.py +2 -7
- toolkit/dashboard_apps/NeoEffectsDemo.py +22 -35
- toolkit/dashboard_apps/NeopixelTest.py +20 -25
- toolkit/dashboard_apps/PresenceTest.py +2 -8
- toolkit/dashboard_apps/QMI8685_GYRO.py +68 -0
- toolkit/dashboard_apps/RGBTest.py +20 -24
- toolkit/dashboard_apps/RoboArm.py +24 -32
- toolkit/dashboard_apps/SED_test.py +10 -14
- toolkit/dashboard_apps/SensorsTest.py +61 -0
- toolkit/dashboard_apps/SystemTest.py +219 -117
- toolkit/dashboard_apps/Template_app.py +12 -19
- toolkit/dashboard_apps/_app_base.py +34 -0
- toolkit/dashboard_apps/_gyro_visualizer.py +78 -0
- toolkit/dashboard_apps/uLightDemo.py +15 -24
- toolkit/index.html +6 -5
- toolkit/lib/LocalMachine.py +6 -1
- toolkit/lib/MicrosFiles.py +46 -0
- toolkit/lib/Repository.py +64 -0
- toolkit/lib/TerminalColors.py +4 -0
- toolkit/lib/macroScript.py +371 -0
- toolkit/lib/micrOSClient.py +124 -51
- toolkit/lib/micrOSClientHistory.py +156 -0
- toolkit/lib/pip_package_installer.py +31 -4
- toolkit/micrOSdashboard.py +16 -21
- toolkit/micrOSlint.py +28 -10
- toolkit/simulator_lib/.DS_Store +0 -0
- micrOS/source/IO_esp32.py → toolkit/simulator_lib/IO_darwin.py +3 -0
- toolkit/simulator_lib/__pycache__/IO_darwin.cpython-312.pyc +0 -0
- toolkit/simulator_lib/__pycache__/aioespnow.cpython-312.pyc +0 -0
- toolkit/simulator_lib/__pycache__/camera.cpython-312.pyc +0 -0
- toolkit/simulator_lib/__pycache__/framebuf.cpython-312.pyc +0 -0
- toolkit/simulator_lib/__pycache__/machine.cpython-312.pyc +0 -0
- toolkit/simulator_lib/__pycache__/micropython.cpython-312.pyc +0 -0
- toolkit/simulator_lib/__pycache__/mip.cpython-312.pyc +0 -0
- toolkit/simulator_lib/__pycache__/neopixel.cpython-312.pyc +0 -0
- toolkit/simulator_lib/__pycache__/network.cpython-312.pyc +0 -0
- toolkit/simulator_lib/__pycache__/sim_common.cpython-312.pyc +0 -0
- toolkit/simulator_lib/__pycache__/simgc.cpython-312.pyc +0 -0
- toolkit/simulator_lib/__pycache__/simulator.cpython-312.pyc +0 -0
- toolkit/simulator_lib/__pycache__/uasyncio.cpython-312.pyc +0 -0
- toolkit/simulator_lib/__pycache__/uos.cpython-312.pyc +0 -0
- toolkit/simulator_lib/__pycache__/urandom.cpython-312.pyc +0 -0
- toolkit/simulator_lib/__pycache__/usocket.cpython-312.pyc +0 -0
- toolkit/simulator_lib/__pycache__/ussl.cpython-312.pyc +0 -0
- toolkit/simulator_lib/aioespnow.py +28 -0
- toolkit/simulator_lib/camera.py +84 -0
- toolkit/simulator_lib/dht.py +1 -1
- toolkit/simulator_lib/framebuf.py +49 -1
- toolkit/simulator_lib/machine.py +32 -2
- toolkit/simulator_lib/micropython.py +3 -3
- toolkit/simulator_lib/mip.py +165 -0
- toolkit/simulator_lib/neopixel.py +3 -2
- toolkit/simulator_lib/network.py +2 -1
- toolkit/simulator_lib/node_config.json +2 -3
- toolkit/simulator_lib/ntptime.py +1 -1
- toolkit/simulator_lib/{sim_console.py → sim_common.py} +2 -3
- toolkit/simulator_lib/simgc.py +6 -2
- toolkit/simulator_lib/simulator.py +138 -46
- toolkit/simulator_lib/uasyncio.py +34 -3
- toolkit/simulator_lib/uos.py +147 -0
- toolkit/simulator_lib/urandom.py +4 -0
- toolkit/simulator_lib/usocket.py +5 -1
- toolkit/simulator_lib/view01.jpg +0 -0
- toolkit/simulator_lib/view02.jpg +0 -0
- toolkit/socketClient.py +43 -23
- toolkit/user_data/webhooks/generic.py +1 -1
- toolkit/user_data/webhooks/macro.py +44 -0
- toolkit/user_data/webhooks/template.macro +20 -0
- toolkit/user_data/webhooks/template.py +1 -1
- toolkit/workspace/precompiled/Auth.mpy +0 -0
- toolkit/workspace/precompiled/Common.mpy +0 -0
- toolkit/workspace/precompiled/Config.mpy +0 -0
- toolkit/workspace/precompiled/Debug.mpy +0 -0
- toolkit/workspace/precompiled/Espnow.mpy +0 -0
- toolkit/workspace/precompiled/Files.mpy +0 -0
- toolkit/workspace/precompiled/Hooks.mpy +0 -0
- toolkit/workspace/precompiled/InterConnect.mpy +0 -0
- toolkit/workspace/precompiled/Interrupts.mpy +0 -0
- toolkit/workspace/precompiled/Logger.mpy +0 -0
- toolkit/workspace/precompiled/Network.mpy +0 -0
- toolkit/workspace/precompiled/Notify.mpy +0 -0
- toolkit/workspace/precompiled/Pacman.mpy +0 -0
- toolkit/workspace/precompiled/Scheduler.mpy +0 -0
- toolkit/workspace/precompiled/Server.mpy +0 -0
- toolkit/workspace/precompiled/Shell.mpy +0 -0
- toolkit/workspace/precompiled/Tasks.mpy +0 -0
- toolkit/workspace/precompiled/Time.mpy +0 -0
- toolkit/workspace/precompiled/Types.mpy +0 -0
- toolkit/workspace/precompiled/Web.mpy +0 -0
- toolkit/workspace/precompiled/_mpy.version +1 -1
- toolkit/workspace/precompiled/config/_git.keep +0 -0
- toolkit/workspace/precompiled/helpers.mpy +0 -0
- toolkit/workspace/precompiled/micrOS.mpy +0 -0
- toolkit/workspace/precompiled/micrOSloader.mpy +0 -0
- toolkit/workspace/precompiled/microIO.mpy +0 -0
- toolkit/workspace/precompiled/modules/IO_esp32.mpy +0 -0
- toolkit/workspace/precompiled/modules/IO_esp32c3.mpy +0 -0
- toolkit/workspace/precompiled/modules/IO_esp32c6.mpy +0 -0
- toolkit/workspace/precompiled/modules/IO_esp32s2.mpy +0 -0
- toolkit/workspace/precompiled/modules/IO_esp32s3.mpy +0 -0
- toolkit/workspace/precompiled/modules/IO_m5stamp.mpy +0 -0
- toolkit/workspace/precompiled/modules/IO_qtpy.mpy +0 -0
- toolkit/workspace/precompiled/modules/IO_rp2.mpy +0 -0
- toolkit/workspace/precompiled/modules/IO_tinypico.mpy +0 -0
- toolkit/workspace/precompiled/modules/LM_L298N.mpy +0 -0
- {micrOS/source → toolkit/workspace/precompiled/modules}/LM_L9110_DCmotor.py +4 -4
- toolkit/workspace/precompiled/modules/LM_OV2640.mpy +0 -0
- toolkit/workspace/precompiled/{LM_VL53L0X.py → modules/LM_VL53L0X.py} +5 -5
- toolkit/workspace/precompiled/modules/LM_aht10.mpy +0 -0
- toolkit/workspace/precompiled/modules/LM_bme280.mpy +0 -0
- toolkit/workspace/precompiled/{LM_buzzer.mpy → modules/LM_buzzer.mpy} +0 -0
- toolkit/workspace/precompiled/modules/LM_cct.mpy +0 -0
- toolkit/workspace/precompiled/modules/LM_cluster.mpy +0 -0
- toolkit/workspace/precompiled/modules/LM_co2.mpy +0 -0
- toolkit/workspace/precompiled/modules/LM_dht11.mpy +0 -0
- toolkit/workspace/precompiled/modules/LM_dht22.mpy +0 -0
- toolkit/workspace/precompiled/modules/LM_dimmer.mpy +0 -0
- toolkit/workspace/precompiled/modules/LM_distance.mpy +0 -0
- toolkit/workspace/precompiled/modules/LM_ds18.mpy +0 -0
- toolkit/workspace/precompiled/{LM_esp32.py → modules/LM_esp32.py} +16 -4
- toolkit/workspace/precompiled/modules/LM_espnow.py +53 -0
- toolkit/workspace/precompiled/modules/LM_fileserver.mpy +0 -0
- toolkit/workspace/precompiled/{LM_gameOfLife.mpy → modules/LM_gameOfLife.mpy} +0 -0
- toolkit/workspace/precompiled/modules/LM_genIO.mpy +0 -0
- toolkit/workspace/precompiled/modules/LM_haptic.mpy +0 -0
- toolkit/workspace/precompiled/modules/LM_i2c.py +61 -0
- toolkit/workspace/precompiled/modules/LM_i2s_mic.mpy +0 -0
- toolkit/workspace/precompiled/{LM_ld2410.mpy → modules/LM_ld2410.mpy} +0 -0
- toolkit/workspace/precompiled/modules/LM_light_sensor.mpy +0 -0
- toolkit/workspace/precompiled/modules/LM_mh_z19c.py +198 -0
- toolkit/workspace/precompiled/modules/LM_neoeffects.mpy +0 -0
- toolkit/workspace/precompiled/modules/LM_neopixel.mpy +0 -0
- toolkit/workspace/precompiled/modules/LM_oled.mpy +0 -0
- toolkit/workspace/precompiled/modules/LM_oled_sh1106.mpy +0 -0
- toolkit/workspace/precompiled/modules/LM_oled_ui.mpy +0 -0
- toolkit/workspace/precompiled/modules/LM_pacman.mpy +0 -0
- toolkit/workspace/precompiled/modules/LM_presence.mpy +0 -0
- toolkit/workspace/precompiled/modules/LM_qmi8658.py +204 -0
- toolkit/workspace/precompiled/{LM_rencoder.py → modules/LM_rencoder.py} +40 -11
- toolkit/workspace/precompiled/modules/LM_rest.mpy +0 -0
- toolkit/workspace/precompiled/modules/LM_rgb.mpy +0 -0
- toolkit/workspace/precompiled/{LM_rgbcct.mpy → modules/LM_rgbcct.mpy} +0 -0
- toolkit/workspace/precompiled/modules/LM_roboarm.mpy +0 -0
- toolkit/workspace/precompiled/modules/LM_robustness.py +137 -0
- toolkit/workspace/precompiled/{LM_rp2w.py → modules/LM_rp2w.py} +3 -0
- toolkit/workspace/precompiled/{LM_sdcard.py → modules/LM_sdcard.py} +3 -0
- toolkit/workspace/precompiled/{LM_servo.mpy → modules/LM_servo.mpy} +0 -0
- toolkit/workspace/precompiled/modules/LM_sound_event.mpy +0 -0
- toolkit/workspace/precompiled/{LM_stepper.mpy → modules/LM_stepper.mpy} +0 -0
- toolkit/workspace/precompiled/modules/LM_switch.mpy +0 -0
- toolkit/workspace/precompiled/modules/LM_system.mpy +0 -0
- toolkit/workspace/precompiled/modules/LM_tcs3472.py +187 -0
- toolkit/workspace/precompiled/modules/LM_telegram.mpy +0 -0
- toolkit/workspace/precompiled/{LM_tinyrgb.mpy → modules/LM_tinyrgb.mpy} +0 -0
- toolkit/workspace/precompiled/modules/LM_trackball.mpy +0 -0
- toolkit/workspace/precompiled/modules/LM_veml7700.mpy +0 -0
- toolkit/workspace/precompiled/modules/LM_web.mpy +0 -0
- toolkit/workspace/precompiled/urequests.mpy +0 -0
- {micrOS/source → toolkit/workspace/precompiled/web}/dashboard.html +9 -4
- toolkit/workspace/precompiled/web/editor.js +440 -0
- toolkit/workspace/precompiled/web/filesui.html +178 -0
- toolkit/workspace/precompiled/web/filesui.js +338 -0
- toolkit/workspace/precompiled/{index.html → web/index.html} +44 -2
- toolkit/workspace/precompiled/web/uapi.js +103 -0
- toolkit/workspace/precompiled/web/udashboard.js +129 -0
- toolkit/workspace/precompiled/web/ustyle.css +55 -0
- toolkit/workspace/precompiled/web/uwidgets.js +172 -0
- toolkit/workspace/precompiled/web/uwidgets_pro.js +99 -0
- env/driver_cp210x/CH34XSER_MAC/CH34X_DRV_INSTALL_INSTRUCTIONS.pdf +0 -0
- env/driver_cp210x/CH34XSER_MAC/CH34xVCPDriver.pkg +0 -0
- micrOS/micropython/esp32-20231005-v1.21.0.bin +0 -0
- micrOS/micropython/esp32c3-GENERIC-20240105-v1.22.1.bin +0 -0
- micrOS/micropython/esp32c3-GENERIC-20240222-v1.22.2.bin +0 -0
- micrOS/micropython/esp32s2-GENERIC-20240105-v1.22.1.bin +0 -0
- micrOS/micropython/esp32s2-LOLIN_MINI-20220618-v1.19.1.bin +0 -0
- micrOS/micropython/esp32s3-GENERIC-20240105-v1.22.1.bin +0 -0
- micrOS/micropython/esp32s3_spiram_oct-20231005-v1.21.0.bin +0 -0
- micrOS/micropython/rpi-pico-w-20231005-v1.21.0.uf2 +0 -0
- micrOS/micropython/tinypico-20231005-v1.21.0.bin +0 -0
- micrOS/micropython/tinypico-usbc-UM-20240105-v1.22.1.bin +0 -0
- micrOS/source/LM_L298N_DCmotor.py +0 -86
- micrOS/source/LM_catgame.py +0 -74
- micrOS/source/LM_dashboard_be.py +0 -37
- micrOS/source/LM_demo.py +0 -85
- micrOS/source/LM_distance.py +0 -88
- micrOS/source/LM_i2c.py +0 -44
- micrOS/source/LM_intercon.py +0 -57
- micrOS/source/LM_keychain.py +0 -318
- micrOS/source/LM_lmpacman.py +0 -126
- micrOS/source/LM_neoeffects.py +0 -327
- micrOS/source/LM_pet_feeder.py +0 -76
- micrOS/source/LM_ph_sensor.py +0 -51
- micrOS/source/LM_rest.py +0 -40
- micrOS/source/LM_robustness.py +0 -73
- micrOS/source/LM_telegram.py +0 -96
- micrOS/source/reset.py +0 -11
- micrOS/source/uapi.js +0 -76
- micrOS/source/udashboard.js +0 -137
- micrOS/source/ustyle.css +0 -28
- micrOS/source/uwidgets.js +0 -179
- micrOSDevToolKit-2.1.5.dist-info/RECORD +0 -337
- toolkit/dashboard_apps/AirQualityBME280.py +0 -36
- toolkit/dashboard_apps/AirQualityDHT22_CO2.py +0 -36
- toolkit/lib/file_extensions.py +0 -16
- toolkit/simulator_lib/__pycache__/LP_darwin.cpython-312.pyc +0 -0
- toolkit/simulator_lib/__pycache__/LP_darwin.cpython-38.pyc +0 -0
- toolkit/simulator_lib/__pycache__/LP_darwin.cpython-39.pyc +0 -0
- toolkit/simulator_lib/__pycache__/sim_console.cpython-312.pyc +0 -0
- toolkit/simulator_lib/__pycache__/sim_console.cpython-38.pyc +0 -0
- toolkit/simulator_lib/__pycache__/sim_console.cpython-39.pyc +0 -0
- toolkit/workspace/precompiled/IO_esp32.mpy +0 -0
- toolkit/workspace/precompiled/IO_esp32c3.mpy +0 -0
- toolkit/workspace/precompiled/IO_esp32s2.mpy +0 -0
- toolkit/workspace/precompiled/IO_esp32s3.mpy +0 -0
- toolkit/workspace/precompiled/IO_qtpy.mpy +0 -0
- toolkit/workspace/precompiled/IO_rp2.mpy +0 -0
- toolkit/workspace/precompiled/IO_tinypico.mpy +0 -0
- toolkit/workspace/precompiled/LM_L298N_DCmotor.mpy +0 -0
- toolkit/workspace/precompiled/LM_OV2640.mpy +0 -0
- toolkit/workspace/precompiled/LM_aht10.mpy +0 -0
- toolkit/workspace/precompiled/LM_bme280.mpy +0 -0
- toolkit/workspace/precompiled/LM_catgame.py +0 -74
- toolkit/workspace/precompiled/LM_cct.mpy +0 -0
- toolkit/workspace/precompiled/LM_co2.mpy +0 -0
- toolkit/workspace/precompiled/LM_dashboard_be.py +0 -37
- toolkit/workspace/precompiled/LM_demo.py +0 -85
- toolkit/workspace/precompiled/LM_dht11.mpy +0 -0
- toolkit/workspace/precompiled/LM_dht22.mpy +0 -0
- toolkit/workspace/precompiled/LM_dimmer.mpy +0 -0
- toolkit/workspace/precompiled/LM_distance.py +0 -88
- toolkit/workspace/precompiled/LM_ds18.mpy +0 -0
- toolkit/workspace/precompiled/LM_genIO.mpy +0 -0
- toolkit/workspace/precompiled/LM_i2c.py +0 -44
- toolkit/workspace/precompiled/LM_i2s_mic.mpy +0 -0
- toolkit/workspace/precompiled/LM_intercon.mpy +0 -0
- toolkit/workspace/precompiled/LM_keychain.mpy +0 -0
- toolkit/workspace/precompiled/LM_light_sensor.mpy +0 -0
- toolkit/workspace/precompiled/LM_lmpacman.mpy +0 -0
- toolkit/workspace/precompiled/LM_neoeffects.mpy +0 -0
- toolkit/workspace/precompiled/LM_neopixel.mpy +0 -0
- toolkit/workspace/precompiled/LM_oled.mpy +0 -0
- toolkit/workspace/precompiled/LM_oled_sh1106.mpy +0 -0
- toolkit/workspace/precompiled/LM_oled_ui.mpy +0 -0
- toolkit/workspace/precompiled/LM_pet_feeder.py +0 -76
- toolkit/workspace/precompiled/LM_ph_sensor.py +0 -51
- toolkit/workspace/precompiled/LM_presence.mpy +0 -0
- toolkit/workspace/precompiled/LM_rest.mpy +0 -0
- toolkit/workspace/precompiled/LM_rgb.mpy +0 -0
- toolkit/workspace/precompiled/LM_roboarm.mpy +0 -0
- toolkit/workspace/precompiled/LM_robustness.py +0 -73
- toolkit/workspace/precompiled/LM_switch.mpy +0 -0
- toolkit/workspace/precompiled/LM_system.mpy +0 -0
- toolkit/workspace/precompiled/LM_telegram.mpy +0 -0
- toolkit/workspace/precompiled/reset.mpy +0 -0
- toolkit/workspace/precompiled/uapi.js +0 -76
- toolkit/workspace/precompiled/udashboard.js +0 -137
- toolkit/workspace/precompiled/ustyle.css +0 -28
- toolkit/workspace/precompiled/uwidgets.js +0 -179
- /toolkit/user_data/node_config_archive/.include → /micrOS/source/config/_git.keep +0 -0
- /micrOS/source/{IO_rp2.py → modules/IO_rp2.py} +0 -0
- /micrOS/source/{LM_tinyrgb.py → modules/LM_tinyrgb.py} +0 -0
- {micrOSDevToolKit-2.1.5.dist-info → microsdevtoolkit-2.26.1.dist-info/licenses}/LICENSE +0 -0
- {micrOSDevToolKit-2.1.5.dist-info → microsdevtoolkit-2.26.1.dist-info}/top_level.txt +0 -0
|
@@ -5,44 +5,111 @@ import sys
|
|
|
5
5
|
import time
|
|
6
6
|
import socket
|
|
7
7
|
import ast
|
|
8
|
+
from pprint import pprint
|
|
9
|
+
try:
|
|
10
|
+
from ._app_base import AppBase
|
|
11
|
+
except:
|
|
12
|
+
from _app_base import AppBase
|
|
13
|
+
|
|
8
14
|
MYPATH = os.path.dirname(os.path.abspath(__file__))
|
|
9
|
-
|
|
10
|
-
import socketClient
|
|
15
|
+
REPORT_OUTPUT_PATH = os.path.join(MYPATH, '../../micrOS/release_info/micrOS_ReleaseInfo/devices_system_metrics.json')
|
|
11
16
|
sys.path.append(os.path.join(MYPATH, '../lib/'))
|
|
12
17
|
from TerminalColors import Colors
|
|
13
18
|
import requests
|
|
14
19
|
|
|
15
|
-
|
|
16
|
-
|
|
17
|
-
PASSWD = None
|
|
18
|
-
|
|
19
|
-
|
|
20
|
-
def base_cmd():
|
|
21
|
-
if PASSWD is None:
|
|
22
|
-
return ['--dev', DEVICE]
|
|
23
|
-
return ['--dev', DEVICE, '--password', PASSWD]
|
|
20
|
+
CLIENT = None
|
|
21
|
+
TIMEOUT_SEC = 5
|
|
24
22
|
|
|
23
|
+
# COLLECT AND SAVE SYSTEM TEST METRICS
|
|
24
|
+
ENABLE_DATA_COLLECTION = os.environ.get("ENABLE_DATA_COLLECTION", False)
|
|
25
|
+
REPORT_DICT = {}
|
|
26
|
+
METRICS = {}
|
|
25
27
|
|
|
26
|
-
|
|
27
|
-
|
|
28
|
-
|
|
28
|
+
#####################################
|
|
29
|
+
# METRICS #
|
|
30
|
+
#####################################
|
|
31
|
+
def load_reports():
|
|
32
|
+
global REPORT_DICT
|
|
33
|
+
previous_reports = {}
|
|
34
|
+
try:
|
|
35
|
+
with open(REPORT_OUTPUT_PATH, 'r') as f:
|
|
36
|
+
previous_reports = json.loads(f.read())
|
|
37
|
+
except FileNotFoundError:
|
|
38
|
+
pass
|
|
39
|
+
finally:
|
|
40
|
+
REPORT_DICT = previous_reports
|
|
41
|
+
|
|
42
|
+
def create_report(device_name:str, metrics:dict) -> None:
|
|
43
|
+
global REPORT_DICT
|
|
44
|
+
|
|
45
|
+
if not ENABLE_DATA_COLLECTION:
|
|
46
|
+
print(f"[SKIP] system test metrics export, ENABLE_DATA_COLLECTION={ENABLE_DATA_COLLECTION}")
|
|
47
|
+
pprint(metrics)
|
|
48
|
+
return
|
|
49
|
+
load_reports()
|
|
50
|
+
version = metrics.get('version')
|
|
51
|
+
device_type = metrics.get('board_type')
|
|
52
|
+
device_type = '???' if device_type is None else device_type.split()[-1]
|
|
53
|
+
if REPORT_DICT.get(version) is None:
|
|
54
|
+
REPORT_DICT[version] = {}
|
|
55
|
+
if REPORT_DICT.get(version).get(device_type) is None:
|
|
56
|
+
REPORT_DICT[version][device_type] = {}
|
|
57
|
+
REPORT_DICT[version][device_type][device_name] = metrics
|
|
58
|
+
# Cleanup - remove redundant elements
|
|
59
|
+
REPORT_DICT[version][device_type][device_name].pop("board_type", None)
|
|
60
|
+
REPORT_DICT[version][device_type][device_name].pop("version", None)
|
|
61
|
+
# Dump report
|
|
62
|
+
print(f"Save system test report: {REPORT_OUTPUT_PATH}")
|
|
63
|
+
pprint(metrics)
|
|
64
|
+
with open(REPORT_OUTPUT_PATH, 'w') as f:
|
|
65
|
+
f.write(json.dumps(REPORT_DICT, indent=4))
|
|
66
|
+
|
|
67
|
+
|
|
68
|
+
def _add_metrics(key:str, value):
|
|
69
|
+
global METRICS
|
|
70
|
+
METRICS[key] = value
|
|
71
|
+
|
|
72
|
+
#####################################
|
|
73
|
+
# TESTS #
|
|
74
|
+
#####################################
|
|
29
75
|
|
|
30
76
|
def single_cmd_exec_check():
|
|
31
77
|
info = "[ST] Run single command execution check [hello]"
|
|
32
78
|
print(info)
|
|
33
79
|
cmd_list = ['hello']
|
|
34
|
-
output = execute(cmd_list)
|
|
80
|
+
output = CLIENT.execute(cmd_list)
|
|
35
81
|
if output[0]:
|
|
36
82
|
if output[1].startswith("hello:"):
|
|
37
83
|
return True, info
|
|
38
84
|
return False, info
|
|
39
85
|
|
|
86
|
+
def shell_cmds_check():
|
|
87
|
+
info = "[ST] Run built-in shell commands [modules|version|help]"
|
|
88
|
+
print(info)
|
|
89
|
+
cmd_list = ['modules']
|
|
90
|
+
output = CLIENT.execute(cmd_list)
|
|
91
|
+
if output[0]:
|
|
92
|
+
_add_metrics("modules", ast.literal_eval(output[1]))
|
|
93
|
+
if not (output[1].startswith("[") and output[1].endswith("]")):
|
|
94
|
+
return False, f"{info}modules: {output[1]}"
|
|
95
|
+
cmd_list = ['version']
|
|
96
|
+
output = CLIENT.execute(cmd_list)
|
|
97
|
+
if output[0]:
|
|
98
|
+
if not ('.' in output[1] and '-' in output[1]):
|
|
99
|
+
return False, f"{info}version: {output[1]}"
|
|
100
|
+
cmd_list = ['help']
|
|
101
|
+
output = CLIENT.execute(cmd_list)
|
|
102
|
+
if output[0]:
|
|
103
|
+
if not ('[MICROS]' in output[1] and '[CONF]' in output[1] and '[TASK]' in output[1] and '[EXEC]' in output[1]):
|
|
104
|
+
return False, f"{info}help: {output[1]}"
|
|
105
|
+
return True, info
|
|
106
|
+
|
|
40
107
|
|
|
41
108
|
def lm_cmd_exec_check():
|
|
42
109
|
info = "[ST] Run Load Module command execution check [system heartbeat]"
|
|
43
110
|
print(info)
|
|
44
111
|
cmd_list = ['system heartbeat']
|
|
45
|
-
output = execute(cmd_list)
|
|
112
|
+
output = CLIENT.execute(cmd_list)
|
|
46
113
|
if output[0]:
|
|
47
114
|
if output[1].strip() == '<3 heartbeat <3':
|
|
48
115
|
return True, info
|
|
@@ -53,7 +120,7 @@ def micrOS_config_get():
|
|
|
53
120
|
info = "[ST] Run micrOS config get [conf -> socport]"
|
|
54
121
|
print(info)
|
|
55
122
|
cmd_list = ['config <a> socport']
|
|
56
|
-
output = execute(cmd_list)
|
|
123
|
+
output = CLIENT.execute(cmd_list)
|
|
57
124
|
if output[0]:
|
|
58
125
|
if output[1].strip() == '9008':
|
|
59
126
|
return True, info
|
|
@@ -67,7 +134,7 @@ def micrOS_config_set():
|
|
|
67
134
|
|
|
68
135
|
# [1] Get actual utc value
|
|
69
136
|
cmd_list = ['config <a> utc']
|
|
70
|
-
output = execute(cmd_list)
|
|
137
|
+
output = CLIENT.execute(cmd_list)
|
|
71
138
|
if output[0]:
|
|
72
139
|
try:
|
|
73
140
|
utc_bak = int(output[1].strip())
|
|
@@ -77,21 +144,21 @@ def micrOS_config_set():
|
|
|
77
144
|
# [2] Set x+1 value as expected
|
|
78
145
|
utc_expected = utc_bak+1
|
|
79
146
|
cmd_list = ['config <a> utc {}'.format(utc_expected)]
|
|
80
|
-
output = execute(cmd_list)
|
|
147
|
+
output = CLIENT.execute(cmd_list)
|
|
81
148
|
if output[0]:
|
|
82
149
|
if output[1].strip() != 'Saved':
|
|
83
150
|
return False, f"{info} + utc overwrite issue: {output[1]}"
|
|
84
151
|
|
|
85
152
|
# [3] Get modified utc value - veridy [2] step
|
|
86
153
|
cmd_list = ['config <a> utc']
|
|
87
|
-
output = execute(cmd_list)
|
|
154
|
+
output = CLIENT.execute(cmd_list)
|
|
88
155
|
if output[0]:
|
|
89
156
|
if int(output[1].strip()) != utc_expected:
|
|
90
157
|
return False, f"{info} + utc modified value error: {output[1]} != {utc_expected}"
|
|
91
158
|
|
|
92
159
|
# Restore original value
|
|
93
160
|
cmd_list = ['config <a> utc {}'.format(utc_bak)]
|
|
94
|
-
output = execute(cmd_list)
|
|
161
|
+
output = CLIENT.execute(cmd_list)
|
|
95
162
|
if output[0]:
|
|
96
163
|
if output[1].strip() != 'Saved':
|
|
97
164
|
return False, f"{info} + utc overwrite issue: {output[1]}"
|
|
@@ -101,67 +168,51 @@ def micrOS_config_set():
|
|
|
101
168
|
|
|
102
169
|
|
|
103
170
|
def micrOS_bgjob_one_shot_check():
|
|
104
|
-
info = "[ST] Run
|
|
171
|
+
info = "[ST] Run async microTask check [system clock &]"
|
|
105
172
|
print(info)
|
|
106
|
-
|
|
107
173
|
# Initial task cleanup...
|
|
108
|
-
execute(['task kill system.clock'])
|
|
109
|
-
|
|
110
|
-
|
|
111
|
-
output = execute(
|
|
174
|
+
CLIENT.execute(['task kill system.clock'])
|
|
175
|
+
time.sleep(1)
|
|
176
|
+
cmd_list = ['system clock &']
|
|
177
|
+
output = CLIENT.execute(cmd_list)
|
|
112
178
|
if output[0]:
|
|
113
|
-
|
|
114
|
-
|
|
115
|
-
|
|
116
|
-
|
|
117
|
-
|
|
118
|
-
for _ in range(0, 2):
|
|
119
|
-
cmd_list = ['system clock &']
|
|
120
|
-
output = execute(cmd_list)
|
|
121
|
-
time.sleep(1)
|
|
122
|
-
if output[0]:
|
|
123
|
-
if 'Start system.clock' not in output[1].strip():
|
|
124
|
-
return False, f'{info} + not expected return: {output[1]}'
|
|
125
|
-
return True, info
|
|
179
|
+
# Legacy return OR New dict return
|
|
180
|
+
if 'Start system.clock' in output[1].strip() or "{'system.clock': 'Starting'}" in output[1].strip():
|
|
181
|
+
return True, info
|
|
182
|
+
return False, f'{info} + not expected return: {output[1]}'
|
|
126
183
|
|
|
127
184
|
|
|
128
185
|
def micrOS_bgjob_loop_check():
|
|
129
|
-
info = "[ST] Run
|
|
186
|
+
info = "[ST] Run async microTask check [system clock &&] + task kill"
|
|
130
187
|
print(info)
|
|
131
188
|
|
|
132
|
-
async_available_cmd_list = ['help']
|
|
133
|
-
output = execute(async_available_cmd_list)
|
|
134
|
-
if output[0]:
|
|
135
|
-
if "[TASK]" not in output[1]:
|
|
136
|
-
return False, f'[ASYNC] task function not available: {output[1]}'
|
|
137
|
-
else:
|
|
138
|
-
return False, f'[ASYNC] check: help cmd return error.'
|
|
139
|
-
|
|
140
189
|
# Start background task loop
|
|
141
190
|
cmd_list = ['system clock &&']
|
|
142
|
-
output = execute(cmd_list)
|
|
191
|
+
output = CLIENT.execute(cmd_list)
|
|
143
192
|
if output[0]:
|
|
144
|
-
|
|
193
|
+
# Legacy return OR New dict return
|
|
194
|
+
if not ('Start system.clock' in output[1].strip() or "{'system.clock': 'Starting'}" in output[1]):
|
|
145
195
|
return False, f'[Start Task error] {info} + not expected return: {output[1]}'
|
|
146
196
|
|
|
147
197
|
# Attempt to overload background thread
|
|
148
198
|
cmd_list = ['system clock &&']
|
|
149
|
-
output = execute(cmd_list)
|
|
199
|
+
output = CLIENT.execute(cmd_list)
|
|
150
200
|
if output[0]:
|
|
151
|
-
|
|
201
|
+
# Legacy return OR New dict return
|
|
202
|
+
if not ('system.clock is Busy' in output[1].strip() or "{'system.clock': 'Already running'}" in output[1]):
|
|
152
203
|
return False, f'[Overload task - run same] {info} + not expected return: {output[1]}'
|
|
153
204
|
|
|
154
205
|
# Show task output by task tag
|
|
155
206
|
time.sleep(0.1) # Give time for the task to start and update buffer... (sim)
|
|
156
207
|
cmd_list = ['task show system.clock']
|
|
157
|
-
output = execute(cmd_list)
|
|
208
|
+
output = CLIENT.execute(cmd_list)
|
|
158
209
|
if output[0]:
|
|
159
210
|
if "No task found" in output[1].strip() or len(output[1].strip()) == 0:
|
|
160
211
|
return False, f'[No task output] {info} + not expected return: {output[1]}'
|
|
161
212
|
|
|
162
213
|
# Stop BgJob
|
|
163
214
|
cmd_list = ['task kill system.clock']
|
|
164
|
-
output = execute(cmd_list)
|
|
215
|
+
output = CLIENT.execute(cmd_list)
|
|
165
216
|
if output[0]:
|
|
166
217
|
if 'Kill:' in output[1].strip() or 'system.clock' in output[1].strip():
|
|
167
218
|
return True, f'[Stop task] {info}'
|
|
@@ -169,12 +220,13 @@ def micrOS_bgjob_loop_check():
|
|
|
169
220
|
# Failed verdict
|
|
170
221
|
return False, f'[Thread not stopped]{info} + not expected return: {output[1]}'
|
|
171
222
|
|
|
223
|
+
|
|
172
224
|
def micrOS_task_list_check():
|
|
173
225
|
info = "[ST] Run micrOS Task list feature check [task list][task list >json]"
|
|
174
226
|
print(info)
|
|
175
227
|
|
|
176
228
|
async_available_cmd_list = ['task list']
|
|
177
|
-
output = execute(async_available_cmd_list)
|
|
229
|
+
output = CLIENT.execute(async_available_cmd_list)
|
|
178
230
|
if output[0]:
|
|
179
231
|
if "---- micrOS top ----" not in output[1]:
|
|
180
232
|
return False, f"{info} - ERROR: missing response prefix {output[1]}"
|
|
@@ -182,7 +234,7 @@ def micrOS_task_list_check():
|
|
|
182
234
|
return False, f"{info} - task list error: {output[1]}"
|
|
183
235
|
|
|
184
236
|
async_available_cmd_list = ['task list >json']
|
|
185
|
-
output = execute(async_available_cmd_list)
|
|
237
|
+
output = CLIENT.execute(async_available_cmd_list)
|
|
186
238
|
if output[0]:
|
|
187
239
|
starts = '{'
|
|
188
240
|
ends = '}'
|
|
@@ -192,14 +244,16 @@ def micrOS_task_list_check():
|
|
|
192
244
|
print(f"{info} - task list >json error: {output[1]}")
|
|
193
245
|
return True, info
|
|
194
246
|
|
|
247
|
+
|
|
195
248
|
def micrOS_get_version():
|
|
196
249
|
info = "[ST] Run micrOS get version [version]"
|
|
197
250
|
print(info)
|
|
198
251
|
cmd_list = ['version']
|
|
199
|
-
output = execute(cmd_list)
|
|
252
|
+
output = CLIENT.execute(cmd_list)
|
|
200
253
|
if output[0]:
|
|
201
254
|
if '.' in output[1].strip() and '-' in output[1].strip():
|
|
202
255
|
return True, f"{info} v:{output[1].strip()}"
|
|
256
|
+
_add_metrics('version', output[1])
|
|
203
257
|
return False, f"{info} out: {output[1]}"
|
|
204
258
|
|
|
205
259
|
|
|
@@ -207,7 +261,7 @@ def json_format_check():
|
|
|
207
261
|
info = "[ST] Run micrOS raw output check aka >json [system rssi >json]"
|
|
208
262
|
print(info)
|
|
209
263
|
cmd_list = ['system rssi >json']
|
|
210
|
-
output = execute(cmd_list)
|
|
264
|
+
output = CLIENT.execute(cmd_list)
|
|
211
265
|
if output[0] and output[1].startswith("{") and output[1].endswith("}"):
|
|
212
266
|
return True, info + f" out: {output[1]}"
|
|
213
267
|
return False, info + f" out: {output[1]}"
|
|
@@ -218,25 +272,25 @@ def negative_interface_check():
|
|
|
218
272
|
print(info)
|
|
219
273
|
|
|
220
274
|
cmd_list = ['Apple']
|
|
221
|
-
output = execute(cmd_list)
|
|
275
|
+
output = CLIENT.execute(cmd_list)
|
|
222
276
|
if output[0]:
|
|
223
277
|
if 'Shell: for hints type help.' not in output[1].strip():
|
|
224
278
|
return False, f'[Wrong single command] {info} + not expected return: {output[1]}'
|
|
225
279
|
|
|
226
280
|
cmd_list = ['Apple test']
|
|
227
|
-
output = execute(cmd_list)
|
|
281
|
+
output = CLIENT.execute(cmd_list)
|
|
228
282
|
if output[0]:
|
|
229
283
|
if 'no module named' not in output[1].strip().lower():
|
|
230
284
|
return False, f'[Missing module] {info} + not expected return: {output[1]}'
|
|
231
285
|
|
|
232
286
|
cmd_list = ['conf', 'gmttimaaaa']
|
|
233
|
-
output = execute(cmd_list)
|
|
287
|
+
output = CLIENT.execute(cmd_list)
|
|
234
288
|
if output[0]:
|
|
235
289
|
if output[1].strip() != 'None':
|
|
236
290
|
return False, f'[Config invalid key] {info} + not expected return: {output[1]}'
|
|
237
291
|
|
|
238
292
|
cmd_list = ['conf', 'utc "type"']
|
|
239
|
-
output = execute(cmd_list)
|
|
293
|
+
output = CLIENT.execute(cmd_list)
|
|
240
294
|
if output[0]:
|
|
241
295
|
if output[1].strip() != 'Failed to save':
|
|
242
296
|
return False, f'[Config invalid key type] {info} + not expected return: {output[1]}'
|
|
@@ -260,11 +314,12 @@ def measure_package_response_time():
|
|
|
260
314
|
# Start time
|
|
261
315
|
start = time.time()
|
|
262
316
|
# Command exec
|
|
263
|
-
output = execute(cmd_list)
|
|
317
|
+
output = CLIENT.execute(cmd_list)
|
|
264
318
|
# Stop time
|
|
265
319
|
end = time.time() - start
|
|
266
320
|
# Get average response time
|
|
267
321
|
delta_cmd_rep_time = round(end/10, 4)
|
|
322
|
+
_add_metrics('shell_heartbeatX10_response_ms', int(delta_cmd_rep_time*1000))
|
|
268
323
|
# Create verdict
|
|
269
324
|
print(output)
|
|
270
325
|
if output[0] and "<3 heartbeat <3" in output[1]:
|
|
@@ -276,7 +331,7 @@ def micros_alarm_check():
|
|
|
276
331
|
info = "[ST] Test alarm state - system alarms should be null"
|
|
277
332
|
print(info)
|
|
278
333
|
cmd_list = ['system alarms']
|
|
279
|
-
output = execute(cmd_list)
|
|
334
|
+
output = CLIENT.execute(cmd_list)
|
|
280
335
|
alarm_cnt = 0
|
|
281
336
|
if output[0]:
|
|
282
337
|
try:
|
|
@@ -287,7 +342,7 @@ def micros_alarm_check():
|
|
|
287
342
|
print(e)
|
|
288
343
|
# Clean alarms
|
|
289
344
|
cmd_list = ['system alarms True']
|
|
290
|
-
execute(cmd_list)
|
|
345
|
+
CLIENT.execute(cmd_list)
|
|
291
346
|
# Evaluation
|
|
292
347
|
if alarm_cnt > 0:
|
|
293
348
|
return True, info + f" -1 !!!WARN!!! [{alarm_cnt}] out: {output[1]}"
|
|
@@ -295,11 +350,11 @@ def micros_alarm_check():
|
|
|
295
350
|
|
|
296
351
|
|
|
297
352
|
def oled_msg_end_result(result):
|
|
298
|
-
cmd_list = ['
|
|
299
|
-
output = execute(cmd_list)
|
|
353
|
+
cmd_list = ['pacman moduls >json']
|
|
354
|
+
output = CLIENT.execute(cmd_list)
|
|
300
355
|
if output[0] and 'LM_oled_ui' in output[1]:
|
|
301
356
|
cmd_list = [f'oled_ui msgbox "{result} %"']
|
|
302
|
-
print(execute(cmd_list))
|
|
357
|
+
print(CLIENT.execute(cmd_list))
|
|
303
358
|
|
|
304
359
|
|
|
305
360
|
def check_device_by_hostname(dev):
|
|
@@ -320,7 +375,7 @@ def check_robustness_exception():
|
|
|
320
375
|
info_msg = '[ST] Check robustness - exception [robustness raise_error]'
|
|
321
376
|
print(info_msg)
|
|
322
377
|
cmd_list = ['robustness raise_error']
|
|
323
|
-
output = execute(cmd_list)
|
|
378
|
+
output = CLIENT.execute(cmd_list)
|
|
324
379
|
if output[0] and "Core error: LM_robustness->raise_error: Test exception" in output[1]:
|
|
325
380
|
return True, f'{info_msg}: Valid error msg: exec_lm_core *->raise_error: *'
|
|
326
381
|
else:
|
|
@@ -331,7 +386,7 @@ def check_robustness_memory():
|
|
|
331
386
|
info_msg = '[ST] Check robustness - memory_leak [robustness memory_leak 12]'
|
|
332
387
|
print(info_msg)
|
|
333
388
|
cmd_list = ['robustness memory_leak 12']
|
|
334
|
-
output = execute(cmd_list)
|
|
389
|
+
output = CLIENT.execute(cmd_list)
|
|
335
390
|
if output[0] and "[12] RAM Alloc" in output[1]:
|
|
336
391
|
end_result = output[1].split("\n")[-1]
|
|
337
392
|
return True, f'{info_msg}: Mem alloc: {end_result}'
|
|
@@ -343,7 +398,7 @@ def check_robustness_recursion():
|
|
|
343
398
|
info_msg = '[ST] Check robustness - recursion [robustness recursion_limit 8]'
|
|
344
399
|
print(info_msg)
|
|
345
400
|
cmd_list = ['robustness recursion_limit 8']
|
|
346
|
-
output = execute(cmd_list, tout=10)
|
|
401
|
+
output = CLIENT.execute(cmd_list, tout=10)
|
|
347
402
|
if output[0]:
|
|
348
403
|
last_line = output[1].split("\n")[-1]
|
|
349
404
|
if "Recursion limit:" in last_line:
|
|
@@ -355,9 +410,14 @@ def check_robustness_recursion():
|
|
|
355
410
|
def check_intercon(host=None):
|
|
356
411
|
def _convert_return_to_dict(data):
|
|
357
412
|
try:
|
|
358
|
-
data_dict = ast.literal_eval(data[1])
|
|
413
|
+
data_dict = ast.literal_eval(data[1].split("\n")[0])
|
|
359
414
|
except Exception as e:
|
|
415
|
+
print(f"WARNING: cannot parse output as dir: {e}")
|
|
360
416
|
data_dict = {'tag': None, 'verdict': f'{data}: {str(e)}'}
|
|
417
|
+
# Handle new syntax: {"taskID": "verdict"}
|
|
418
|
+
if data[0] and data_dict.get("tag") is None:
|
|
419
|
+
_ttag = list(data_dict.keys())[0]
|
|
420
|
+
data_dict = {'tag': _ttag, 'verdict': f'{list(data_dict.values())[0]}: task show {_ttag}'}
|
|
361
421
|
return data[0], data_dict
|
|
362
422
|
|
|
363
423
|
def _get_intercon_output(tag):
|
|
@@ -366,23 +426,29 @@ def check_intercon(host=None):
|
|
|
366
426
|
_output = None
|
|
367
427
|
for _ in range(0, 2):
|
|
368
428
|
time.sleep(1)
|
|
369
|
-
_output = execute(_cmd_list, tout=8)
|
|
429
|
+
_output = CLIENT.execute(_cmd_list, tout=8)
|
|
370
430
|
if _output[0] and 'No task found:' not in _output[1]:
|
|
371
431
|
_state = True
|
|
372
432
|
break
|
|
373
433
|
return _state, _output
|
|
374
434
|
|
|
435
|
+
def run_intercon_hello(tout=8):
|
|
436
|
+
nonlocal host
|
|
437
|
+
cmd_list = [f'hello >>{host}']
|
|
438
|
+
_output = CLIENT.execute(cmd_list, tout=tout)
|
|
439
|
+
return _output
|
|
440
|
+
|
|
375
441
|
info_msg = '[ST] Check device-device connectivity'
|
|
376
442
|
print(info_msg)
|
|
377
443
|
host = 'test.local' if host is None else host
|
|
378
|
-
|
|
379
|
-
output = execute(cmd_list, tout=8)
|
|
444
|
+
output = run_intercon_hello(tout=8)
|
|
380
445
|
output = _convert_return_to_dict(output)
|
|
446
|
+
|
|
381
447
|
device_was_found = False
|
|
382
448
|
if output[0] is False or output[1] is None:
|
|
383
449
|
output = 'Device was not found: {}:{}'.format(host, output)
|
|
384
450
|
return False, output
|
|
385
|
-
|
|
451
|
+
if output[1] == '[]':
|
|
386
452
|
# Valid input, device was not found
|
|
387
453
|
output = 'Device was not found: {}:{}'.format(host, output)
|
|
388
454
|
state = True, f'{info_msg}:\n\t\t{output}'
|
|
@@ -390,30 +456,37 @@ def check_intercon(host=None):
|
|
|
390
456
|
response_state, response = _get_intercon_output(output[1]['tag'])
|
|
391
457
|
# Valid input on online device
|
|
392
458
|
output = "Device was found: {}:{}".format(host, f"{output}: {response}")
|
|
393
|
-
state =
|
|
459
|
+
state = response_state, f'{info_msg}:\n\t\t{output}'
|
|
394
460
|
device_was_found = True
|
|
395
461
|
else:
|
|
396
|
-
state = False, output
|
|
462
|
+
state = False, f" InterCon Failed: {output}"
|
|
397
463
|
|
|
398
464
|
if device_was_found:
|
|
399
465
|
# DO Negative testing as well
|
|
400
|
-
|
|
401
|
-
output_neg =
|
|
466
|
+
host = "notavailable.local"
|
|
467
|
+
output_neg = run_intercon_hello(tout=20)
|
|
468
|
+
if output_neg[0] and output_neg[1] == '':
|
|
469
|
+
# NO HOST TIMEOUT ...
|
|
470
|
+
output_neg = f'Device was not found (dhcp timeout): {host}:{output_neg}: {output_neg[1]}'
|
|
471
|
+
return True & state[0], f"{state[1]}\n\t\tNegative test: {output_neg}"
|
|
472
|
+
# Valid return on negative testing
|
|
402
473
|
output_neg = _convert_return_to_dict(output_neg)
|
|
403
|
-
state_neg = False, output_neg
|
|
474
|
+
state_neg = False, f"Negative test failed: {output_neg}"
|
|
404
475
|
if len(output_neg[1]) > 1 and "hello" in output_neg[1]['verdict']:
|
|
405
476
|
response_state, response = _get_intercon_output(output_neg[1]['tag'])
|
|
406
|
-
output_neg = f'Device was not found: "
|
|
407
|
-
state_neg =
|
|
408
|
-
return state[0] & state_neg[0], "{}\n\t\tNegative test: {
|
|
477
|
+
output_neg = f'Device was not found: {host}":{output_neg}: {response}'
|
|
478
|
+
state_neg = response_state, output_neg
|
|
479
|
+
return state[0] & state_neg[0], f"{state[1]}\n\t\tNegative test: {state_neg[1]}"
|
|
409
480
|
return state
|
|
410
481
|
|
|
411
482
|
|
|
412
483
|
def measure_conn_metrics():
|
|
413
484
|
try:
|
|
414
|
-
verdict =
|
|
485
|
+
verdict, delta_t_single, delta_t_multi = CLIENT.connection_metrics()
|
|
486
|
+
_add_metrics("shell_single_session_dt_ms", int(delta_t_single*1000))
|
|
487
|
+
_add_metrics("shell_multi_session_dt_ms", int(delta_t_multi*1000))
|
|
415
488
|
for k in verdict:
|
|
416
|
-
print("\t\t{}"
|
|
489
|
+
print(f"\t\t{k}")
|
|
417
490
|
state = True if len(verdict) > 0 else False
|
|
418
491
|
except Exception as e:
|
|
419
492
|
state = False
|
|
@@ -423,7 +496,7 @@ def measure_conn_metrics():
|
|
|
423
496
|
|
|
424
497
|
def memory_usage():
|
|
425
498
|
cmd = ['system memory_usage >json']
|
|
426
|
-
out = execute(cmd, tout=
|
|
499
|
+
out = CLIENT.execute(cmd, tout=TIMEOUT_SEC)
|
|
427
500
|
state, raw_output = out[0], out[1]
|
|
428
501
|
try:
|
|
429
502
|
json_out = json.loads(raw_output)
|
|
@@ -431,7 +504,9 @@ def memory_usage():
|
|
|
431
504
|
return False, '[ST] {}ERR{}: {}: {}'.format(Colors.ERR, Colors.NC, raw_output, e)
|
|
432
505
|
|
|
433
506
|
# {"percent": 93.11, "mem_used": 103504}
|
|
434
|
-
|
|
507
|
+
_add_metrics('mem_percent', json_out.get('percent'))
|
|
508
|
+
_add_metrics('mem_used_byte', json_out.get('mem_used'))
|
|
509
|
+
if json_out.get('percent') > 70: # MEM USAGE WARNING INDICATOR: 80%
|
|
435
510
|
return state, '[ST] {}WARNING{}: memory usage {}% ({} bytes)'.format(Colors.WARN, Colors.NC,
|
|
436
511
|
json_out.get('percent'),
|
|
437
512
|
json_out.get('mem_used'))
|
|
@@ -444,7 +519,7 @@ def disk_usage():
|
|
|
444
519
|
Check disk usage - manually defined 16% (336_000 byte) - check degradations...
|
|
445
520
|
"""
|
|
446
521
|
cmd = ['system disk_usage >json']
|
|
447
|
-
out = execute(cmd, tout=
|
|
522
|
+
out = CLIENT.execute(cmd, tout=TIMEOUT_SEC)
|
|
448
523
|
state, raw_output = out[0], out[1]
|
|
449
524
|
try:
|
|
450
525
|
json_out = json.loads(raw_output)
|
|
@@ -452,7 +527,9 @@ def disk_usage():
|
|
|
452
527
|
return False, '[ST] {}ERR{}: {}: {}'.format(Colors.ERR, Colors.NC, raw_output, e)
|
|
453
528
|
|
|
454
529
|
# {"percent": 15.4, "fs_used": 323_584}
|
|
455
|
-
|
|
530
|
+
_add_metrics('fs_percent', json_out.get('percent'))
|
|
531
|
+
_add_metrics('fs_used_byte', json_out.get('fs_used'))
|
|
532
|
+
if json_out.get('fs_used') > 800_000: # MEM USAGE WARNING INDICATOR: (800kb)
|
|
456
533
|
return state, '[ST] {}WARNING{}: disk usage {}% ({} bytes)'.format(Colors.WARN, Colors.NC,
|
|
457
534
|
json_out.get('percent'),
|
|
458
535
|
json_out.get('fs_used'))
|
|
@@ -462,7 +539,7 @@ def disk_usage():
|
|
|
462
539
|
|
|
463
540
|
def task_list():
|
|
464
541
|
cmd = ['task list']
|
|
465
|
-
out = execute(cmd, tout=
|
|
542
|
+
out = CLIENT.execute(cmd, tout=TIMEOUT_SEC)
|
|
466
543
|
state, output = out[0], out[1]
|
|
467
544
|
if state:
|
|
468
545
|
return state, output.replace('\n', f'\n{" "*51}') # TODO format output
|
|
@@ -472,40 +549,51 @@ def task_list():
|
|
|
472
549
|
def webcli_test():
|
|
473
550
|
endpoints = []
|
|
474
551
|
cmd = ['conf', 'webui']
|
|
475
|
-
out = execute(cmd, tout=
|
|
552
|
+
out = CLIENT.execute(cmd, tout=TIMEOUT_SEC)
|
|
476
553
|
state, output = out[0], out[1]
|
|
477
554
|
if state:
|
|
478
555
|
verdict = f"[ST] WEBUI IS ENABLED ({output})" if output.strip() == 'True' else f"[ST] WEBUI IS DISABLED ({output})"
|
|
479
556
|
if output.strip() == 'True':
|
|
480
|
-
out = execute(['conf', 'devip'], tout=
|
|
557
|
+
out = CLIENT.execute(['conf', 'devip'], tout=TIMEOUT_SEC)
|
|
481
558
|
if out[0] and out[1] is not None:
|
|
482
559
|
devip = out[1]
|
|
483
|
-
endpoints.append(f'http://{devip}')
|
|
484
560
|
endpoints.append(f'http://{devip}/rest')
|
|
561
|
+
endpoints.append(f'http://{devip}')
|
|
485
562
|
|
|
486
563
|
for endpoint in endpoints:
|
|
487
564
|
_start_t = time.time()
|
|
565
|
+
delta_t = -1
|
|
488
566
|
try:
|
|
489
567
|
response = requests.get(endpoint, timeout=5)
|
|
568
|
+
delta_t = round(time.time() - _start_t, 2)
|
|
490
569
|
# Check if the request was successful
|
|
491
570
|
if not (response.status_code == 200 and ('<!DOCTYPE html>' in str(response.content) or '"micrOS"' in str(response.content))):
|
|
492
|
-
|
|
493
|
-
|
|
494
|
-
|
|
571
|
+
if response.status_code == 400 and "Low memory" in str(response.content):
|
|
572
|
+
verdict += f" Endpoint: {endpoint} - Low memory mode [{Colors.WARN}OK{Colors.NC}]({delta_t}s)"
|
|
573
|
+
print(response.content)
|
|
574
|
+
else:
|
|
575
|
+
verdict += f" Endpoint: {endpoint} [{Colors.ERR}NOK{Colors.NC}]({delta_t}s)"
|
|
576
|
+
print(response.content)
|
|
577
|
+
state = False
|
|
495
578
|
else:
|
|
496
|
-
verdict += f" Endpoint: {endpoint} [{Colors.OK}OK{Colors.NC}]({
|
|
579
|
+
verdict += f" Endpoint: {endpoint} [{Colors.OK}OK{Colors.NC}]({delta_t}s)"
|
|
580
|
+
metrics_name = 'landingpage' if "." in endpoint.split('/')[-1] else endpoint.split('/')[-1]
|
|
581
|
+
_add_metrics(f"web_{metrics_name}_response_ms", int(delta_t*1000))
|
|
497
582
|
except Exception as e:
|
|
498
|
-
verdict += f" Endpoint: {endpoint} [{Colors.ERR}NOK{Colors.NC}]({
|
|
583
|
+
verdict += f" Endpoint: {endpoint} [{Colors.ERR}NOK{Colors.NC}]({delta_t}s)"
|
|
499
584
|
print(f"webcli_test error: {e}")
|
|
500
585
|
state = False
|
|
501
586
|
return state, verdict
|
|
502
587
|
return state, output
|
|
503
588
|
|
|
589
|
+
#####################################
|
|
590
|
+
# HELPERS #
|
|
591
|
+
#####################################
|
|
504
592
|
|
|
505
593
|
def after_st_reboot():
|
|
506
594
|
verdict = False, 'reboot -h failed'
|
|
507
595
|
cmd = ['reboot -h']
|
|
508
|
-
out = execute(cmd, tout=
|
|
596
|
+
out = CLIENT.execute(cmd, tout=TIMEOUT_SEC)
|
|
509
597
|
state, output = out[0], out[1]
|
|
510
598
|
if state:
|
|
511
599
|
verdict = state, f'[reboot-h] commad out: {output}'
|
|
@@ -513,7 +601,7 @@ def after_st_reboot():
|
|
|
513
601
|
print(f"[reboot-h] Wait for node up again ({retry}/{retry*2}sec)")
|
|
514
602
|
time.sleep(2)
|
|
515
603
|
try:
|
|
516
|
-
up, o = execute(['hello'], tout=
|
|
604
|
+
up, o = CLIENT.execute(['hello'], tout=TIMEOUT_SEC)
|
|
517
605
|
if up:
|
|
518
606
|
verdict = True, f"[reboot-h][OK] successfully rebooted: {o} (boot time: ~{retry * 2}sec)"
|
|
519
607
|
print(verdict[1])
|
|
@@ -526,21 +614,40 @@ def after_st_reboot():
|
|
|
526
614
|
|
|
527
615
|
def get_dev_version():
|
|
528
616
|
cmd = ['version']
|
|
529
|
-
out = execute(cmd, tout=
|
|
617
|
+
out = CLIENT.execute(cmd, tout=TIMEOUT_SEC)
|
|
530
618
|
state, output = out[0], out[1]
|
|
619
|
+
_add_metrics("version", output)
|
|
531
620
|
if state:
|
|
532
621
|
return output
|
|
533
622
|
return '0.0.0-0'
|
|
534
623
|
|
|
624
|
+
def get_dev_board_type():
|
|
625
|
+
cmd = ['system info >json']
|
|
626
|
+
out = CLIENT.execute(cmd, tout=TIMEOUT_SEC)
|
|
627
|
+
state, output = out[0], out[1]
|
|
628
|
+
output = ast.literal_eval(output)
|
|
629
|
+
board = output.get("board")
|
|
630
|
+
upython = output.get("upython")
|
|
631
|
+
_add_metrics("board_type", board)
|
|
632
|
+
_add_metrics("micropython_version", str(upython))
|
|
633
|
+
if state:
|
|
634
|
+
return board, upython
|
|
635
|
+
return None, None
|
|
636
|
+
|
|
637
|
+
#####################################
|
|
638
|
+
# MAIN APP #
|
|
639
|
+
#####################################
|
|
640
|
+
|
|
535
641
|
def app(devfid=None, pwd=None):
|
|
536
|
-
global
|
|
537
|
-
|
|
538
|
-
DEVICE = devfid
|
|
539
|
-
if pwd is not None:
|
|
540
|
-
PASSWD = pwd
|
|
642
|
+
global CLIENT
|
|
643
|
+
CLIENT = AppBase(device=devfid, password=pwd)
|
|
541
644
|
|
|
645
|
+
# Get device info
|
|
646
|
+
version = get_dev_version()
|
|
647
|
+
get_dev_board_type() # update metrics
|
|
542
648
|
# Get test verdict
|
|
543
649
|
verdict = {'single_cmds': single_cmd_exec_check(),
|
|
650
|
+
'shell_cmds': shell_cmds_check(),
|
|
544
651
|
'lm_cmd_exec': lm_cmd_exec_check(),
|
|
545
652
|
'config_get': micrOS_config_get(),
|
|
546
653
|
'config_set': micrOS_config_set(),
|
|
@@ -551,7 +658,7 @@ def app(devfid=None, pwd=None):
|
|
|
551
658
|
'json_check': json_format_check(),
|
|
552
659
|
'response_time': measure_package_response_time(),
|
|
553
660
|
'negative_api': negative_interface_check(),
|
|
554
|
-
'dhcp_hostname': check_device_by_hostname(
|
|
661
|
+
'dhcp_hostname': check_device_by_hostname(CLIENT.get_device()),
|
|
555
662
|
'lm_exception': check_robustness_exception(),
|
|
556
663
|
'mem_usage': memory_usage(),
|
|
557
664
|
'disk_usage': disk_usage(),
|
|
@@ -565,11 +672,12 @@ def app(devfid=None, pwd=None):
|
|
|
565
672
|
'clean-reboot': after_st_reboot()
|
|
566
673
|
}
|
|
567
674
|
|
|
675
|
+
|
|
568
676
|
# Test Evaluation
|
|
569
677
|
final_state = True
|
|
570
678
|
ok_cnt = 0
|
|
571
|
-
|
|
572
|
-
print(f"\n----------------------------------- micrOS System Test results on {
|
|
679
|
+
create_report(CLIENT.get_device(), METRICS)
|
|
680
|
+
print(f"\n----------------------------------- micrOS System Test results on {CLIENT.get_device()}:{version} device -----------------------------------")
|
|
573
681
|
print("\tTEST NAME\t\tSTATE\t\tDescription\n")
|
|
574
682
|
for test, state_data in verdict.items():
|
|
575
683
|
state = Colors.ERR + 'NOK' + Colors.NC
|
|
@@ -589,11 +697,5 @@ def app(devfid=None, pwd=None):
|
|
|
589
697
|
oled_msg_end_result(f"System[{state}] {pass_rate}")
|
|
590
698
|
|
|
591
699
|
|
|
592
|
-
def execute(cmd_list, tout=5):
|
|
593
|
-
cmd_args = base_cmd() + cmd_list
|
|
594
|
-
print("[ST] test cmd: {}".format(cmd_args))
|
|
595
|
-
return socketClient.run(cmd_args, timeout=tout)
|
|
596
|
-
|
|
597
|
-
|
|
598
700
|
if __name__ == "__main__":
|
|
599
701
|
app()
|