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/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
|
|
@@ -397,7 +404,32 @@ class OTA(Compile):
|
|
|
397
404
|
print(f"[SIM] 'OTA' COPY FILES... {source} -> {target}")
|
|
398
405
|
LocalMachine.FileHandler().copy(source, target)
|
|
399
406
|
|
|
400
|
-
|
|
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):
|
|
401
433
|
"""
|
|
402
434
|
Generic file uploader for micrOS - over webrepl
|
|
403
435
|
info: https://techoverflow.net/2020/02/22/how-to-upload-files-to-micropython-using-webrepl-using-webrepl_cli-py/
|
|
@@ -406,7 +438,11 @@ class OTA(Compile):
|
|
|
406
438
|
upload_path_list: file path list to upload
|
|
407
439
|
ota_password - accessing webrepl to upload files
|
|
408
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)
|
|
409
442
|
"""
|
|
443
|
+
if upload_path_list is None:
|
|
444
|
+
upload_path_list = []
|
|
445
|
+
|
|
410
446
|
if device[0] == "__simulator__":
|
|
411
447
|
OTA.sim_ota_update(upload_path_list, force_lm)
|
|
412
448
|
return
|
|
@@ -453,11 +489,11 @@ class OTA(Compile):
|
|
|
453
489
|
# Copy retry mechanism
|
|
454
490
|
exitcode = -1
|
|
455
491
|
source_name = os.path.basename(source)
|
|
456
|
-
|
|
457
|
-
|
|
458
|
-
|
|
459
|
-
|
|
460
|
-
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, '')
|
|
461
497
|
|
|
462
498
|
command = '{python} {api} -p {pwd} {input_file} {host}:{target_path}'.format(
|
|
463
499
|
python=self.python_interpreter,
|
toolkit/DevEnvUSB.py
CHANGED
|
@@ -13,12 +13,14 @@ try:
|
|
|
13
13
|
from .lib import LocalMachine
|
|
14
14
|
from .lib.TerminalColors import Colors
|
|
15
15
|
from .lib.SerialDriverHandler import install_usb_serial_driver
|
|
16
|
+
from .lib.MicrosFiles import micros_resource_list
|
|
16
17
|
except Exception as e:
|
|
17
18
|
print("Import warning __name__:{}: {}".format(__name__, e))
|
|
18
19
|
from DevEnvCompile import Compile
|
|
19
20
|
from lib import LocalMachine
|
|
20
21
|
from lib.TerminalColors import Colors
|
|
21
22
|
from lib.SerialDriverHandler import install_usb_serial_driver
|
|
23
|
+
from lib.MicrosFiles import micros_resource_list
|
|
22
24
|
|
|
23
25
|
|
|
24
26
|
class USB(Compile):
|
|
@@ -33,6 +35,7 @@ class USB(Compile):
|
|
|
33
35
|
self.micrOS_node_config_archive = os.path.join(MYPATH, "user_data/node_config_archive")
|
|
34
36
|
self.node_config_profiles_path = os.path.join(MYPATH, "../micrOS/release_info/node_config_profiles/")
|
|
35
37
|
self.esptool_interface = self.get_valid_esptool_cmd()
|
|
38
|
+
self.micrOS_node_config_path = "config/node_config.json"
|
|
36
39
|
self.dev_types_and_cmds = \
|
|
37
40
|
{'esp32':
|
|
38
41
|
{'erase': '{esptool_interface} --port {dev} erase_flash',
|
|
@@ -65,17 +68,23 @@ class USB(Compile):
|
|
|
65
68
|
{'erase': '{esptool_interface} --chip esp32s3 --port {dev} erase_flash',
|
|
66
69
|
'deploy': '{esptool_interface} --chip esp32s3 --port {dev} write_flash -z 0 {micropython}',
|
|
67
70
|
'mpremote_cmd': 'mpremote',
|
|
68
|
-
'cmd_line_info': '[
|
|
71
|
+
'cmd_line_info': '[!HINNT!] Press boot button under connecting the board over USB: enables flash erase'},
|
|
69
72
|
'esp32s3':
|
|
70
73
|
{'erase': '{esptool_interface} --chip esp32s3 --port {dev} erase_flash',
|
|
71
74
|
'deploy': '{esptool_interface} --chip esp32s3 --port {dev} write_flash -z 0 {micropython}',
|
|
72
75
|
'mpremote_cmd': 'mpremote',
|
|
73
|
-
'
|
|
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'},
|
|
74
78
|
'esp32c3':
|
|
75
79
|
{'erase': '{esptool_interface} --chip esp32c3 --port {dev} erase_flash',
|
|
76
80
|
'deploy': '{esptool_interface} --chip esp32c3 --port {dev} --baud 460800 write_flash -z 0x0 {micropython}',
|
|
77
81
|
'mpremote_cmd': 'mpremote',
|
|
78
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}',
|
|
86
|
+
'mpremote_cmd': 'mpremote',
|
|
87
|
+
'cmd_line_info': '[!HINT!] Fully automatic deployment...'},
|
|
79
88
|
}
|
|
80
89
|
if not USB.usb_driver_ok:
|
|
81
90
|
# Optimization - driver check
|
|
@@ -201,6 +210,38 @@ class USB(Compile):
|
|
|
201
210
|
self.console("Deployment failed.\n{} - {}".format(stdout, stderr), state='err')
|
|
202
211
|
return False
|
|
203
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
|
+
|
|
204
245
|
def put_micros_to_dev(self):
|
|
205
246
|
self.select_board_n_micropython()
|
|
206
247
|
status = True
|
|
@@ -217,17 +258,20 @@ class USB(Compile):
|
|
|
217
258
|
self.console(f"... wait for reset {10-k} sec", state='imp')
|
|
218
259
|
time.sleep(1)
|
|
219
260
|
|
|
220
|
-
|
|
221
|
-
|
|
222
|
-
|
|
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])
|
|
223
270
|
# Set source order - main, boot
|
|
224
|
-
source_to_put_device.append(source_to_put_device.pop(source_to_put_device.index(
|
|
225
|
-
try:
|
|
226
|
-
# PIP deployment generates this ...
|
|
227
|
-
source_to_put_device.remove('__pycache__') # remove if accidentally left here
|
|
228
|
-
except:
|
|
229
|
-
pass
|
|
271
|
+
source_to_put_device.append(source_to_put_device.pop(source_to_put_device.index("main.py")))
|
|
230
272
|
|
|
273
|
+
mpremote_cmd = self.dev_types_and_cmds[self.selected_device_type]['mpremote_cmd']
|
|
274
|
+
device = self.get_devices()[0]
|
|
231
275
|
# Change workdir
|
|
232
276
|
workdir_handler = LocalMachine.SimplePopPushd()
|
|
233
277
|
workdir_handler.pushd(self.precompiled_micrOS_dir_path)
|
|
@@ -237,9 +281,9 @@ class USB(Compile):
|
|
|
237
281
|
self.console("[{}%] micrOS deploy via USB - {}".format(percent, device))
|
|
238
282
|
if mpremote_cmd is None:
|
|
239
283
|
# Legacy ampy command (esp32 auto reboot tolerance...)
|
|
240
|
-
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}')
|
|
241
285
|
else:
|
|
242
|
-
command = f'{mpremote_cmd} cp {source} :{source}'
|
|
286
|
+
command = f'{mpremote_cmd} fs cp {source} :{source}' # new mpremote <1.24.1
|
|
243
287
|
if ' ' in source:
|
|
244
288
|
self.console("[{}%][SKIP] micrOS deploy via USB: {}".format(percent, command))
|
|
245
289
|
continue
|
|
@@ -254,17 +298,17 @@ class USB(Compile):
|
|
|
254
298
|
def update_micros_via_usb(self, force=False):
|
|
255
299
|
self.select_board_n_micropython()
|
|
256
300
|
exitcode, stdout, stderr = self.__get_node_config()
|
|
257
|
-
print(self.__get_node_config())
|
|
258
301
|
if exitcode == 0:
|
|
259
302
|
self.console("Get Node config (node_config.json):")
|
|
260
303
|
pprint.PrettyPrinter(indent=4).pprint(json.loads(stdout))
|
|
261
304
|
repo_version, node_version = self.get_micrOS_version(stdout)
|
|
262
305
|
self.console("Repo version: {} Node_version: {}".format(repo_version, node_version))
|
|
263
306
|
if repo_version != node_version or force:
|
|
307
|
+
self._cleanup_precompiled_dir()
|
|
264
308
|
self.console("Update necesarry {} -> {}".format(node_version, repo_version), state='ok')
|
|
265
309
|
state = self.__override_local_config_from_node(node_config=stdout)
|
|
266
310
|
if state:
|
|
267
|
-
self.deploy_micros(
|
|
311
|
+
self.deploy_micros(restore_config=False, cleanup_workdir=False)
|
|
268
312
|
else:
|
|
269
313
|
self.console("Saving node config failed - SKIP update/redeploy", state='err')
|
|
270
314
|
else:
|
|
@@ -278,17 +322,17 @@ class USB(Compile):
|
|
|
278
322
|
self.execution_verdict.append("[OK] usb_update was finished")
|
|
279
323
|
return True
|
|
280
324
|
|
|
281
|
-
def deploy_micros(self,
|
|
325
|
+
def deploy_micros(self, restore_config=True, cleanup_workdir=True):
|
|
282
326
|
"""
|
|
283
327
|
Clean board deployment with micropython + micrOS
|
|
284
|
-
:param
|
|
285
|
-
:param
|
|
328
|
+
:param restore_config: restore and create node config
|
|
329
|
+
:param cleanup_workdir: clean up workdir as part of precompile
|
|
286
330
|
:return: None
|
|
287
331
|
"""
|
|
288
332
|
self.select_board_n_micropython()
|
|
289
|
-
|
|
290
|
-
|
|
291
|
-
if
|
|
333
|
+
self.precompile_micros(cleanup=cleanup_workdir)
|
|
334
|
+
|
|
335
|
+
if restore_config:
|
|
292
336
|
self._restore_and_create_node_config()
|
|
293
337
|
|
|
294
338
|
is_erased = False
|
|
@@ -300,9 +344,7 @@ class USB(Compile):
|
|
|
300
344
|
break
|
|
301
345
|
if is_erased:
|
|
302
346
|
if self.deploy_micropython_dev():
|
|
303
|
-
time.sleep(
|
|
304
|
-
self.precompile_micros()
|
|
305
|
-
time.sleep(2)
|
|
347
|
+
time.sleep(3)
|
|
306
348
|
self.put_micros_to_dev()
|
|
307
349
|
self._archive_node_config()
|
|
308
350
|
else:
|
|
@@ -342,7 +384,7 @@ class USB(Compile):
|
|
|
342
384
|
# List USB devices on Windows
|
|
343
385
|
import serial.tools.list_ports as serial_port_list # Import here (only windows...), package not exists on some platforms
|
|
344
386
|
ports = list(serial_port_list.comports())
|
|
345
|
-
win_known_devices = ("CP210", "CH340", "CH343")
|
|
387
|
+
win_known_devices = ("CP210", "CH340", "CH343", "CH9102")
|
|
346
388
|
for item in ports:
|
|
347
389
|
self.console(f'[Win] Com device: {item.description}')
|
|
348
390
|
if any(device in str(item.description) for device in win_known_devices):
|
|
@@ -372,7 +414,7 @@ class USB(Compile):
|
|
|
372
414
|
#############################
|
|
373
415
|
|
|
374
416
|
def _purge_node_config_from_workdir(self):
|
|
375
|
-
path = os.path.join(self.precompiled_micrOS_dir_path,
|
|
417
|
+
path = os.path.join(self.precompiled_micrOS_dir_path, self.micrOS_node_config_path)
|
|
376
418
|
LocalMachine.FileHandler().remove(path, ignore=False)
|
|
377
419
|
|
|
378
420
|
def _restore_and_create_node_config(self):
|
|
@@ -388,24 +430,22 @@ class USB(Compile):
|
|
|
388
430
|
self.console(" [{}{}{}] {}".format(Colors.BOLD, index, Colors.NC, conf))
|
|
389
431
|
self.console(" [{}{}{}] {}".format(Colors.BOLD, index + 1, Colors.NC, 'NEW'))
|
|
390
432
|
self.console(" [{}{}{}] {}".format(Colors.BOLD, index + 2, Colors.NC, 'SKIP'))
|
|
391
|
-
conf_list.append(
|
|
433
|
+
conf_list.append(self.micrOS_node_config_path)
|
|
392
434
|
conf_list.append(os.path.join('SKIP'))
|
|
393
435
|
selected_index = int(input("Select index: "))
|
|
394
436
|
# Use (already existing) selected config to restore
|
|
395
437
|
selected_config = conf_list[selected_index]
|
|
396
|
-
|
|
438
|
+
target_path = os.path.join(self.precompiled_micrOS_dir_path, self.micrOS_node_config_path)
|
|
439
|
+
if selected_config.endswith(".json"):
|
|
397
440
|
# Restore saved config
|
|
398
|
-
target_path = os.path.join(self.precompiled_micrOS_dir_path, selected_config.split('-')[1])
|
|
399
441
|
source_path = os.path.join(self.micrOS_node_config_archive, selected_config)
|
|
400
442
|
elif selected_index == len(conf_list) - 1:
|
|
401
443
|
# SKIP restore config - use the local version in mpy-micrOS folder
|
|
402
|
-
target_path = os.path.join(self.precompiled_micrOS_dir_path, 'node_config.json')
|
|
403
444
|
source_path = None
|
|
404
445
|
else:
|
|
405
446
|
# Create new config - from micrOS folder path -> mpy-micrOS folder
|
|
406
|
-
target_path = os.path.join(self.precompiled_micrOS_dir_path, selected_config)
|
|
407
447
|
source_path = os.path.join(self.micrOS_dir_path, selected_config)
|
|
408
|
-
self.console("Restore config: {} -> {}"
|
|
448
|
+
self.console(f"Restore config: {source_path} -> {target_path}")
|
|
409
449
|
if source_path is not None:
|
|
410
450
|
LocalMachine.FileHandler.copy(source_path, target_path)
|
|
411
451
|
|
|
@@ -442,9 +482,11 @@ class USB(Compile):
|
|
|
442
482
|
else:
|
|
443
483
|
self.console("Profile was selected: {}{}{}".format(Colors.OK, profile_list[int(profile)], Colors.NC))
|
|
444
484
|
# Read default conf
|
|
445
|
-
default_conf_path = os.path.join(self.
|
|
485
|
+
default_conf_path = os.path.join(self.micrOS_dir_path, self.micrOS_node_config_path)
|
|
446
486
|
if not os.path.isfile(default_conf_path):
|
|
447
|
-
self.
|
|
487
|
+
if not self.__generate_default_config():
|
|
488
|
+
self.console(f"Missing default config: {default_conf_path}", state="warn")
|
|
489
|
+
return None
|
|
448
490
|
with open(default_conf_path, 'r') as f:
|
|
449
491
|
default_conf_dict = json.load(f)
|
|
450
492
|
# Read profile
|
|
@@ -509,10 +551,9 @@ class USB(Compile):
|
|
|
509
551
|
create_default_config_command = "{} Config.py".format(self.python_interpreter)
|
|
510
552
|
if not self.dry_run:
|
|
511
553
|
# Remove actual defualt config
|
|
512
|
-
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))
|
|
513
555
|
# Create default config
|
|
514
|
-
exitcode, stdout, stderr = LocalMachine.CommandHandler.run_command(create_default_config_command,
|
|
515
|
-
shell=True)
|
|
556
|
+
exitcode, stdout, stderr = LocalMachine.CommandHandler.run_command(create_default_config_command, shell=True)
|
|
516
557
|
else:
|
|
517
558
|
exitcode = 0
|
|
518
559
|
# Restore workdir
|
|
@@ -541,7 +582,7 @@ class USB(Compile):
|
|
|
541
582
|
|
|
542
583
|
def __validate_json(self):
|
|
543
584
|
is_valid = True
|
|
544
|
-
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)
|
|
545
586
|
try:
|
|
546
587
|
if os.path.isfile(local_config_path):
|
|
547
588
|
with open(local_config_path, 'r') as f:
|
|
@@ -553,6 +594,9 @@ class USB(Compile):
|
|
|
553
594
|
return is_valid
|
|
554
595
|
|
|
555
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('\\', '/')
|
|
556
600
|
retry_orig = retry
|
|
557
601
|
status = False
|
|
558
602
|
for retry in range(1, retry_orig):
|
|
@@ -607,24 +651,34 @@ class USB(Compile):
|
|
|
607
651
|
return processid
|
|
608
652
|
|
|
609
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
|
+
|
|
610
666
|
device = self.get_devices()[0]
|
|
611
667
|
self.console(f"Get node config over USB: {device}")
|
|
612
|
-
|
|
613
|
-
|
|
614
|
-
# Legacy ampy command (esp32 auto reboot tolerance...)
|
|
615
|
-
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"}', ''
|
|
616
670
|
else:
|
|
617
|
-
|
|
618
|
-
|
|
619
|
-
|
|
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
|
|
620
674
|
self._archive_node_config()
|
|
621
|
-
|
|
622
|
-
exitcode = 0
|
|
623
|
-
stdout = '{"key": "Dummy stdout"}'
|
|
624
|
-
stderr = ''
|
|
675
|
+
|
|
625
676
|
if '\n' in stdout:
|
|
626
677
|
stdout = stdout.strip().splitlines()
|
|
627
|
-
|
|
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}")
|
|
628
682
|
return exitcode, stdout, stderr
|
|
629
683
|
|
|
630
684
|
def backup_node_config(self):
|
|
@@ -639,12 +693,12 @@ class USB(Compile):
|
|
|
639
693
|
if state:
|
|
640
694
|
self._archive_node_config()
|
|
641
695
|
return True
|
|
642
|
-
|
|
696
|
+
self.console("exitcode: {}\n{}\n{}".format(exitcode, stdout, stderr))
|
|
643
697
|
return False
|
|
644
698
|
|
|
645
699
|
def _archive_node_config(self):
|
|
646
700
|
self.console("ARCHIVE NODE_CONFIG.JSON")
|
|
647
|
-
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)
|
|
648
702
|
if os.path.isfile(local_node_config):
|
|
649
703
|
with open(local_node_config, 'r') as f:
|
|
650
704
|
node_devfid = json.load(f)['devfid']
|
|
@@ -656,8 +710,9 @@ class USB(Compile):
|
|
|
656
710
|
LocalMachine.FileHandler.copy(local_node_config, archive_node_config)
|
|
657
711
|
|
|
658
712
|
def __override_local_config_from_node(self, node_config=None):
|
|
659
|
-
|
|
660
|
-
|
|
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')
|
|
661
716
|
if not self.dry_run and node_config is not None:
|
|
662
717
|
with open(node_config_path, 'w') as f:
|
|
663
718
|
f.write(node_config)
|
|
@@ -671,7 +726,7 @@ class USB(Compile):
|
|
|
671
726
|
# Legacy ampy command (esp32 auto reboot tolerance...)
|
|
672
727
|
command = self.dev_types_and_cmds[self.selected_device_type]['ampy_cmd'].format(dev=device, args='ls')
|
|
673
728
|
else:
|
|
674
|
-
command = f"{mpremote_cmd} ls"
|
|
729
|
+
command = f"{mpremote_cmd} fs ls" # new mpremote <1.24.1
|
|
675
730
|
if not self.dry_run:
|
|
676
731
|
self.console("CMD: {}".format(command))
|
|
677
732
|
exitcode, stdout, stderr = LocalMachine.CommandHandler.run_command(command, shell=True, debug=False)
|
toolkit/Gateway.py
CHANGED
|
@@ -154,7 +154,7 @@ class Hello(Resource):
|
|
|
154
154
|
|
|
155
155
|
class SendCmd(Resource):
|
|
156
156
|
"""
|
|
157
|
-
http://127.0.0.1:
|
|
157
|
+
http://127.0.0.1:5005/sendcmd/micr240ac4f679e8OS/rgb+toggle
|
|
158
158
|
{
|
|
159
159
|
"cmd": [
|
|
160
160
|
"rgb",
|
|
@@ -211,7 +211,7 @@ class ListDevices(Resource):
|
|
|
211
211
|
|
|
212
212
|
def sort_devices(self):
|
|
213
213
|
device_struct = socketClient.ConnectionData.list_devices()
|
|
214
|
-
online_devices = socketClient.ConnectionData.nodes_status()
|
|
214
|
+
online_devices = socketClient.ConnectionData.nodes_status(feature_stat=False)
|
|
215
215
|
filtered_devices = {"online": {}, "offline": {}}
|
|
216
216
|
for uid, data in device_struct.items():
|
|
217
217
|
if data[0] in online_devices:
|
|
@@ -554,9 +554,9 @@ class ForwardImg(Resource):
|
|
|
554
554
|
for devid, dev_conn_data in ListDevices.DEVICE_CACHE['online'].items():
|
|
555
555
|
# IP, PORT, FID
|
|
556
556
|
device = dev_conn_data[2]
|
|
557
|
-
response = SendCmd.runcmd(device, '
|
|
557
|
+
response = SendCmd.runcmd(device, 'modules')['response']
|
|
558
558
|
print(f"\n\n{response}\n\n")
|
|
559
|
-
if '
|
|
559
|
+
if 'OV2640' in response:
|
|
560
560
|
ForwardImg.CAM_DEVICES.add(device)
|
|
561
561
|
return jsonify(list(ForwardImg.CAM_DEVICES))
|
|
562
562
|
|
|
@@ -621,11 +621,11 @@ api.add_resource(WebHook, '/webhooks', '/webhooks/<string:payload>', '/webhooks/
|
|
|
621
621
|
|
|
622
622
|
def gateway(debug=True):
|
|
623
623
|
global API_URL_CACHE
|
|
624
|
-
API_URL_CACHE = f"http://{my_local_ip()}:
|
|
624
|
+
API_URL_CACHE = f"http://{my_local_ip()}:5005"
|
|
625
625
|
print("\n############### START MICROS GATEWAY ###############")
|
|
626
626
|
print("# {} #".format(API_URL_CACHE))
|
|
627
627
|
print("####################################################\n")
|
|
628
|
-
app.run(debug=debug, use_reloader=debug, host='0.0.0.0', port=
|
|
628
|
+
app.run(debug=debug, use_reloader=debug, host='0.0.0.0', port=5005) # host='0.0.0.0' automatic, manual: host=my_local_ip()
|
|
629
629
|
|
|
630
630
|
|
|
631
631
|
# driver function
|
toolkit/LM_to_compile.dat
CHANGED
|
@@ -11,8 +11,6 @@ LM_bme280.py
|
|
|
11
11
|
LM_co2.py
|
|
12
12
|
LM_dht11.py
|
|
13
13
|
LM_light_sensor.py
|
|
14
|
-
LM_L298N_DCmotor.py
|
|
15
|
-
LM_intercon.py
|
|
16
14
|
LM_tinyrgb.py
|
|
17
15
|
LM_repair.py
|
|
18
16
|
LM_buzzer.py
|
|
@@ -25,11 +23,10 @@ LM_cct.py
|
|
|
25
23
|
LM_presence.py
|
|
26
24
|
LM_telegram.py
|
|
27
25
|
LM_oled_sh1106.py
|
|
28
|
-
|
|
26
|
+
LM_pacman.py
|
|
29
27
|
LM_aht10.py
|
|
30
28
|
LM_rgbcct.py
|
|
31
29
|
LM_OV2640.py
|
|
32
|
-
LM_keychain.py
|
|
33
30
|
LM_i2s_mic.py
|
|
34
31
|
LM_rest.py
|
|
35
32
|
LM_gameOfLife.py
|
|
@@ -40,3 +37,8 @@ LM_oledui.py
|
|
|
40
37
|
LM_haptic.py
|
|
41
38
|
LM_distance.py
|
|
42
39
|
LM_veml7700.py
|
|
40
|
+
LM_neomatrix.py
|
|
41
|
+
LM_L298N.py
|
|
42
|
+
LM_cluster.py
|
|
43
|
+
LM_fileserver.py
|
|
44
|
+
LM_web.py
|