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.
- 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-20241129-v1.24.1.bin → 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 +167 -163
- micrOS/source/Auth.py +37 -0
- micrOS/source/Common.py +361 -116
- micrOS/source/Config.py +32 -22
- micrOS/source/Debug.py +50 -94
- micrOS/source/Espnow.py +377 -100
- micrOS/source/Files.py +207 -0
- micrOS/source/Hooks.py +48 -20
- micrOS/source/InterConnect.py +126 -42
- micrOS/source/Interrupts.py +6 -6
- micrOS/source/Logger.py +63 -26
- micrOS/source/Network.py +41 -21
- micrOS/source/Notify.py +48 -22
- micrOS/source/Pacman.py +326 -0
- micrOS/source/Scheduler.py +14 -54
- micrOS/source/Server.py +67 -69
- micrOS/source/Shell.py +99 -91
- micrOS/source/Tasks.py +141 -95
- micrOS/source/Time.py +19 -18
- micrOS/source/Types.py +53 -9
- micrOS/source/Web.py +381 -76
- 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/config/_git.keep +0 -0
- micrOS/source/helpers.py +132 -0
- micrOS/source/micrOS.py +17 -7
- micrOS/source/micrOSloader.py +5 -12
- micrOS/source/microIO.py +44 -20
- micrOS/source/modules/IO_esp32c6.py +38 -0
- micrOS/source/{IO_esp32s3.py → modules/IO_esp32s3.py} +37 -1
- micrOS/source/{IO_m5stamp.py → modules/IO_m5stamp.py} +35 -1
- micrOS/source/{IO_qtpy.py → modules/IO_qtpy.py} +22 -17
- micrOS/source/{IO_tinypico.py → modules/IO_tinypico.py} +38 -0
- micrOS/source/modules/LM_L298N.py +161 -0
- {toolkit/workspace/precompiled → micrOS/source/modules}/LM_L9110_DCmotor.py +3 -3
- micrOS/source/{LM_OV2640.py → modules/LM_OV2640.py} +45 -27
- micrOS/source/{LM_VL53L0X.py → modules/LM_VL53L0X.py} +3 -3
- micrOS/source/{LM_aht10.py → modules/LM_aht10.py} +2 -2
- micrOS/source/{LM_bme280.py → modules/LM_bme280.py} +3 -3
- micrOS/source/{LM_buzzer.py → modules/LM_buzzer.py} +18 -25
- micrOS/source/{LM_cct.py → modules/LM_cct.py} +17 -21
- micrOS/source/modules/LM_cluster.py +255 -0
- micrOS/source/{LM_co2.py → modules/LM_co2.py} +3 -3
- micrOS/source/{LM_dht11.py → modules/LM_dht11.py} +2 -2
- micrOS/source/{LM_dht22.py → modules/LM_dht22.py} +2 -2
- micrOS/source/{LM_dimmer.py → modules/LM_dimmer.py} +9 -9
- micrOS/source/{LM_distance.py → modules/LM_distance.py} +4 -6
- micrOS/source/{LM_ds18.py → modules/LM_ds18.py} +2 -2
- micrOS/source/{LM_esp32.py → modules/LM_esp32.py} +5 -0
- micrOS/source/modules/LM_espnow.py +53 -0
- micrOS/source/modules/LM_fileserver.py +265 -0
- micrOS/source/{LM_genIO.py → modules/LM_genIO.py} +52 -37
- micrOS/source/{LM_haptic.py → modules/LM_haptic.py} +2 -2
- {toolkit/workspace/precompiled → micrOS/source/modules}/LM_i2c.py +5 -4
- micrOS/source/{LM_i2s_mic.py → modules/LM_i2s_mic.py} +6 -7
- micrOS/source/{LM_ld2410.py → modules/LM_ld2410.py} +2 -2
- micrOS/source/{LM_light_sensor.py → modules/LM_light_sensor.py} +10 -21
- 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} +19 -23
- micrOS/source/{LM_oled.py → modules/LM_oled.py} +2 -2
- micrOS/source/{LM_oled_sh1106.py → modules/LM_oled_sh1106.py} +3 -3
- micrOS/source/{LM_oled_ui.py → modules/LM_oled_ui.py} +72 -64
- micrOS/source/modules/LM_pacman.py +320 -0
- micrOS/source/{LM_presence.py → modules/LM_presence.py} +11 -15
- micrOS/source/modules/LM_qmi8658.py +204 -0
- micrOS/source/{LM_rencoder.py → modules/LM_rencoder.py} +2 -2
- micrOS/source/{LM_rest.py → modules/LM_rest.py} +4 -6
- micrOS/source/{LM_rgb.py → modules/LM_rgb.py} +21 -29
- micrOS/source/{LM_roboarm.py → modules/LM_roboarm.py} +8 -8
- micrOS/source/modules/LM_robustness.py +137 -0
- micrOS/source/{LM_servo.py → modules/LM_servo.py} +3 -3
- micrOS/source/{LM_stepper.py → modules/LM_stepper.py} +5 -5
- micrOS/source/{LM_switch.py → modules/LM_switch.py} +11 -9
- micrOS/source/{LM_system.py → modules/LM_system.py} +38 -32
- micrOS/source/modules/LM_tcs3472.py +187 -0
- micrOS/source/{LM_telegram.py → modules/LM_telegram.py} +164 -116
- micrOS/source/{LM_trackball.py → modules/LM_trackball.py} +3 -3
- micrOS/source/{LM_veml7700.py → modules/LM_veml7700.py} +2 -2
- micrOS/source/modules/LM_web.py +38 -0
- micrOS/source/urequests.py +39 -15
- {toolkit/workspace/precompiled → micrOS/source/web}/dashboard.html +4 -0
- micrOS/source/web/editor.js +440 -0
- micrOS/source/web/filesui.html +178 -0
- micrOS/source/web/filesui.js +338 -0
- {toolkit/workspace/precompiled → micrOS/source/web}/index.html +44 -2
- micrOS/source/{uapi.js → web/uapi.js} +48 -7
- micrOS/source/{ustyle.css → web/ustyle.css} +6 -3
- micrOS/utests/__init__.py +0 -0
- micrOS/utests/test_scheduler.py +435 -0
- {micrOSDevToolKit-2.9.1.data → microsdevtoolkit-2.26.1.data}/scripts/devToolKit.py +33 -3
- {micrOSDevToolKit-2.9.1.dist-info → microsdevtoolkit-2.26.1.dist-info}/METADATA +327 -268
- microsdevtoolkit-2.26.1.dist-info/RECORD +396 -0
- {micrOSDevToolKit-2.9.1.dist-info → microsdevtoolkit-2.26.1.dist-info}/WHEEL +1 -1
- toolkit/DevEnvCompile.py +63 -33
- toolkit/DevEnvOTA.py +58 -22
- toolkit/DevEnvUSB.py +110 -55
- toolkit/Gateway.py +6 -6
- toolkit/LM_to_compile.dat +6 -4
- toolkit/MicrOSDevEnv.py +127 -57
- toolkit/WebRepl.py +73 -0
- toolkit/dashboard_apps/BackupRestore.py +20 -35
- 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 +1 -6
- 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 +202 -105
- toolkit/dashboard_apps/Template_app.py +11 -23
- 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 +4 -4
- 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 +6 -0
- toolkit/lib/micrOSClient.py +123 -50
- toolkit/lib/micrOSClientHistory.py +156 -0
- toolkit/lib/pip_package_installer.py +5 -2
- toolkit/micrOSdashboard.py +12 -17
- toolkit/micrOSlint.py +20 -8
- 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__/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/dht.py +1 -1
- toolkit/simulator_lib/framebuf.py +49 -1
- toolkit/simulator_lib/machine.py +17 -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 +137 -59
- toolkit/simulator_lib/uasyncio.py +33 -2
- toolkit/simulator_lib/uos.py +147 -0
- toolkit/simulator_lib/urandom.py +4 -0
- toolkit/socketClient.py +43 -23
- toolkit/user_data/webhooks/generic.py +1 -1
- toolkit/user_data/webhooks/macro.py +1 -1
- 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/{IO_esp32.mpy → modules/IO_esp32.mpy} +0 -0
- toolkit/workspace/precompiled/{IO_esp32c3.mpy → modules/IO_esp32c3.mpy} +0 -0
- toolkit/workspace/precompiled/modules/IO_esp32c6.mpy +0 -0
- toolkit/workspace/precompiled/{IO_esp32s2.mpy → 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 +3 -3
- toolkit/workspace/precompiled/modules/LM_OV2640.mpy +0 -0
- toolkit/workspace/precompiled/{LM_VL53L0X.py → modules/LM_VL53L0X.py} +3 -3
- toolkit/workspace/precompiled/{LM_aht10.mpy → modules/LM_aht10.mpy} +0 -0
- toolkit/workspace/precompiled/{LM_bme280.mpy → 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/{LM_co2.mpy → modules/LM_co2.mpy} +0 -0
- toolkit/workspace/precompiled/{LM_dht11.mpy → modules/LM_dht11.mpy} +0 -0
- toolkit/workspace/precompiled/{LM_dht22.mpy → 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/{LM_ds18.mpy → modules/LM_ds18.mpy} +0 -0
- toolkit/workspace/precompiled/{LM_esp32.py → modules/LM_esp32.py} +5 -0
- 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/{LM_haptic.mpy → modules/LM_haptic.mpy} +0 -0
- {micrOS/source → toolkit/workspace/precompiled/modules}/LM_i2c.py +5 -4
- 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/{LM_oled.mpy → modules/LM_oled.mpy} +0 -0
- toolkit/workspace/precompiled/{LM_oled_sh1106.mpy → 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} +2 -2
- 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_servo.mpy → modules/LM_servo.mpy} +0 -0
- toolkit/workspace/precompiled/{LM_sound_event.mpy → 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/{LM_trackball.mpy → modules/LM_trackball.mpy} +0 -0
- toolkit/workspace/precompiled/{LM_veml7700.mpy → 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 +4 -0
- toolkit/workspace/precompiled/web/editor.js +440 -0
- toolkit/workspace/precompiled/web/filesui.html +178 -0
- toolkit/workspace/precompiled/web/filesui.js +338 -0
- {micrOS/source → toolkit/workspace/precompiled/web}/index.html +44 -2
- toolkit/workspace/precompiled/{uapi.js → web/uapi.js} +48 -7
- toolkit/workspace/precompiled/{ustyle.css → web/ustyle.css} +6 -3
- micrOS/micropython/esp32-20241129-v1.24.1.bin +0 -0
- micrOS/micropython/esp32c3-20240222-v1.22.2.bin +0 -0
- micrOS/micropython/esp32s2-20240602-v1.23.0.bin +0 -0
- micrOS/micropython/esp32s2-LOLIN_MINI-20220618-v1.19.1.bin +0 -0
- micrOS/micropython/esp32s2-LOLIN_MINI-20240602-v1.23.0.bin +0 -0
- micrOS/micropython/esp32s3-20240105-v1.22.1.bin +0 -0
- micrOS/micropython/esp32s3_spiram_oct-20231005-v1.21.0.bin +0 -0
- micrOS/micropython/esp32s3_spiram_oct-20241129-v1.24.1.bin +0 -0
- micrOS/micropython/rpi-pico-w-20241129-v1.24.1.uf2 +0 -0
- micrOS/micropython/tinypico-20241129-v1.24.1.bin +0 -0
- micrOS/source/LM_L298N_DCmotor.py +0 -86
- micrOS/source/LM_catgame.py +0 -75
- micrOS/source/LM_dashboard_be.py +0 -37
- micrOS/source/LM_demo.py +0 -97
- micrOS/source/LM_espnow.py +0 -23
- micrOS/source/LM_intercon.py +0 -57
- micrOS/source/LM_keychain.py +0 -322
- micrOS/source/LM_lmpacman.py +0 -126
- micrOS/source/LM_neoeffects.py +0 -331
- micrOS/source/LM_oledui.py +0 -972
- micrOS/source/LM_pet_feeder.py +0 -78
- micrOS/source/LM_ph_sensor.py +0 -51
- micrOS/source/LM_robustness.py +0 -74
- micrOS/source/reset.py +0 -11
- micrOSDevToolKit-2.9.1.dist-info/RECORD +0 -365
- 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__/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_esp32s3.mpy +0 -0
- toolkit/workspace/precompiled/IO_m5stamp.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_catgame.py +0 -75
- toolkit/workspace/precompiled/LM_cct.mpy +0 -0
- toolkit/workspace/precompiled/LM_dashboard_be.py +0 -37
- toolkit/workspace/precompiled/LM_demo.py +0 -97
- toolkit/workspace/precompiled/LM_dimmer.mpy +0 -0
- toolkit/workspace/precompiled/LM_distance.mpy +0 -0
- toolkit/workspace/precompiled/LM_espnow.py +0 -23
- toolkit/workspace/precompiled/LM_genIO.mpy +0 -0
- 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_ui.mpy +0 -0
- toolkit/workspace/precompiled/LM_oledui.mpy +0 -0
- toolkit/workspace/precompiled/LM_pet_feeder.py +0 -78
- 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 -74
- 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/node_config.json +0 -1
- toolkit/workspace/precompiled/reset.mpy +0 -0
- /micrOS/source/{IO_esp32.py → modules/IO_esp32.py} +0 -0
- /micrOS/source/{IO_esp32c3.py → modules/IO_esp32c3.py} +0 -0
- /micrOS/source/{IO_esp32s2.py → modules/IO_esp32s2.py} +0 -0
- /micrOS/source/{IO_rp2.py → modules/IO_rp2.py} +0 -0
- /micrOS/source/{LM_gameOfLife.py → modules/LM_gameOfLife.py} +0 -0
- /micrOS/source/{LM_rgbcct.py → modules/LM_rgbcct.py} +0 -0
- /micrOS/source/{LM_rp2w.py → modules/LM_rp2w.py} +0 -0
- /micrOS/source/{LM_sdcard.py → modules/LM_sdcard.py} +0 -0
- /micrOS/source/{LM_sound_event.py → modules/LM_sound_event.py} +0 -0
- /micrOS/source/{LM_tinyrgb.py → modules/LM_tinyrgb.py} +0 -0
- /micrOS/source/{udashboard.js → web/udashboard.js} +0 -0
- /micrOS/source/{uwidgets.js → web/uwidgets.js} +0 -0
- /micrOS/source/{uwidgets_pro.js → web/uwidgets_pro.js} +0 -0
- {micrOSDevToolKit-2.9.1.dist-info → microsdevtoolkit-2.26.1.dist-info/licenses}/LICENSE +0 -0
- {micrOSDevToolKit-2.9.1.dist-info → microsdevtoolkit-2.26.1.dist-info}/top_level.txt +0 -0
- /toolkit/workspace/precompiled/{LM_rp2w.py → modules/LM_rp2w.py} +0 -0
- /toolkit/workspace/precompiled/{LM_sdcard.py → modules/LM_sdcard.py} +0 -0
- /toolkit/workspace/precompiled/{udashboard.js → web/udashboard.js} +0 -0
- /toolkit/workspace/precompiled/{uwidgets.js → web/uwidgets.js} +0 -0
- /toolkit/workspace/precompiled/{uwidgets_pro.js → web/uwidgets_pro.js} +0 -0
toolkit/MicrOSDevEnv.py
CHANGED
|
@@ -35,13 +35,13 @@ class MicrOSDevTool(OTA, USB):
|
|
|
35
35
|
#####################################################
|
|
36
36
|
# DevEnv METHODS #
|
|
37
37
|
#####################################################
|
|
38
|
-
def precompile_micros(self):
|
|
39
|
-
micros_dev_env = Compile.is_mpycross_available()
|
|
38
|
+
def precompile_micros(self, cleanup=True):
|
|
39
|
+
micros_dev_env = Compile().is_mpycross_available()
|
|
40
40
|
if not micros_dev_env:
|
|
41
41
|
self.console("SKIP PRECOMPILE - DEV ENV INACTIVE\n\t-> mpy-cross not available", state='warn')
|
|
42
42
|
return True
|
|
43
43
|
self.console("PRECOMPILE - DEV ENV ACTIVE: mpy-cross available", state='ok')
|
|
44
|
-
state = super(MicrOSDevTool, self).precompile_micros()
|
|
44
|
+
state = super(MicrOSDevTool, self).precompile_micros(cleanup)
|
|
45
45
|
# Drops Segmentation fault: 11 error: simulator doc gen... TODO
|
|
46
46
|
self.LM_functions_static_dump_gen()
|
|
47
47
|
return state
|
|
@@ -62,8 +62,16 @@ class MicrOSDevTool(OTA, USB):
|
|
|
62
62
|
if f.endswith('.json'):
|
|
63
63
|
continue
|
|
64
64
|
f_path = os.path.join(self.micrOS_dir_path, f)
|
|
65
|
-
|
|
66
|
-
|
|
65
|
+
if f.startswith("_") or f.startswith("."):
|
|
66
|
+
# SKIP files startswith `_` and `.`
|
|
67
|
+
continue
|
|
68
|
+
_, f_type = LocalMachine.FileHandler.path_is_exists(f_path)
|
|
69
|
+
target_dir = self.micros_sim_workspace
|
|
70
|
+
if f_type == "d":
|
|
71
|
+
target_dir = os.path.join(self.micros_sim_workspace, f)
|
|
72
|
+
self.console(f"[SIM] Copy micrOS resources: {f_path} -> {target_dir}")
|
|
73
|
+
if not LocalMachine.FileHandler().copy(f_path, target_dir):
|
|
74
|
+
self.console(f"[ERROR] Failed to copy: {f_path}")
|
|
67
75
|
|
|
68
76
|
if prepare_only:
|
|
69
77
|
# In case of automatic node_conf creation
|
|
@@ -128,26 +136,34 @@ class MicrOSDevTool(OTA, USB):
|
|
|
128
136
|
self.console("[ERROR] micrOS SIM\n{}".format(e))
|
|
129
137
|
workdir_handler.popd()
|
|
130
138
|
|
|
131
|
-
def
|
|
132
|
-
|
|
133
|
-
|
|
134
|
-
|
|
135
|
-
|
|
136
|
-
|
|
137
|
-
|
|
138
|
-
|
|
139
|
-
|
|
140
|
-
|
|
141
|
-
|
|
142
|
-
|
|
143
|
-
|
|
139
|
+
def _build_doc_load_module_structure(self):
|
|
140
|
+
|
|
141
|
+
def _is_private_func(_line):
|
|
142
|
+
nonlocal decorator, line
|
|
143
|
+
if 'def ' in line and 'def _' not in line:
|
|
144
|
+
if "async" in line and decorator is not None and "@micro_task" in decorator:
|
|
145
|
+
# Enable (adjust) async task method with publish_micro_task decorator
|
|
146
|
+
line = line.replace("async", "").strip()
|
|
147
|
+
return False
|
|
148
|
+
if '(self' in line or '(cls' in _line or (decorator is not None and "staticmethod" in decorator):
|
|
149
|
+
# Ignore class methods
|
|
150
|
+
return True
|
|
151
|
+
return False
|
|
152
|
+
# Ignore non functions, and hidden functions (starts with _)
|
|
153
|
+
return True
|
|
144
154
|
|
|
145
155
|
# [PARSING] Collect Load Module function structure buffer
|
|
146
|
-
|
|
147
|
-
|
|
156
|
+
modules_sim_path = os.path.join(self.micros_sim_workspace, "modules")
|
|
157
|
+
if LocalMachine.FileHandler.path_is_exists(modules_sim_path):
|
|
158
|
+
modules_path = modules_sim_path
|
|
159
|
+
else:
|
|
160
|
+
modules_path = os.path.join(self.micrOS_dir_path, "modules")
|
|
161
|
+
self.console(f"[DOC-GEN] INPUT MODULES PATH: {modules_path}")
|
|
162
|
+
modules_to_doc = [i.split('.')[0] for i in LocalMachine.FileHandler.list_dir(modules_path) if
|
|
163
|
+
i.startswith('LM_') and (i.endswith('.py'))]
|
|
148
164
|
module_function_dict = {}
|
|
149
165
|
for LM in modules_to_doc:
|
|
150
|
-
LMpath = '{}/{}.py'.format(
|
|
166
|
+
LMpath = '{}/{}.py'.format(modules_path, LM)
|
|
151
167
|
try:
|
|
152
168
|
module_name = LM.replace('LM_', '')
|
|
153
169
|
module_function_dict[module_name] = {}
|
|
@@ -157,29 +173,66 @@ class MicrOSDevTool(OTA, USB):
|
|
|
157
173
|
line = f.readline()
|
|
158
174
|
if not line:
|
|
159
175
|
break
|
|
160
|
-
if
|
|
161
|
-
if
|
|
162
|
-
|
|
163
|
-
|
|
164
|
-
|
|
165
|
-
|
|
166
|
-
|
|
167
|
-
|
|
168
|
-
|
|
169
|
-
|
|
170
|
-
|
|
171
|
-
|
|
172
|
-
|
|
173
|
-
|
|
174
|
-
|
|
175
|
-
|
|
176
|
-
|
|
177
|
-
|
|
178
|
-
|
|
176
|
+
if _is_private_func(line):
|
|
177
|
+
if line.strip().startswith("@"):
|
|
178
|
+
decorator = line.strip()
|
|
179
|
+
else:
|
|
180
|
+
decorator = None
|
|
181
|
+
continue
|
|
182
|
+
|
|
183
|
+
# Gen proper func name
|
|
184
|
+
command = '{}'.format(line.split(')')[0]).replace("def", '').strip()
|
|
185
|
+
command = command.replace('(', ' ') \
|
|
186
|
+
.replace(',', '') \
|
|
187
|
+
.replace('msgobj=None', '') \
|
|
188
|
+
.replace('force=True', '')
|
|
189
|
+
func = command.strip().split()[0]
|
|
190
|
+
param = ' '.join(command.strip().split()[1:])
|
|
191
|
+
# Save record
|
|
192
|
+
if module_function_dict[module_name].get(func, None) is None:
|
|
193
|
+
module_function_dict[module_name][func] = {}
|
|
194
|
+
module_function_dict[module_name][func]['param(s)'] = param if len(param) > 0 else ""
|
|
195
|
+
|
|
179
196
|
# Create / update module data fields
|
|
180
|
-
module_function_dict[module_name][
|
|
197
|
+
module_function_dict[module_name][
|
|
198
|
+
'img'] = f"https://github.com/BxNxM/micrOS/blob/master/media/lms/{module_name}.png?raw=true"
|
|
181
199
|
except Exception as e:
|
|
182
200
|
self.console("STATIC micrOS HELP GEN: LM [{}] PARSER ERROR: {}".format(LM, e))
|
|
201
|
+
self.console(f"[DOC-GEN] Detected modules: {module_function_dict.keys()}")
|
|
202
|
+
return module_function_dict
|
|
203
|
+
|
|
204
|
+
def LM_functions_static_dump_gen(self):
|
|
205
|
+
"""
|
|
206
|
+
Generate static module-function provider json description: sfuncman.json
|
|
207
|
+
[!] name dependency with micrOS internal manual provider
|
|
208
|
+
"""
|
|
209
|
+
|
|
210
|
+
def _my_json_to_html(mod_func_dict):
|
|
211
|
+
import json2html
|
|
212
|
+
table_attributes = 'border="1" cellspacing="1" cellpadding="5" width="80%"'
|
|
213
|
+
|
|
214
|
+
sorted_modules_w_data = dict(sorted(mod_func_dict.items(), key=lambda item: item[0].lower()))
|
|
215
|
+
module_shortcuts = ' | '.join(
|
|
216
|
+
f'<a href="#{mod_name.replace(" ", "_")}">{mod_name}</a>'
|
|
217
|
+
for mod_name in sorted_modules_w_data)
|
|
218
|
+
html_tables = module_shortcuts + "<br><hr><br>"
|
|
219
|
+
for key, value in sorted_modules_w_data.items():
|
|
220
|
+
anchor = key.replace(" ", "_") # Replace spaces with underscores for a valid anchor
|
|
221
|
+
html_tables += f'\n<br><br>\n<h2 id="{anchor}"><a href="#{anchor}">{key}</a></h2>\n'
|
|
222
|
+
html_tables += json2html.json2html.convert(json=value,
|
|
223
|
+
table_attributes=table_attributes,
|
|
224
|
+
clubbing=True,
|
|
225
|
+
escape=False,
|
|
226
|
+
encode=False)
|
|
227
|
+
return html_tables
|
|
228
|
+
|
|
229
|
+
if not os.path.isdir(self.sfuncman_output_path):
|
|
230
|
+
self.console('DOC GEN DISABLED', state="WARN")
|
|
231
|
+
return
|
|
232
|
+
|
|
233
|
+
repo_version = self.get_micros_version_from_repo()
|
|
234
|
+
static_help_json_path = os.path.join(self.sfuncman_output_path, 'sfuncman_{}.json'.format(repo_version))
|
|
235
|
+
static_help_html_path = os.path.join(self.sfuncman_output_path, 'sfuncman.html')
|
|
183
236
|
|
|
184
237
|
# Prepare (update simulator workspace)
|
|
185
238
|
self.simulator(prepare_only=True)
|
|
@@ -188,6 +241,7 @@ class MicrOSDevTool(OTA, USB):
|
|
|
188
241
|
import simulator
|
|
189
242
|
sim_proc = simulator.micrOSIM(doc_resolve=True)
|
|
190
243
|
# Generate function doc-strings and pinmap info
|
|
244
|
+
module_function_dict = self._build_doc_load_module_structure()
|
|
191
245
|
_out = sim_proc.gen_lm_doc_json_html(module_function_dict)
|
|
192
246
|
if _out is None:
|
|
193
247
|
self.console("#########################", state='ERR')
|
|
@@ -195,10 +249,15 @@ class MicrOSDevTool(OTA, USB):
|
|
|
195
249
|
self.console("# -[micrOSIM][DOC ERR]- #", state='ERR')
|
|
196
250
|
self.console("#########################", state='ERR')
|
|
197
251
|
module_function_dict_html = module_function_dict
|
|
252
|
+
module_function_dict_ext = {}
|
|
253
|
+
module_function_dict_html_ext = {}
|
|
198
254
|
else:
|
|
199
255
|
# Unpack output
|
|
200
|
-
module_function_dict, module_function_dict_html
|
|
256
|
+
(module_function_dict, module_function_dict_html,
|
|
257
|
+
module_function_dict_ext, module_function_dict_html_ext) = _out
|
|
201
258
|
|
|
259
|
+
# Merge built-in and external packages at json dco level (unified document) - external modules has annotation by default
|
|
260
|
+
module_function_dict.update(module_function_dict_ext)
|
|
202
261
|
hardcoded_manual = {"task": {"list": {"doc": "list micrOS tasks by taskID", "param(s)": ""},
|
|
203
262
|
"kill": {"doc": "kill / stop micrOS task", "param(s)": "taskID"},
|
|
204
263
|
"img": "https://github.com/BxNxM/micrOS/blob/master/media/lms/tasks.png?raw=true"}
|
|
@@ -214,12 +273,10 @@ class MicrOSDevTool(OTA, USB):
|
|
|
214
273
|
_url = hardcoded_manual["task"]["img"]
|
|
215
274
|
hardcoded_manual['task']['img'] = f'<img src="{_url}" alt="tasks" height=150>'
|
|
216
275
|
module_function_dict_html.update(hardcoded_manual)
|
|
217
|
-
|
|
218
|
-
|
|
219
|
-
|
|
220
|
-
|
|
221
|
-
table_attributes=table_attributes,
|
|
222
|
-
clubbing=True, escape=False, encode=False)
|
|
276
|
+
html_tables = _my_json_to_html(module_function_dict_html)
|
|
277
|
+
html_tables_ext = _my_json_to_html(module_function_dict_html_ext)
|
|
278
|
+
if len(html_tables_ext) > 0:
|
|
279
|
+
html_tables_ext = '<br><h2 id="external-modules"> External modules (packages).:</h2>' + html_tables_ext
|
|
223
280
|
|
|
224
281
|
# http://corelangs.com/css/table/tablecolor.html
|
|
225
282
|
# http://corelangs.com/css/table/tablecolor.html
|
|
@@ -253,25 +310,38 @@ micrOS Load Modules
|
|
|
253
310
|
</p>
|
|
254
311
|
|
|
255
312
|
<h2>
|
|
256
|
-
|
|
313
|
+
microIO Pin-Mapping (names to integers)
|
|
257
314
|
</h2>
|
|
258
315
|
<b> Multi-platform pinmap IO handling feature - resolve pin number by name (tag)<br>
|
|
259
316
|
<b>[i] Use 'module_name pinmap()' function to get pins on a runtime system (micrOS shell) and start DIY</b>
|
|
260
317
|
<ul>
|
|
261
|
-
<li><a href="https://github.com/BxNxM/micrOS/blob/master/micrOS/source/
|
|
262
|
-
<li><a href="https://github.com/BxNxM/micrOS/blob/master/micrOS/source/
|
|
263
|
-
<li><a href="https://github.com/BxNxM/micrOS/blob/master/micrOS/source/
|
|
264
|
-
|
|
265
|
-
<li><a href="https://github.com/BxNxM/micrOS/blob/master/micrOS/source/
|
|
266
|
-
<li><a href="https://github.com/BxNxM/micrOS/blob/master/micrOS/source/
|
|
267
|
-
<li><a href="https://github.com/BxNxM/micrOS/blob/master/micrOS/source/
|
|
318
|
+
<li><a href="https://github.com/BxNxM/micrOS/blob/master/micrOS/source/modules/IO_m5stamp.py" target="_blank">m5stamp</a></li>
|
|
319
|
+
<li><a href="https://github.com/BxNxM/micrOS/blob/master/micrOS/source/modules/IO_tinypico.py" target="_blank">tinypico</a></li>
|
|
320
|
+
<li><a href="https://github.com/BxNxM/micrOS/blob/master/micrOS/source/modules/IO_s3matrix.py" target="_blank">s3matrix</a></li>
|
|
321
|
+
|
|
322
|
+
<li><a href="https://github.com/BxNxM/micrOS/blob/master/micrOS/source/modules/IO_esp32.py" target="_blank">esp32</a></li>
|
|
323
|
+
<li><a href="https://github.com/BxNxM/micrOS/blob/master/micrOS/source/modules/IO_esp32s3.py" target="_blank">esp32s3</a></li>
|
|
324
|
+
<li><a href="https://github.com/BxNxM/micrOS/blob/master/micrOS/source/modules/IO_esp32c3.py" target="_blank">esp32c3</a></li>
|
|
325
|
+
<li><a href="https://github.com/BxNxM/micrOS/blob/master/micrOS/source/modules/IO_esp32c6.py" target="_blank">esp32c6</a></li>
|
|
326
|
+
<li><a href="https://github.com/BxNxM/micrOS/blob/master/micrOS/source/modules/IO_esp32s2.py" target="_blank">esp32s2</a></li>
|
|
327
|
+
<li><a href="https://github.com/BxNxM/micrOS/blob/master/micrOS/source/modules/IO_rp2.py" target="_blank">rp2 (experimental)</a></li>
|
|
268
328
|
</ul>
|
|
269
329
|
|
|
330
|
+
<h2>External package support</h2>
|
|
331
|
+
<a href="#external-modules">Go to external packages</a>
|
|
332
|
+
|
|
|
333
|
+
<a href="https://github.com/BxNxM/micrOSPackages" target="_blank">
|
|
334
|
+
View Packages on GitHub
|
|
335
|
+
</a>
|
|
336
|
+
<br>
|
|
337
|
+
|
|
338
|
+
<h2> Built-in control modules for various peripheries.: </h2>
|
|
339
|
+
|
|
270
340
|
"""
|
|
271
341
|
html_body_end = """</body>
|
|
272
342
|
</html>"""
|
|
273
343
|
|
|
274
|
-
html_page = html_body_start +
|
|
344
|
+
html_page = html_body_start + html_tables + html_tables_ext + html_body_end
|
|
275
345
|
# Write html to file
|
|
276
346
|
with open(static_help_html_path, 'w') as f:
|
|
277
347
|
f.write(html_page)
|
toolkit/WebRepl.py
ADDED
|
@@ -0,0 +1,73 @@
|
|
|
1
|
+
import sys
|
|
2
|
+
import os
|
|
3
|
+
|
|
4
|
+
MYDIR = os.path.dirname(__file__)
|
|
5
|
+
print("Module [WebRepl] path: {} __package__: {} __name__: {} __file__: {}".format(
|
|
6
|
+
sys.path[0], __package__, __name__, MYDIR))
|
|
7
|
+
try:
|
|
8
|
+
from .lib.TerminalColors import Colors
|
|
9
|
+
from .lib.LocalMachine import FileHandler, CommandHandler, SimplePopPushd
|
|
10
|
+
from .socketClient import ConnectionData
|
|
11
|
+
except Exception as e:
|
|
12
|
+
print("Import warning __name__:{}: {}".format(__name__, e))
|
|
13
|
+
from lib.TerminalColors import Colors
|
|
14
|
+
from lib.LocalMachine import FileHandler, CommandHandler, SimplePopPushd
|
|
15
|
+
from socketClient import ConnectionData
|
|
16
|
+
|
|
17
|
+
WEBREPL_DIR = os.path.join(MYDIR, "workspace/webrepl")
|
|
18
|
+
MAKE_HTML_WEBPAGE_PATH = os.path.join(WEBREPL_DIR, "make_html_js.py")
|
|
19
|
+
WEBREPL_WEBPAGE_PATH = os.path.join(WEBREPL_DIR, "webrepl.html")
|
|
20
|
+
|
|
21
|
+
def init_webrepl_frontend():
|
|
22
|
+
webrepldir_handler = SimplePopPushd()
|
|
23
|
+
webrepldir_handler.pushd(WEBREPL_DIR)
|
|
24
|
+
|
|
25
|
+
is_exists, ftype = FileHandler.path_is_exists(MAKE_HTML_WEBPAGE_PATH)
|
|
26
|
+
if is_exists and ftype == 'f':
|
|
27
|
+
print("RUN webrepl/make_html_js.py")
|
|
28
|
+
exitcode, _, stderr = CommandHandler.run_command(f"{sys.executable} {MAKE_HTML_WEBPAGE_PATH}", shell=True)
|
|
29
|
+
webrepldir_handler.popd()
|
|
30
|
+
if exitcode == 0:
|
|
31
|
+
return True
|
|
32
|
+
print(f"Cannot init {MAKE_HTML_WEBPAGE_PATH}: {stderr}")
|
|
33
|
+
return False
|
|
34
|
+
print(f"WEBREPL MAKE MISSING: {MAKE_HTML_WEBPAGE_PATH}")
|
|
35
|
+
return False
|
|
36
|
+
|
|
37
|
+
def open_webrepl_webpage(address=None, port=8266):
|
|
38
|
+
# file:///Users/usrname/micrOS/micrOS/toolkit/workspace/webrepl/webrepl.html#10.0.1.76:8266
|
|
39
|
+
fuid = ''
|
|
40
|
+
if address is None:
|
|
41
|
+
try:
|
|
42
|
+
address, _, fuid, _ = ConnectionData.select_device()
|
|
43
|
+
except KeyboardInterrupt:
|
|
44
|
+
address = None
|
|
45
|
+
|
|
46
|
+
device = "" if address is None else f"#{address}:{port}"
|
|
47
|
+
webrepl_html = f"file://{WEBREPL_WEBPAGE_PATH}{device}"
|
|
48
|
+
is_exists, ftype = FileHandler.path_is_exists(WEBREPL_WEBPAGE_PATH)
|
|
49
|
+
if is_exists and ftype == "f":
|
|
50
|
+
print(f"OPEN {fuid} webrepl {webrepl_html}")
|
|
51
|
+
if sys.platform == "darwin":
|
|
52
|
+
CommandHandler.run_command(f"open '{webrepl_html}'", shell=True)
|
|
53
|
+
elif sys.platform == "win32":
|
|
54
|
+
CommandHandler.run_command(f"start {webrepl_html}", shell=True)
|
|
55
|
+
elif sys.platform == "linux":
|
|
56
|
+
CommandHandler.run_command(f"xdg-open {webrepl_html}", shell=True)
|
|
57
|
+
else:
|
|
58
|
+
print("Unsupported OS")
|
|
59
|
+
return False
|
|
60
|
+
return True
|
|
61
|
+
print(f"{WEBREPL_WEBPAGE_PATH} not exists.")
|
|
62
|
+
return False
|
|
63
|
+
|
|
64
|
+
|
|
65
|
+
def open_webrepl():
|
|
66
|
+
state = init_webrepl_frontend()
|
|
67
|
+
if state:
|
|
68
|
+
open_webrepl_webpage()
|
|
69
|
+
|
|
70
|
+
|
|
71
|
+
|
|
72
|
+
if __name__ == "__main__":
|
|
73
|
+
open_webrepl()
|
|
@@ -5,27 +5,17 @@ import sys
|
|
|
5
5
|
import json
|
|
6
6
|
MYPATH = os.path.dirname(os.path.abspath(__file__))
|
|
7
7
|
BACKUP_DIR = os.path.join(MYPATH, "../user_data/node_config_archive/")
|
|
8
|
-
sys.path.append(os.path.dirname(MYPATH))
|
|
9
|
-
import socketClient
|
|
10
8
|
sys.path.append(os.path.join(MYPATH, '../lib/'))
|
|
11
9
|
from TerminalColors import Colors
|
|
12
10
|
|
|
13
|
-
|
|
14
|
-
|
|
15
|
-
|
|
11
|
+
try:
|
|
12
|
+
from ._app_base import AppBase
|
|
13
|
+
except:
|
|
14
|
+
from _app_base import AppBase
|
|
16
15
|
|
|
17
|
-
|
|
18
|
-
if PASSWD is None:
|
|
19
|
-
return ['--dev', DEVICE]
|
|
20
|
-
return ['--dev', DEVICE, '--password', PASSWD]
|
|
16
|
+
CLIENT = None
|
|
21
17
|
|
|
22
18
|
|
|
23
|
-
def run_command(cmd):
|
|
24
|
-
# EDIT YOUR COMMAND
|
|
25
|
-
args = base_cmd() + cmd
|
|
26
|
-
status, answer = socketClient.run(args)
|
|
27
|
-
return status, answer
|
|
28
|
-
|
|
29
19
|
###########################################################
|
|
30
20
|
def _value_type(value):
|
|
31
21
|
value = value.strip()
|
|
@@ -42,15 +32,16 @@ def _value_type(value):
|
|
|
42
32
|
|
|
43
33
|
|
|
44
34
|
def backup():
|
|
45
|
-
|
|
46
|
-
print(f"\
|
|
47
|
-
|
|
35
|
+
device = CLIENT.get_device()
|
|
36
|
+
print(f"\tBackup name format: {device}-<tag>-node_config.json")
|
|
37
|
+
print(f"\t\t tag is optional (press simply enter): {device}-node_config.json")
|
|
38
|
+
backup_tag = input(f"\tFill backup tag for {device}: ").strip()
|
|
48
39
|
backup_tag = "" if len(backup_tag) == 0 else f"-{backup_tag}"
|
|
49
|
-
backup_name = f"{
|
|
40
|
+
backup_name = f"{device}{backup_tag}-node_config.json"
|
|
50
41
|
backup_path = os.path.join(BACKUP_DIR, backup_name)
|
|
51
42
|
print(f"\tBackup path: {backup_path}")
|
|
52
43
|
|
|
53
|
-
status, answer =
|
|
44
|
+
status, answer = CLIENT.run(["conf", "dump"])
|
|
54
45
|
if status:
|
|
55
46
|
configuration = {line.split(":")[0].strip(): _value_type(':'.join(line.split(":")[1:])) for line in answer.strip().split("\n") if ":" in line}
|
|
56
47
|
with open(backup_path, 'w') as f:
|
|
@@ -61,7 +52,8 @@ def backup():
|
|
|
61
52
|
|
|
62
53
|
|
|
63
54
|
def restore():
|
|
64
|
-
|
|
55
|
+
device = CLIENT.get_device()
|
|
56
|
+
print(f"\tRestore backup for: {device}")
|
|
65
57
|
diff_config = {}
|
|
66
58
|
|
|
67
59
|
# SELECT AND LOAD CONFIG BACKUP
|
|
@@ -81,7 +73,7 @@ def restore():
|
|
|
81
73
|
print(f"BACKUP CONFIG DICT:\n{backup_dict}")
|
|
82
74
|
|
|
83
75
|
# LOAD LIVE DEVICE CONFIG - create config diff
|
|
84
|
-
status, answer =
|
|
76
|
+
status, answer = CLIENT.run(["conf", "dump"])
|
|
85
77
|
if not status:
|
|
86
78
|
return f"Cannot load live device config"
|
|
87
79
|
live_configuration = {line.split(":")[0].strip(): _value_type(':'.join(line.split(":")[1:])) for line in answer.strip().split("\n") if ":" in line}
|
|
@@ -103,20 +95,16 @@ def restore():
|
|
|
103
95
|
print(f"{Colors.WARN}SKIP restore...{Colors.NC}")
|
|
104
96
|
return
|
|
105
97
|
|
|
106
|
-
print(f"PACKAGE CONFIG DIFFS...{
|
|
98
|
+
print(f"PACKAGE CONFIG DIFFS...{device}")
|
|
107
99
|
conf_cmd_list = ["conf"]
|
|
108
100
|
for key, value in diff_config.items():
|
|
109
101
|
print(f"\tADD {key} : {value}")
|
|
110
102
|
conf_cmd_list.append(f"{key} {value}")
|
|
111
103
|
conf_cmd_list.append("reboot")
|
|
112
104
|
|
|
113
|
-
verify = input(f"{Colors.WARN}This is BETA feature, are you sure?{Colors.NC} [YY/n]: ")
|
|
114
|
-
if verify != "YY":
|
|
115
|
-
print(f"{Colors.WARN}SKIP restore...{Colors.NC}")
|
|
116
|
-
return
|
|
117
105
|
# Restore
|
|
118
|
-
print(f"APPLY CONFIG DIFFS...{
|
|
119
|
-
status, answer =
|
|
106
|
+
print(f"APPLY CONFIG DIFFS...{device}")
|
|
107
|
+
status, answer = CLIENT.run(conf_cmd_list)
|
|
120
108
|
if status:
|
|
121
109
|
print(f"{Colors.OKGREEN}Backup was successfully restored:{Colors.NC} {backup_path}\nRebooting...")
|
|
122
110
|
else:
|
|
@@ -148,15 +136,12 @@ def app(devfid=None, pwd=None):
|
|
|
148
136
|
send command(s) over socket connection [socketClient.run(args)]
|
|
149
137
|
list load module commands and send in single connection
|
|
150
138
|
"""
|
|
151
|
-
global
|
|
152
|
-
|
|
153
|
-
DEVICE = devfid
|
|
154
|
-
if pwd is not None:
|
|
155
|
-
PASSWD = pwd
|
|
139
|
+
global CLIENT
|
|
140
|
+
CLIENT = AppBase(device=devfid, password=pwd)
|
|
156
141
|
|
|
157
142
|
print(f"{Colors.WARN}Backup & Restore management{Colors.NC}\n")
|
|
158
143
|
while True:
|
|
159
|
-
print(f"{Colors.UNDERLINE}Operations on {
|
|
144
|
+
print(f"{Colors.UNDERLINE}Operations on {CLIENT.get_device()}{Colors.NC}")
|
|
160
145
|
print("\t[1] Backup")
|
|
161
146
|
print("\t[2] Restore")
|
|
162
147
|
print("\t[3] Delete backups")
|
|
@@ -2,38 +2,33 @@
|
|
|
2
2
|
|
|
3
3
|
import os
|
|
4
4
|
import sys
|
|
5
|
-
import time
|
|
6
5
|
MYPATH = os.path.dirname(os.path.abspath(__file__))
|
|
7
|
-
sys.path.append(os.path.dirname(MYPATH))
|
|
8
|
-
import socketClient
|
|
9
6
|
sys.path.append(os.path.join(MYPATH, '../lib/'))
|
|
10
|
-
from TerminalColors import Colors
|
|
11
7
|
|
|
12
|
-
|
|
13
|
-
|
|
8
|
+
try:
|
|
9
|
+
from ._app_base import AppBase
|
|
10
|
+
except:
|
|
11
|
+
from _app_base import AppBase
|
|
14
12
|
|
|
13
|
+
CLIENT = None
|
|
15
14
|
|
|
16
|
-
def base_cmd():
|
|
17
|
-
return ['--dev', DEVICE]
|
|
18
15
|
|
|
19
|
-
|
|
20
|
-
def app(devfid=None):
|
|
16
|
+
def app(devfid=None, pwd=None):
|
|
21
17
|
"""
|
|
22
18
|
devfid: selected device input
|
|
23
19
|
send command(s) over socket connection [socketClient.run(args)]
|
|
24
20
|
list load module commands and send in single connection
|
|
25
21
|
"""
|
|
26
|
-
global
|
|
27
|
-
|
|
28
|
-
DEVICE = devfid
|
|
22
|
+
global CLIENT
|
|
23
|
+
CLIENT = AppBase(device=devfid, password=pwd)
|
|
29
24
|
|
|
30
|
-
status, answer =
|
|
25
|
+
status, answer = CLIENT.run(['cct white 50 400',
|
|
31
26
|
'cct brightness 50'])
|
|
32
|
-
status, answer =
|
|
27
|
+
status, answer = CLIENT.run(['cct brightness 100', 'cct brightness 20',
|
|
33
28
|
'cct brightness 60'])
|
|
34
|
-
status, answer =
|
|
29
|
+
status, answer = CLIENT.run(['cct white 400 50',
|
|
35
30
|
'cct brightness 100', 'cct brightness 20'])
|
|
36
|
-
status, answer =
|
|
31
|
+
status, answer = CLIENT.run(['cct white 600 700',
|
|
37
32
|
'cct white 50 300'])
|
|
38
33
|
|
|
39
34
|
|
|
@@ -5,18 +5,15 @@ import sys
|
|
|
5
5
|
import time
|
|
6
6
|
import random
|
|
7
7
|
MYPATH = os.path.dirname(os.path.abspath(__file__))
|
|
8
|
-
sys.path.append(os.path.dirname(MYPATH))
|
|
9
|
-
import socketClient
|
|
10
|
-
import time
|
|
11
8
|
sys.path.append(os.path.join(MYPATH, '../lib/'))
|
|
12
9
|
from TerminalColors import Colors
|
|
13
10
|
|
|
14
|
-
|
|
15
|
-
|
|
16
|
-
|
|
11
|
+
try:
|
|
12
|
+
from ._app_base import AppBase
|
|
13
|
+
except:
|
|
14
|
+
from _app_base import AppBase
|
|
17
15
|
|
|
18
|
-
|
|
19
|
-
return ['--dev', DEVICE]
|
|
16
|
+
CLIENT = None
|
|
20
17
|
|
|
21
18
|
|
|
22
19
|
def test_random_colors(test_len=8, smooth=False):
|
|
@@ -30,12 +27,12 @@ def test_random_colors(test_len=8, smooth=False):
|
|
|
30
27
|
|
|
31
28
|
# Generate command
|
|
32
29
|
cmd_list_str = " <a> ".join(["{} {} {} {} >json".format(main_function, k[0], k[1], smooth) for k in cct_list])
|
|
33
|
-
args =
|
|
30
|
+
args = [cmd_list_str]
|
|
34
31
|
print("{} Generated command {} - multi message single connection single connection: {} cold warm {}\n{}".format(Colors.HEADER, Colors.NC, main_function, smooth, args))
|
|
35
32
|
|
|
36
33
|
start_t = time.time()
|
|
37
34
|
# SEND MESSSAGE OVER micrOS client
|
|
38
|
-
status, answer =
|
|
35
|
+
status, answer = CLIENT.run(args)
|
|
39
36
|
delta_t = round((time.time() - start_t)/test_len, 1)
|
|
40
37
|
|
|
41
38
|
#Evaluate last message
|
|
@@ -51,14 +48,14 @@ def test_random_colors(test_len=8, smooth=False):
|
|
|
51
48
|
|
|
52
49
|
def test_toogle():
|
|
53
50
|
main_function = 'cct toggle'
|
|
54
|
-
args_on =
|
|
55
|
-
args_toggle =
|
|
51
|
+
args_on = [f'{main_function} True >json']
|
|
52
|
+
args_toggle = [f'{main_function} >json']
|
|
56
53
|
|
|
57
54
|
# SEND MESSSAGE OVER micrOS client
|
|
58
|
-
status, answer =
|
|
55
|
+
status, answer = CLIENT.run(args_on)
|
|
59
56
|
if status and '"S": 1' in answer:
|
|
60
57
|
# SEND MESSSAGE OVER micrOS client
|
|
61
|
-
status, answer =
|
|
58
|
+
status, answer = CLIENT.run(args_toggle)
|
|
62
59
|
if status and '"S": 0' in answer:
|
|
63
60
|
return True, '{} works {}OK{}'.format(main_function, Colors.OK, Colors.NC)
|
|
64
61
|
return False, '{} not works {}NOK{}: {}'.format(main_function, Colors.ERR, Colors.NC, answer)
|
|
@@ -66,24 +63,23 @@ def test_toogle():
|
|
|
66
63
|
|
|
67
64
|
def test_brightness():
|
|
68
65
|
main_function = 'cct brightness'
|
|
69
|
-
args_10 =
|
|
70
|
-
args_50 =
|
|
71
|
-
args_actual_br =
|
|
66
|
+
args_10 = [f'{main_function} 10 >json']
|
|
67
|
+
args_50 = [f'{main_function} 50 >json']
|
|
68
|
+
args_actual_br = [f'{main_function} >json']
|
|
72
69
|
|
|
73
|
-
status, answer =
|
|
70
|
+
status, answer = CLIENT.run(args_10)
|
|
74
71
|
if status:
|
|
75
|
-
status, answer =
|
|
72
|
+
status, answer = CLIENT.run(args_50)
|
|
76
73
|
if status:
|
|
77
|
-
status, answer =
|
|
74
|
+
status, answer = CLIENT.run(args_actual_br)
|
|
78
75
|
if status and "50.0 %" in answer:
|
|
79
76
|
return True, "{} function {}OK{} (50.0 % == {})".format(main_function, Colors.OK, Colors.NC, answer)
|
|
80
77
|
return False, "{} function {}NOK{} (50.0 % == {})".format(main_function, Colors.ERR, Colors.NC, answer)
|
|
81
78
|
|
|
82
79
|
|
|
83
|
-
def app(devfid=None):
|
|
84
|
-
global
|
|
85
|
-
|
|
86
|
-
DEVICE = devfid
|
|
80
|
+
def app(devfid=None, pwd=None):
|
|
81
|
+
global CLIENT
|
|
82
|
+
CLIENT = AppBase(device=devfid, password=pwd)
|
|
87
83
|
|
|
88
84
|
test_pool = { 'Color change test': test_random_colors(test_len=8, smooth=False),
|
|
89
85
|
'Color smooth test': test_random_colors(test_len=4, smooth=True),
|
|
@@ -2,14 +2,10 @@ import sys, os
|
|
|
2
2
|
import subprocess
|
|
3
3
|
MYPATH = os.path.dirname(os.path.abspath(__file__))
|
|
4
4
|
|
|
5
|
-
DEVICE = "node01"
|
|
6
5
|
|
|
7
|
-
def app(devfid=None):
|
|
6
|
+
def app(devfid=None, pwd=None):
|
|
8
7
|
"""
|
|
9
8
|
Wrapper function to start subprocess plotting... (threading limitation)
|
|
10
9
|
"""
|
|
11
|
-
|
|
12
|
-
if devfid is not None:
|
|
13
|
-
DEVICE = devfid
|
|
14
|
-
result = subprocess.run([f'{sys.executable}', os.path.join(MYPATH, '_capture.py'), DEVICE])
|
|
10
|
+
result = subprocess.run([f'{sys.executable}', os.path.join(MYPATH, '_capture.py'), devfid])
|
|
15
11
|
print(result)
|