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
toolkit/DevEnvOTA.py
CHANGED
|
@@ -5,22 +5,27 @@ MYPATH = os.path.dirname(__file__)
|
|
|
5
5
|
print("Module [DevEnvOTA] path: {} __package__: {} __name__: {} __file__: {}".format(
|
|
6
6
|
sys.path[0], __package__, __name__, MYPATH))
|
|
7
7
|
|
|
8
|
+
from pprint import pprint
|
|
9
|
+
|
|
8
10
|
try:
|
|
9
11
|
from .DevEnvCompile import Compile
|
|
10
12
|
from . import socketClient
|
|
11
13
|
from .lib import LocalMachine
|
|
12
14
|
from .lib.TerminalColors import Colors
|
|
13
15
|
from .lib.SafeInput import input_with_timeout
|
|
14
|
-
from .lib.
|
|
16
|
+
from .lib.MicrosFiles import check_all_extensions, check_web_extensions, check_python_extensions, micros_resource_list
|
|
17
|
+
from .lib.Repository import git_clone_archive, git_clone
|
|
15
18
|
except Exception as e:
|
|
16
19
|
print("Import warning __name__:{}: {}".format(__name__, e))
|
|
17
20
|
from DevEnvCompile import Compile
|
|
18
21
|
from lib import LocalMachine
|
|
19
22
|
from lib.TerminalColors import Colors
|
|
20
23
|
from lib.SafeInput import input_with_timeout
|
|
21
|
-
from lib.
|
|
22
|
-
|
|
23
|
-
|
|
24
|
+
from lib.MicrosFiles import check_all_extensions, check_web_extensions, check_python_extensions, micros_resource_list
|
|
25
|
+
from lib.Repository import git_clone_archive, git_clone
|
|
26
|
+
|
|
27
|
+
sys.path.append(MYPATH)
|
|
28
|
+
import socketClient
|
|
24
29
|
|
|
25
30
|
|
|
26
31
|
#################################################
|
|
@@ -37,7 +42,7 @@ class OTA(Compile):
|
|
|
37
42
|
# Skip the following modules in OTA update (safe mode) to have recovery mode
|
|
38
43
|
self.safe_mode_file_exception_list = ['main.py', 'micrOSloader.mpy',
|
|
39
44
|
'Network.mpy', 'Config.mpy',
|
|
40
|
-
'Debug.mpy']
|
|
45
|
+
'Debug.mpy', 'Files.py']
|
|
41
46
|
|
|
42
47
|
def safe_core_list(self):
|
|
43
48
|
return self.safe_mode_file_exception_list
|
|
@@ -52,15 +57,17 @@ class OTA(Compile):
|
|
|
52
57
|
# Change workdir
|
|
53
58
|
workdir_handler = LocalMachine.SimplePopPushd()
|
|
54
59
|
workdir_handler.pushd(os.path.dirname(os.path.dirname(webrepl_path)))
|
|
60
|
+
webrepl_url = 'https://github.com/micropython/webrepl.git'
|
|
55
61
|
|
|
56
|
-
|
|
57
|
-
name='webrepl',
|
|
58
|
-
url='https://github.com/micropython/webrepl.git')
|
|
59
|
-
self.console("Clone webrepl repo: {}".format(command))
|
|
62
|
+
self.console(f"Clone webrepl repo: {webrepl_url}")
|
|
60
63
|
if self.dry_run:
|
|
61
|
-
exitcode, stdout, stderr = 0,
|
|
64
|
+
exitcode, stdout, stderr = 0, "", ""
|
|
62
65
|
else:
|
|
63
|
-
|
|
66
|
+
# Git clone with command line tool
|
|
67
|
+
exitcode, stdout, stderr = git_clone(url=webrepl_url)
|
|
68
|
+
if exitcode != 0:
|
|
69
|
+
# Git clone archive - without git
|
|
70
|
+
exitcode, stdout, stderr = git_clone_archive(url=webrepl_url)
|
|
64
71
|
|
|
65
72
|
# Restore workdir
|
|
66
73
|
workdir_handler.popd()
|
|
@@ -156,7 +163,6 @@ class OTA(Compile):
|
|
|
156
163
|
def update_with_webrepl(self, force=False, device=None, lm_only=False, loader_update=False, ota_password='ADmin123'):
|
|
157
164
|
"""
|
|
158
165
|
OTA UPDATE via webrepl
|
|
159
|
-
git clone https://github.com/micropython/webrepl.git
|
|
160
166
|
info: https://techoverflow.net/2020/02/22/how-to-upload-files-to-micropython-using-webrepl-using-webrepl_cli-py/
|
|
161
167
|
./webrepl/webrepl_cli.py -p <password> <input_file> espressif.local:<output_file>
|
|
162
168
|
"""
|
|
@@ -237,9 +243,9 @@ class OTA(Compile):
|
|
|
237
243
|
self.console(" loader update: {}".format(force_mode), state='OK')
|
|
238
244
|
|
|
239
245
|
# Parse files from precompiled dir
|
|
240
|
-
resource_list_to_upload =
|
|
241
|
-
|
|
242
|
-
|
|
246
|
+
resource_list_to_upload, dir_list_to_create = micros_resource_list(self.precompiled_micrOS_dir_path)
|
|
247
|
+
# LIMITATION: WEBREPL Cannot create directories with remote command...
|
|
248
|
+
|
|
243
249
|
# Apply upload settings on parsed resources
|
|
244
250
|
for index, source in enumerate(resource_list_to_upload):
|
|
245
251
|
source_name = os.path.basename(source)
|
|
@@ -264,7 +270,8 @@ class OTA(Compile):
|
|
|
264
270
|
# Add source to upload
|
|
265
271
|
upload_path_list.append(source)
|
|
266
272
|
# Upload files / sources
|
|
267
|
-
return self.ota_webrepl_update_core(device, upload_path_list=upload_path_list,
|
|
273
|
+
return self.ota_webrepl_update_core(device, upload_path_list=upload_path_list,
|
|
274
|
+
ota_password=webrepl_password, upload_root_dir=self.precompiled_micrOS_dir_path)
|
|
268
275
|
|
|
269
276
|
def _enable_micros_ota_update_via_webrepl(self, device=None, ota_password=None):
|
|
270
277
|
# Get specific device from device list
|
|
@@ -386,7 +393,43 @@ class OTA(Compile):
|
|
|
386
393
|
self.execution_verdict.append("[OK] ota_update was finished")
|
|
387
394
|
return up_again_status
|
|
388
395
|
|
|
389
|
-
|
|
396
|
+
@staticmethod
|
|
397
|
+
def sim_ota_update(file_list, force_lm):
|
|
398
|
+
sim_path = os.path.join(MYPATH, "workspace/simulator")
|
|
399
|
+
for source in file_list:
|
|
400
|
+
f_name = os.path.basename(source)
|
|
401
|
+
if force_lm and not f_name.startswith('LM_') and f_name.endswith('.py'):
|
|
402
|
+
f_name = 'LM_{}'.format(f_name)
|
|
403
|
+
target = os.path.join(sim_path, f_name)
|
|
404
|
+
print(f"[SIM] 'OTA' COPY FILES... {source} -> {target}")
|
|
405
|
+
LocalMachine.FileHandler().copy(source, target)
|
|
406
|
+
|
|
407
|
+
@staticmethod
|
|
408
|
+
def _dynamic_file_target(source_name, force_lm):
|
|
409
|
+
"""
|
|
410
|
+
Dynamic file target path based on file extension.
|
|
411
|
+
-> web
|
|
412
|
+
-> modules
|
|
413
|
+
-> config
|
|
414
|
+
-> data
|
|
415
|
+
"""
|
|
416
|
+
# Force LM update - user load modules - drag n drop files
|
|
417
|
+
if force_lm and not source_name.startswith('LM_') and source_name.endswith('py'):
|
|
418
|
+
source_name = 'LM_{}'.format(source_name)
|
|
419
|
+
# Drag-n-Drop file upload file type check and folder adjustment
|
|
420
|
+
if check_web_extensions(source_name):
|
|
421
|
+
source_name_target = os.path.join('web', source_name)
|
|
422
|
+
elif check_python_extensions(source_name):
|
|
423
|
+
source_name_target = os.path.join('modules', source_name)
|
|
424
|
+
elif source_name.endswith("node_config.json") or source_name.endswith("requirements.txt"):
|
|
425
|
+
source_name_target = os.path.join('config', source_name)
|
|
426
|
+
else:
|
|
427
|
+
# Copy file to micrOS data folder (not web, not module, not config)
|
|
428
|
+
source_name_target = os.path.join('data', source_name)
|
|
429
|
+
return source_name_target
|
|
430
|
+
|
|
431
|
+
def ota_webrepl_update_core(self, device=None, upload_path_list=None, ota_password='ADmin123',
|
|
432
|
+
force_lm=False, upload_root_dir=None):
|
|
390
433
|
"""
|
|
391
434
|
Generic file uploader for micrOS - over webrepl
|
|
392
435
|
info: https://techoverflow.net/2020/02/22/how-to-upload-files-to-micropython-using-webrepl-using-webrepl_cli-py/
|
|
@@ -395,7 +438,14 @@ class OTA(Compile):
|
|
|
395
438
|
upload_path_list: file path list to upload
|
|
396
439
|
ota_password - accessing webrepl to upload files
|
|
397
440
|
force_lm - use prefix as 'LM_' for every file - for user file upload / GUI drag n drop
|
|
441
|
+
upload_root_dir - root directory to upload files (subdir support)
|
|
398
442
|
"""
|
|
443
|
+
if upload_path_list is None:
|
|
444
|
+
upload_path_list = []
|
|
445
|
+
|
|
446
|
+
if device[0] == "__simulator__":
|
|
447
|
+
OTA.sim_ota_update(upload_path_list, force_lm)
|
|
448
|
+
return
|
|
399
449
|
|
|
400
450
|
# GET webrepl repo
|
|
401
451
|
if not self.__clone_webrepl_repo():
|
|
@@ -439,11 +489,11 @@ class OTA(Compile):
|
|
|
439
489
|
# Copy retry mechanism
|
|
440
490
|
exitcode = -1
|
|
441
491
|
source_name = os.path.basename(source)
|
|
442
|
-
|
|
443
|
-
|
|
444
|
-
|
|
445
|
-
|
|
446
|
-
source_name_target = '
|
|
492
|
+
if upload_root_dir is None:
|
|
493
|
+
source_name_target = self._dynamic_file_target(source_name, force_lm)
|
|
494
|
+
else:
|
|
495
|
+
# MAIN USE-CASE
|
|
496
|
+
source_name_target = source.replace(upload_root_dir, '')
|
|
447
497
|
|
|
448
498
|
command = '{python} {api} -p {pwd} {input_file} {host}:{target_path}'.format(
|
|
449
499
|
python=self.python_interpreter,
|
toolkit/DevEnvUSB.py
CHANGED
|
@@ -3,6 +3,7 @@ import sys
|
|
|
3
3
|
import json
|
|
4
4
|
import time
|
|
5
5
|
import pprint
|
|
6
|
+
|
|
6
7
|
MYPATH = os.path.dirname(__file__)
|
|
7
8
|
print("Module [DevEnvOTA] path: {} __package__: {} __name__: {} __file__: {}".format(
|
|
8
9
|
sys.path[0], __package__, __name__, MYPATH))
|
|
@@ -12,12 +13,14 @@ try:
|
|
|
12
13
|
from .lib import LocalMachine
|
|
13
14
|
from .lib.TerminalColors import Colors
|
|
14
15
|
from .lib.SerialDriverHandler import install_usb_serial_driver
|
|
16
|
+
from .lib.MicrosFiles import micros_resource_list
|
|
15
17
|
except Exception as e:
|
|
16
18
|
print("Import warning __name__:{}: {}".format(__name__, e))
|
|
17
19
|
from DevEnvCompile import Compile
|
|
18
20
|
from lib import LocalMachine
|
|
19
21
|
from lib.TerminalColors import Colors
|
|
20
22
|
from lib.SerialDriverHandler import install_usb_serial_driver
|
|
23
|
+
from lib.MicrosFiles import micros_resource_list
|
|
21
24
|
|
|
22
25
|
|
|
23
26
|
class USB(Compile):
|
|
@@ -31,33 +34,30 @@ class USB(Compile):
|
|
|
31
34
|
self.micropython_bin_dir_path = os.path.join(MYPATH, "../micrOS/micropython")
|
|
32
35
|
self.micrOS_node_config_archive = os.path.join(MYPATH, "user_data/node_config_archive")
|
|
33
36
|
self.node_config_profiles_path = os.path.join(MYPATH, "../micrOS/release_info/node_config_profiles/")
|
|
37
|
+
self.esptool_interface = self.get_valid_esptool_cmd()
|
|
38
|
+
self.micrOS_node_config_path = "config/node_config.json"
|
|
34
39
|
self.dev_types_and_cmds = \
|
|
35
40
|
{'esp32':
|
|
36
|
-
{'erase': '
|
|
37
|
-
'deploy': '
|
|
41
|
+
{'erase': '{esptool_interface} --port {dev} erase_flash',
|
|
42
|
+
'deploy': '{esptool_interface} --chip esp32 --port {dev} --baud 460800 write_flash -z 0x1000 {micropython}',
|
|
38
43
|
'ampy_cmd': 'ampy -p {dev} -b 115200 -d 2 {args}',
|
|
39
44
|
'mpremote_cmd': None,
|
|
40
45
|
'cmd_line_info': '[!HINT!] PRESS [EN] BUTTON TO ENABLE DEVICE ERASE...'},
|
|
41
46
|
'esp32cam':
|
|
42
|
-
{'erase': '
|
|
43
|
-
'deploy': '
|
|
47
|
+
{'erase': '{esptool_interface} --port {dev} erase_flash',
|
|
48
|
+
'deploy': '{esptool_interface} --chip esp32 --port {dev} --baud 460800 write_flash -z 0x1000 {micropython}',
|
|
44
49
|
'mpremote_cmd': 'mpremote',
|
|
45
50
|
'cmd_line_info': '*** [!DISCLAIMER!] ***\n\tUSB copy not works with some serial interface\n\tCopy manually: toolkit/workspace/precompiled/micrOSloader.mpy\n\tNetwork.mpy Debug.mpy ConfigHandler.mpy main.py\n\tThen push OTA update over AP mode... Then you are done'},
|
|
46
51
|
'esp32s2':
|
|
47
|
-
{'erase': '
|
|
48
|
-
'deploy': '
|
|
52
|
+
{'erase': '{esptool_interface} --chip esp32s2 --port {dev} --after no_reset erase_flash',
|
|
53
|
+
'deploy': '{esptool_interface} --chip esp32s2 --port {dev} --after no_reset --baud 460800 write_flash -z 0x1000 {micropython}',
|
|
49
54
|
'mpremote_cmd': 'mpremote',
|
|
50
55
|
'cmd_line_info': '[!HINT!] Hold on Button 0 -> Press Button Reset -> Release Button 0 TO ENABLE DEVICE ERASE...'},
|
|
51
56
|
'tinypico':
|
|
52
|
-
{'erase': '
|
|
53
|
-
'deploy': '
|
|
54
|
-
'mpremote_cmd':
|
|
55
|
-
'cmd_line_info': ''},
|
|
56
|
-
'tinypico-usbc':
|
|
57
|
-
{'erase': 'esptool.py --port {dev} erase_flash',
|
|
58
|
-
'deploy': 'esptool.py --chip esp32 --port {dev} --baud 921600 write_flash -z 0x1000 {micropython}',
|
|
57
|
+
{'erase': '{esptool_interface} --port {dev} erase_flash',
|
|
58
|
+
'deploy': '{esptool_interface} --chip esp32 --port {dev} --baud 921600 write_flash -z 0x1000 {micropython}',
|
|
59
|
+
'mpremote_cmd': None, # USB update (node_config backup) not works - freeze with: mpremote
|
|
59
60
|
'ampy_cmd': 'ampy -p {dev} -b 115200 -d 2 {args}',
|
|
60
|
-
'mpremote_cmd': None,
|
|
61
61
|
'cmd_line_info': ''},
|
|
62
62
|
'rpi-pico-w':
|
|
63
63
|
{'erase': None,
|
|
@@ -65,18 +65,24 @@ class USB(Compile):
|
|
|
65
65
|
'mpremote_cmd': 'mpremote',
|
|
66
66
|
'cmd_line_info': '[!!!] Experimental device - no stable micropython yet'},
|
|
67
67
|
'esp32s3_spiram_oct':
|
|
68
|
-
{'erase': '
|
|
69
|
-
'deploy': '
|
|
68
|
+
{'erase': '{esptool_interface} --chip esp32s3 --port {dev} erase_flash',
|
|
69
|
+
'deploy': '{esptool_interface} --chip esp32s3 --port {dev} write_flash -z 0 {micropython}',
|
|
70
70
|
'mpremote_cmd': 'mpremote',
|
|
71
|
-
'cmd_line_info': '[
|
|
71
|
+
'cmd_line_info': '[!HINNT!] Press boot button under connecting the board over USB: enables flash erase'},
|
|
72
72
|
'esp32s3':
|
|
73
|
-
{'erase': '
|
|
74
|
-
'deploy': '
|
|
73
|
+
{'erase': '{esptool_interface} --chip esp32s3 --port {dev} erase_flash',
|
|
74
|
+
'deploy': '{esptool_interface} --chip esp32s3 --port {dev} write_flash -z 0 {micropython}',
|
|
75
75
|
'mpremote_cmd': 'mpremote',
|
|
76
|
-
'
|
|
76
|
+
#'ampy_cmd': 'ampy -p {dev} -b 115200 -d 2 {args}',
|
|
77
|
+
'cmd_line_info': '[!HINNT!] Press boot button under connecting board over USB: enables flash erase'},
|
|
77
78
|
'esp32c3':
|
|
78
|
-
{'erase': '
|
|
79
|
-
'deploy': '
|
|
79
|
+
{'erase': '{esptool_interface} --chip esp32c3 --port {dev} erase_flash',
|
|
80
|
+
'deploy': '{esptool_interface} --chip esp32c3 --port {dev} --baud 460800 write_flash -z 0x0 {micropython}',
|
|
81
|
+
'mpremote_cmd': 'mpremote',
|
|
82
|
+
'cmd_line_info': '[!HINT!] Fully automatic deployment...'},
|
|
83
|
+
'esp32c6':
|
|
84
|
+
{'erase': '{esptool_interface} --chip esp32c6 --port {dev} erase_flash',
|
|
85
|
+
'deploy': '{esptool_interface} --chip esp32c6 --port {dev} --baud 460800 write_flash -z 0x0 {micropython}',
|
|
80
86
|
'mpremote_cmd': 'mpremote',
|
|
81
87
|
'cmd_line_info': '[!HINT!] Fully automatic deployment...'},
|
|
82
88
|
}
|
|
@@ -85,6 +91,22 @@ class USB(Compile):
|
|
|
85
91
|
install_usb_serial_driver()
|
|
86
92
|
USB.usb_driver_ok = True
|
|
87
93
|
|
|
94
|
+
@staticmethod
|
|
95
|
+
def get_valid_esptool_cmd():
|
|
96
|
+
# Windows / Linux / MacOS installation dependencies
|
|
97
|
+
command_possibilities = ("esptool.py", "esptool")
|
|
98
|
+
for cmd in command_possibilities:
|
|
99
|
+
validate_cmd = f"{cmd} -h"
|
|
100
|
+
exitcode, stdout, stderr = LocalMachine.CommandHandler.run_command(validate_cmd, shell=True)
|
|
101
|
+
if exitcode == 0:
|
|
102
|
+
return cmd
|
|
103
|
+
print("!"*60)
|
|
104
|
+
print(f"{Colors.ERR}No esptool available... USB features are not available{Colors.NC}")
|
|
105
|
+
print("!"*60)
|
|
106
|
+
time.sleep(5)
|
|
107
|
+
return command_possibilities[0] # Default
|
|
108
|
+
|
|
109
|
+
|
|
88
110
|
#############################
|
|
89
111
|
# Main interfaces #
|
|
90
112
|
#############################
|
|
@@ -137,7 +159,7 @@ class USB(Compile):
|
|
|
137
159
|
|
|
138
160
|
selected_device = self.get_devices()[0]
|
|
139
161
|
print("selected_device_port: {}".format(selected_device))
|
|
140
|
-
command = erase_cmd.format(dev=selected_device)
|
|
162
|
+
command = erase_cmd.format(dev=selected_device, esptool_interface=self.esptool_interface)
|
|
141
163
|
self.console("CMD: {}".format(command))
|
|
142
164
|
if self.dry_run:
|
|
143
165
|
exitcode = 0
|
|
@@ -171,7 +193,8 @@ class USB(Compile):
|
|
|
171
193
|
|
|
172
194
|
selected_device = self.get_devices()[0]
|
|
173
195
|
selected_micropython = self.selected_micropython_bin
|
|
174
|
-
command = deploy_cmd.format(dev=selected_device, micropython=selected_micropython
|
|
196
|
+
command = deploy_cmd.format(dev=selected_device, micropython=selected_micropython,
|
|
197
|
+
esptool_interface=self.esptool_interface)
|
|
175
198
|
self.console("CMD: {}".format(command))
|
|
176
199
|
if self.dry_run:
|
|
177
200
|
exitcode = 0
|
|
@@ -187,6 +210,38 @@ class USB(Compile):
|
|
|
187
210
|
self.console("Deployment failed.\n{} - {}".format(stdout, stderr), state='err')
|
|
188
211
|
return False
|
|
189
212
|
|
|
213
|
+
def _mkdir_on_dev(self, folders:list):
|
|
214
|
+
mpremote_cmd = self.dev_types_and_cmds[self.selected_device_type]['mpremote_cmd']
|
|
215
|
+
device = self.get_devices()[0]
|
|
216
|
+
if mpremote_cmd is None:
|
|
217
|
+
# Legacy ampy command (esp32 auto reboot tolerance...)
|
|
218
|
+
mkdir_cmd = self.dev_types_and_cmds[self.selected_device_type]['ampy_cmd'].format(dev=device, args=f'mkdir')
|
|
219
|
+
else:
|
|
220
|
+
mkdir_cmd = f'{mpremote_cmd} fs mkdir'
|
|
221
|
+
|
|
222
|
+
status = 0
|
|
223
|
+
for folder in folders:
|
|
224
|
+
_mkdir_cmd = f"{mkdir_cmd} {folder}"
|
|
225
|
+
self.console(f"Create directory on device: {_mkdir_cmd}")
|
|
226
|
+
if self.dry_run:
|
|
227
|
+
pass
|
|
228
|
+
else:
|
|
229
|
+
try:
|
|
230
|
+
exitcode, stdout, stderr = LocalMachine.CommandHandler.run_command(_mkdir_cmd, shell=True)
|
|
231
|
+
if exitcode != 0:
|
|
232
|
+
verdict = stdout + stderr
|
|
233
|
+
if "File exists" in verdict or "Directory already exists" in verdict:
|
|
234
|
+
exitcode = 0
|
|
235
|
+
else:
|
|
236
|
+
self.console(f"MKDIR ERROR:\n{stdout}\n{stderr}", state="err")
|
|
237
|
+
except Exception as e:
|
|
238
|
+
self.console(f"MKDIR ERROR {_mkdir_cmd}: {e}", state="err")
|
|
239
|
+
exitcode = 1
|
|
240
|
+
status += exitcode
|
|
241
|
+
|
|
242
|
+
return True if status == 0 else False
|
|
243
|
+
|
|
244
|
+
|
|
190
245
|
def put_micros_to_dev(self):
|
|
191
246
|
self.select_board_n_micropython()
|
|
192
247
|
status = True
|
|
@@ -203,17 +258,20 @@ class USB(Compile):
|
|
|
203
258
|
self.console(f"... wait for reset {10-k} sec", state='imp')
|
|
204
259
|
time.sleep(1)
|
|
205
260
|
|
|
206
|
-
|
|
207
|
-
|
|
208
|
-
|
|
261
|
+
# Parse micrOS resources with folders
|
|
262
|
+
_source_to_put_device, dir_list_to_create = micros_resource_list(self.precompiled_micrOS_dir_path)
|
|
263
|
+
self.console(f"CREATE FOLDERS: {dir_list_to_create}", state="ok")
|
|
264
|
+
# Create sub folders
|
|
265
|
+
if not self._mkdir_on_dev(dir_list_to_create):
|
|
266
|
+
self.console(f"Error creating directories on device: {dir_list_to_create}")
|
|
267
|
+
sys.exit(1)
|
|
268
|
+
# Generate resource list to be put on the device
|
|
269
|
+
source_to_put_device = list([s.replace(self.precompiled_micrOS_dir_path + os.sep, '') for s in _source_to_put_device])
|
|
209
270
|
# Set source order - main, boot
|
|
210
|
-
source_to_put_device.append(source_to_put_device.pop(source_to_put_device.index(
|
|
211
|
-
try:
|
|
212
|
-
# PIP deployment generates this ...
|
|
213
|
-
source_to_put_device.remove('__pycache__') # remove if accidentally left here
|
|
214
|
-
except:
|
|
215
|
-
pass
|
|
271
|
+
source_to_put_device.append(source_to_put_device.pop(source_to_put_device.index("main.py")))
|
|
216
272
|
|
|
273
|
+
mpremote_cmd = self.dev_types_and_cmds[self.selected_device_type]['mpremote_cmd']
|
|
274
|
+
device = self.get_devices()[0]
|
|
217
275
|
# Change workdir
|
|
218
276
|
workdir_handler = LocalMachine.SimplePopPushd()
|
|
219
277
|
workdir_handler.pushd(self.precompiled_micrOS_dir_path)
|
|
@@ -223,9 +281,9 @@ class USB(Compile):
|
|
|
223
281
|
self.console("[{}%] micrOS deploy via USB - {}".format(percent, device))
|
|
224
282
|
if mpremote_cmd is None:
|
|
225
283
|
# Legacy ampy command (esp32 auto reboot tolerance...)
|
|
226
|
-
command = self.dev_types_and_cmds[self.selected_device_type]['ampy_cmd'].format(dev=device, args=f'put {source}')
|
|
284
|
+
command = self.dev_types_and_cmds[self.selected_device_type]['ampy_cmd'].format(dev=device, args=f'put {source} /{source}')
|
|
227
285
|
else:
|
|
228
|
-
command = f'{mpremote_cmd} cp {source} :{source}'
|
|
286
|
+
command = f'{mpremote_cmd} fs cp {source} :{source}' # new mpremote <1.24.1
|
|
229
287
|
if ' ' in source:
|
|
230
288
|
self.console("[{}%][SKIP] micrOS deploy via USB: {}".format(percent, command))
|
|
231
289
|
continue
|
|
@@ -240,17 +298,17 @@ class USB(Compile):
|
|
|
240
298
|
def update_micros_via_usb(self, force=False):
|
|
241
299
|
self.select_board_n_micropython()
|
|
242
300
|
exitcode, stdout, stderr = self.__get_node_config()
|
|
243
|
-
print(self.__get_node_config())
|
|
244
301
|
if exitcode == 0:
|
|
245
302
|
self.console("Get Node config (node_config.json):")
|
|
246
303
|
pprint.PrettyPrinter(indent=4).pprint(json.loads(stdout))
|
|
247
304
|
repo_version, node_version = self.get_micrOS_version(stdout)
|
|
248
305
|
self.console("Repo version: {} Node_version: {}".format(repo_version, node_version))
|
|
249
306
|
if repo_version != node_version or force:
|
|
307
|
+
self._cleanup_precompiled_dir()
|
|
250
308
|
self.console("Update necesarry {} -> {}".format(node_version, repo_version), state='ok')
|
|
251
309
|
state = self.__override_local_config_from_node(node_config=stdout)
|
|
252
310
|
if state:
|
|
253
|
-
self.deploy_micros(
|
|
311
|
+
self.deploy_micros(restore_config=False, cleanup_workdir=False)
|
|
254
312
|
else:
|
|
255
313
|
self.console("Saving node config failed - SKIP update/redeploy", state='err')
|
|
256
314
|
else:
|
|
@@ -264,17 +322,17 @@ class USB(Compile):
|
|
|
264
322
|
self.execution_verdict.append("[OK] usb_update was finished")
|
|
265
323
|
return True
|
|
266
324
|
|
|
267
|
-
def deploy_micros(self,
|
|
325
|
+
def deploy_micros(self, restore_config=True, cleanup_workdir=True):
|
|
268
326
|
"""
|
|
269
327
|
Clean board deployment with micropython + micrOS
|
|
270
|
-
:param
|
|
271
|
-
:param
|
|
328
|
+
:param restore_config: restore and create node config
|
|
329
|
+
:param cleanup_workdir: clean up workdir as part of precompile
|
|
272
330
|
:return: None
|
|
273
331
|
"""
|
|
274
332
|
self.select_board_n_micropython()
|
|
275
|
-
|
|
276
|
-
|
|
277
|
-
if
|
|
333
|
+
self.precompile_micros(cleanup=cleanup_workdir)
|
|
334
|
+
|
|
335
|
+
if restore_config:
|
|
278
336
|
self._restore_and_create_node_config()
|
|
279
337
|
|
|
280
338
|
is_erased = False
|
|
@@ -286,9 +344,7 @@ class USB(Compile):
|
|
|
286
344
|
break
|
|
287
345
|
if is_erased:
|
|
288
346
|
if self.deploy_micropython_dev():
|
|
289
|
-
time.sleep(
|
|
290
|
-
self.precompile_micros()
|
|
291
|
-
time.sleep(2)
|
|
347
|
+
time.sleep(3)
|
|
292
348
|
self.put_micros_to_dev()
|
|
293
349
|
self._archive_node_config()
|
|
294
350
|
else:
|
|
@@ -328,9 +384,10 @@ class USB(Compile):
|
|
|
328
384
|
# List USB devices on Windows
|
|
329
385
|
import serial.tools.list_ports as serial_port_list # Import here (only windows...), package not exists on some platforms
|
|
330
386
|
ports = list(serial_port_list.comports())
|
|
387
|
+
win_known_devices = ("CP210", "CH340", "CH343", "CH9102")
|
|
331
388
|
for item in ports:
|
|
332
389
|
self.console(f'[Win] Com device: {item.description}')
|
|
333
|
-
if
|
|
390
|
+
if any(device in str(item.description) for device in win_known_devices):
|
|
334
391
|
micros_devices.append(item.device)
|
|
335
392
|
self.console("Device was found: {}".format(item.device, state="imp"))
|
|
336
393
|
else:
|
|
@@ -357,7 +414,7 @@ class USB(Compile):
|
|
|
357
414
|
#############################
|
|
358
415
|
|
|
359
416
|
def _purge_node_config_from_workdir(self):
|
|
360
|
-
path = os.path.join(self.precompiled_micrOS_dir_path,
|
|
417
|
+
path = os.path.join(self.precompiled_micrOS_dir_path, self.micrOS_node_config_path)
|
|
361
418
|
LocalMachine.FileHandler().remove(path, ignore=False)
|
|
362
419
|
|
|
363
420
|
def _restore_and_create_node_config(self):
|
|
@@ -373,24 +430,22 @@ class USB(Compile):
|
|
|
373
430
|
self.console(" [{}{}{}] {}".format(Colors.BOLD, index, Colors.NC, conf))
|
|
374
431
|
self.console(" [{}{}{}] {}".format(Colors.BOLD, index + 1, Colors.NC, 'NEW'))
|
|
375
432
|
self.console(" [{}{}{}] {}".format(Colors.BOLD, index + 2, Colors.NC, 'SKIP'))
|
|
376
|
-
conf_list.append(
|
|
433
|
+
conf_list.append(self.micrOS_node_config_path)
|
|
377
434
|
conf_list.append(os.path.join('SKIP'))
|
|
378
435
|
selected_index = int(input("Select index: "))
|
|
379
436
|
# Use (already existing) selected config to restore
|
|
380
437
|
selected_config = conf_list[selected_index]
|
|
381
|
-
|
|
438
|
+
target_path = os.path.join(self.precompiled_micrOS_dir_path, self.micrOS_node_config_path)
|
|
439
|
+
if selected_config.endswith(".json"):
|
|
382
440
|
# Restore saved config
|
|
383
|
-
target_path = os.path.join(self.precompiled_micrOS_dir_path, selected_config.split('-')[1])
|
|
384
441
|
source_path = os.path.join(self.micrOS_node_config_archive, selected_config)
|
|
385
442
|
elif selected_index == len(conf_list) - 1:
|
|
386
443
|
# SKIP restore config - use the local version in mpy-micrOS folder
|
|
387
|
-
target_path = os.path.join(self.precompiled_micrOS_dir_path, 'node_config.json')
|
|
388
444
|
source_path = None
|
|
389
445
|
else:
|
|
390
446
|
# Create new config - from micrOS folder path -> mpy-micrOS folder
|
|
391
|
-
target_path = os.path.join(self.precompiled_micrOS_dir_path, selected_config)
|
|
392
447
|
source_path = os.path.join(self.micrOS_dir_path, selected_config)
|
|
393
|
-
self.console("Restore config: {} -> {}"
|
|
448
|
+
self.console(f"Restore config: {source_path} -> {target_path}")
|
|
394
449
|
if source_path is not None:
|
|
395
450
|
LocalMachine.FileHandler.copy(source_path, target_path)
|
|
396
451
|
|
|
@@ -427,9 +482,11 @@ class USB(Compile):
|
|
|
427
482
|
else:
|
|
428
483
|
self.console("Profile was selected: {}{}{}".format(Colors.OK, profile_list[int(profile)], Colors.NC))
|
|
429
484
|
# Read default conf
|
|
430
|
-
default_conf_path = os.path.join(self.
|
|
485
|
+
default_conf_path = os.path.join(self.micrOS_dir_path, self.micrOS_node_config_path)
|
|
431
486
|
if not os.path.isfile(default_conf_path):
|
|
432
|
-
self.
|
|
487
|
+
if not self.__generate_default_config():
|
|
488
|
+
self.console(f"Missing default config: {default_conf_path}", state="warn")
|
|
489
|
+
return None
|
|
433
490
|
with open(default_conf_path, 'r') as f:
|
|
434
491
|
default_conf_dict = json.load(f)
|
|
435
492
|
# Read profile
|
|
@@ -494,10 +551,9 @@ class USB(Compile):
|
|
|
494
551
|
create_default_config_command = "{} Config.py".format(self.python_interpreter)
|
|
495
552
|
if not self.dry_run:
|
|
496
553
|
# Remove actual defualt config
|
|
497
|
-
LocalMachine.FileHandler.remove(os.path.join(self.micrOS_dir_path,
|
|
554
|
+
LocalMachine.FileHandler.remove(os.path.join(self.micrOS_dir_path, self.micrOS_node_config_path))
|
|
498
555
|
# Create default config
|
|
499
|
-
exitcode, stdout, stderr = LocalMachine.CommandHandler.run_command(create_default_config_command,
|
|
500
|
-
shell=True)
|
|
556
|
+
exitcode, stdout, stderr = LocalMachine.CommandHandler.run_command(create_default_config_command, shell=True)
|
|
501
557
|
else:
|
|
502
558
|
exitcode = 0
|
|
503
559
|
# Restore workdir
|
|
@@ -526,7 +582,7 @@ class USB(Compile):
|
|
|
526
582
|
|
|
527
583
|
def __validate_json(self):
|
|
528
584
|
is_valid = True
|
|
529
|
-
local_config_path = os.path.join(self.precompiled_micrOS_dir_path,
|
|
585
|
+
local_config_path = os.path.join(self.precompiled_micrOS_dir_path, self.micrOS_node_config_path)
|
|
530
586
|
try:
|
|
531
587
|
if os.path.isfile(local_config_path):
|
|
532
588
|
with open(local_config_path, 'r') as f:
|
|
@@ -538,6 +594,9 @@ class USB(Compile):
|
|
|
538
594
|
return is_valid
|
|
539
595
|
|
|
540
596
|
def __safe_execute_mpremote_cmd(self, command, source, retry=8):
|
|
597
|
+
if sys.platform.startswith('win'):
|
|
598
|
+
# Because windows is a shit... python commands requires unix like separators
|
|
599
|
+
command = command.replace('\\', '/')
|
|
541
600
|
retry_orig = retry
|
|
542
601
|
status = False
|
|
543
602
|
for retry in range(1, retry_orig):
|
|
@@ -592,24 +651,34 @@ class USB(Compile):
|
|
|
592
651
|
return processid
|
|
593
652
|
|
|
594
653
|
def __get_node_config(self):
|
|
654
|
+
|
|
655
|
+
def _get_config(path):
|
|
656
|
+
mpremote_cmd = self.dev_types_and_cmds[self.selected_device_type]['mpremote_cmd']
|
|
657
|
+
if mpremote_cmd is None:
|
|
658
|
+
# Legacy ampy command (esp32 auto reboot tolerance...)
|
|
659
|
+
_command = (self.dev_types_and_cmds[self.selected_device_type]['ampy_cmd']
|
|
660
|
+
.format(dev=device, args=f'get {path}'))
|
|
661
|
+
else:
|
|
662
|
+
_command = f'{mpremote_cmd} fs cat {path}' # new mpremote <1.24.1
|
|
663
|
+
_exitcode, _stdout, _stderr = LocalMachine.CommandHandler.run_command(_command, shell=True)
|
|
664
|
+
return _exitcode, _stdout, _stderr
|
|
665
|
+
|
|
595
666
|
device = self.get_devices()[0]
|
|
596
667
|
self.console(f"Get node config over USB: {device}")
|
|
597
|
-
|
|
598
|
-
|
|
599
|
-
# Legacy ampy command (esp32 auto reboot tolerance...)
|
|
600
|
-
command = self.dev_types_and_cmds[self.selected_device_type]['ampy_cmd'].format(dev=device, args='get node_config.json')
|
|
668
|
+
if self.dry_run:
|
|
669
|
+
exitcode, stdout, stderr = 0, '{"key": "Dummy stdout"}', ''
|
|
601
670
|
else:
|
|
602
|
-
|
|
603
|
-
|
|
604
|
-
|
|
671
|
+
exitcode, stdout, stderr = _get_config("node_config.json") # Legacy
|
|
672
|
+
if exitcode != 0:
|
|
673
|
+
exitcode, stdout, stderr = _get_config("/" + self.micrOS_node_config_path) # New
|
|
605
674
|
self._archive_node_config()
|
|
606
|
-
|
|
607
|
-
exitcode = 0
|
|
608
|
-
stdout = '{"key": "Dummy stdout"}'
|
|
609
|
-
stderr = ''
|
|
675
|
+
|
|
610
676
|
if '\n' in stdout:
|
|
611
677
|
stdout = stdout.strip().splitlines()
|
|
612
|
-
|
|
678
|
+
try:
|
|
679
|
+
stdout = str([line for line in stdout if '{' in line and '}' in line][0])
|
|
680
|
+
except Exception as ejson:
|
|
681
|
+
raise Exception(f"Invalid json format from device: {ejson}")
|
|
613
682
|
return exitcode, stdout, stderr
|
|
614
683
|
|
|
615
684
|
def backup_node_config(self):
|
|
@@ -624,12 +693,12 @@ class USB(Compile):
|
|
|
624
693
|
if state:
|
|
625
694
|
self._archive_node_config()
|
|
626
695
|
return True
|
|
627
|
-
|
|
696
|
+
self.console("exitcode: {}\n{}\n{}".format(exitcode, stdout, stderr))
|
|
628
697
|
return False
|
|
629
698
|
|
|
630
699
|
def _archive_node_config(self):
|
|
631
700
|
self.console("ARCHIVE NODE_CONFIG.JSON")
|
|
632
|
-
local_node_config = os.path.join(self.precompiled_micrOS_dir_path,
|
|
701
|
+
local_node_config = os.path.join(self.precompiled_micrOS_dir_path, self.micrOS_node_config_path)
|
|
633
702
|
if os.path.isfile(local_node_config):
|
|
634
703
|
with open(local_node_config, 'r') as f:
|
|
635
704
|
node_devfid = json.load(f)['devfid']
|
|
@@ -641,8 +710,9 @@ class USB(Compile):
|
|
|
641
710
|
LocalMachine.FileHandler.copy(local_node_config, archive_node_config)
|
|
642
711
|
|
|
643
712
|
def __override_local_config_from_node(self, node_config=None):
|
|
644
|
-
|
|
645
|
-
|
|
713
|
+
self.ensure_precompiled_target_dir("config")
|
|
714
|
+
node_config_path = os.path.join(self.precompiled_micrOS_dir_path, self.micrOS_node_config_path)
|
|
715
|
+
self.console(f"Overwrite node_config.json with connected node config: {node_config_path}", state='ok')
|
|
646
716
|
if not self.dry_run and node_config is not None:
|
|
647
717
|
with open(node_config_path, 'w') as f:
|
|
648
718
|
f.write(node_config)
|
|
@@ -656,7 +726,7 @@ class USB(Compile):
|
|
|
656
726
|
# Legacy ampy command (esp32 auto reboot tolerance...)
|
|
657
727
|
command = self.dev_types_and_cmds[self.selected_device_type]['ampy_cmd'].format(dev=device, args='ls')
|
|
658
728
|
else:
|
|
659
|
-
command = f"{mpremote_cmd} ls"
|
|
729
|
+
command = f"{mpremote_cmd} fs ls" # new mpremote <1.24.1
|
|
660
730
|
if not self.dry_run:
|
|
661
731
|
self.console("CMD: {}".format(command))
|
|
662
732
|
exitcode, stdout, stderr = LocalMachine.CommandHandler.run_command(command, shell=True, debug=False)
|