Package: micrOSDevToolKit
micrOSmicropython based smart edge platform #IoTThanks for, follow us on:micrOSis a miniapplicationexecutionplatformwith ShellCli (socket) and webCli (http)serversand severalotherembeddedfeatures.It uses direct wifi connection to access the exposed functionalities.In case of any technical comments or requests, please use.Example shortcut (usage of the API):linkAccess rest api over browser:http://<nodename>.local📲 💻 ShellCli: Generic session-based communication API📲 WebCli: Apple shortcuts compatibleREST APIandhttp homepage✉️ Expose upython module functions - telnetTCP/IPandREST API⚙️ 📝 Device initialization from user config🧩  Codeless end user experience via phone client⚠️  No external server or service required for client-device communication⚠️ 🛡 Works on Local Network (WiFi-WLAN)🛠 Easy to create custom application(s) aka create your own Load Modules:1. WriteLM_<your_app>.py2. Copy (OTA/USB) python script to your device (drag&drop)3. Call any function from<your_app>module🦾 Built-in scheduling (IRQs):- Time stamp based- Geolocation based clock setup + time tags: sunset, sunrise- Simple periodic🔄 Asynctask manager- start (&/&&) / list / kill / show🚀🎈Lightweight and high performance core system that leaves you space 😎◉ Shortcuts:micrOS Client ApplicationlinkmicrOS InstallerlinkmicrOS TutorialslinkmicrOS System and featureslinkPin mapping - GPIOlinkmicrOS Node configurationlinkmicrOS customization with LMs:linkmicrOS gateway with Prometheus&Grafana:linkRelease notes:linkmicrOS Client ApplicationInstalling micrOS with DevToolKit #ESP32 and moremacOS / Windows / Linux to install any esp32 boardEnd-to-End solution for deployment, update, monitor and develop micrOS boards.I would suggest to use micrOS GUI as a primary interface for micrOS development kit, but you can use cli as well if you prefer.Note: The main purpose of the USB deployment scripts to install micropython on the board and put all micrOS resources frommicrOs/toolkit/workspace/precompiledto the connected board.1. Install python3.9Link for python 3.9downloadNote:Allow extend system pathwith that python version (installation parameter)OnWindows: RUN AS ADMINISTARTOR2. Install micrOS devToolKit GUIOn macOS/LinuxOpencommand lineon mac, press:commnd+space+ type:terminal+ press:enterDownload and installmicrOS devToolKitpython package:pip3install--upgradepip;pip3installmicrOSDevToolKitLater on you canupdatethe package withpip3install--upgrademicrOSDevToolKitOn Windows:Download and installmicrOS devToolKitpython package:Open WindowsPowerShell, presswindows+R+ type:powershell+ pressenterCopy the following lines to the PowerShell and press enter.python-mpipinstall--upgradepip
python-mpipinstallmicrOSDevToolKitLater on you canupdatethe package withpython-mpipinstall--upgrademicrOSDevToolKit3. Start micrOS devToolKit GUICopy the following command to the command line and press enter to start.devToolKit.pyIt will open a graphical user interface for micrOS device management, like usb deploy, update, OTA operations, test executions, etc...Example1. Select BOARD TYPE
2. Click on [Deploy (USB)] button -> presss YESIt will install your board via USB with default settings.Continue with micrOS Client app...Note: At the first USB deployment, devToolKit will ask to installSerialUSB driverand it will open the driver installer as well, please follow the steps and install the necessary driver.╔╗ ╔╗                  ╔═══╗╔╗ ╔╗╔═╗ ╔╗       ╔═══╗
║║ ║║                  ║╔══╝║║ ║║║║╚╗║║       ╚╗╔╗║
║╚═╝║╔══╗ ╔╗╔╗╔══╗     ║╚══╗║║ ║║║╔╗╚╝║    ╔═╗ ║║║║
║╔═╗║╚ ╗║ ║╚╝║║╔╗║     ║╔══╝║║ ║║║║╚╗║║    ╚═╝ ║║║║
║║ ║║║╚╝╚╗╚╗╔╝║║═╣    ╔╝╚╗  ║╚═╝║║║ ║║║    ╔═╗╔╝╚╝║
╚╝ ╚╝╚═══╝ ╚╝ ╚══╝    ╚══╝  ╚═══╝╚╝ ╚═╝    ╚═╝╚═══╝micrOS ProjectsmicrOS Video TutorialsmicrOS System, message-function visualizationNote: micrOS development kit contains command line interface for socket communication. Example:devToolKit.py --connectmicrOS Framework Features💡🕯micrOS loader- starts micrOS or WEBREPL(update / recovery modes)OTA update- push update over wifi (webrepl automation) / monitor update and auto restart node📄Config handling- user config -node_config.json⏳Boot phase- preload Load Module(s)For pinout and last state initialization - based on node_configboothookExample values:rgb load_n_init; neopixel load_n_init📡Network handling- based on node_configSTA / AP network modes,nwmdNTP + UTC aka clock setupAPI:ip-api.comStatic IP configuration,devipdhcp hostname setup,devfid.local⚙️Scheduling / External events- Interrupt callback - based on node_configTime based⌛️simple LM task pool executiontimirq&timirqcbfTimer(0)🗓cron [time stump!LM task] pool executioncron&crontasksTimer(1)timestamp:WD:H:M:S!LM FUNC, ranges:0-6:0-23:0-59:0-59!LM FUNCexample:*:8:0:0!rgb rgb r=10 g=60 b=100; etc., it will set rgb color on analog rgb periphery at 8am every day.WD: 0...60=Monday, 6=Sunday -> optional range handling: 0-2 means Monday to Wednesdaytag:sunset/sunriseexample:sunset!rgb rgb r=10 g=60 b=100; etc., it will set rgb color on analog rgb periphery at every sunset, every day.optional minute offset (+/-): sunrise+30API:api.sunrise-sunset.org💣Event basedSet trigger eventirqXTrigger up/down/bothirqX_trigWith LM callback functionirqX_cbfX = 1, 2, 3 or 4⚙️**[L]oad [M]odule** akaapplicationhandlingLot of built-in functions (table below)Create your own module with 3 easy stepsCreate a python file, naming convention:LM_<your_app_name>.pyReplace<your_app_name>for anything you prefer!Write python functions, you can call any function from that module...Upload modul with "drag&Drop" with help of devToolKit GUIdevToolKit.py📨ShellCli- wireless communication interface with the nodesSystem commands:help, version, reboot, webrepl, webrepl --update, etc.Afterwebrepl --updatecommand the micrOS system reboots and waits for ota update in webrepl mode.Config handlingSET/GET/DUMP -node_config.jsonenter configuration mode:confexit configuration mode:noconfPrint out all parameters and values:dumpLM- Load Module function execution (application modules)Example:system info🖇Logical IOpinout handling - lookuptables for each boardPredefined pinout modules for esp32, tinyPicoCreate your pinout based onIO_esp32.py, naming convencion:IO_<name>.pyTo activate your custom pinout setcstmpmapconfig parameter to<name>🔄Task managerakaAsync LM jobsCapable of execute [L]oad [M]odules in the backgroundInvoke with single execution&or loop execution&&Example:In loop:system heartbeat &&Loop frequency conrol:system heartbeat &&1000, it will execute every secSingle call:system heartbeat &Delayed execution (ms):system heartbeat &1000, waits 1 sec before execution.Stop task:task kill system.heartbeatShow task live ouput:task show system.heartbeat⌘ DevToolKit CLI feature:Socket client python plugin - interactive - non interactive modeBuilt in periphery support#Sensors / inputes#Actuators / outputs[CLICK] Show micrOS Load Module functionsDevice Pinouts for wiringLogical pin association handlingmicrOS/source/microIO.pyLogicalPin lookup tables:tinypicoesp32esp32s2esp32s3raspberryPicoW- reset needed after ota update (webrepl limitation)IO_*.pyetc.Note: Good idea to use costant variable for pin map declaration, check the files for more info, These files are also precompiled automatically into byte steams ->.mpyGENERAL CONTROLLER CONCEPT:microPLCmicrOSnode configuration, parameters with descriptionThese parameters controlls micrOS core functionalities, so you can define an entire system by setting your custom configurations via these values.Basic parameters:Config keysDefault value and typeReboot requiredDescriptiondevfidnode01<str>YesDevice friendly "unique" ID - (1) defines AccessPoint (AP) network name and (2) in Station (STA) network mode the DHCP device name for IP address resolve also (3) this is the ShellCli prompt.staessidyour_wifi_name<str>YesWifi router name to connect (for STA default connection mode). You can list multiple wifi names separated with;stapwdyour_wifi_passwd<str>YesWifi router password (for STA default connection mode). You can list multiple wifi passwords separated with;connected in order tostaessidwifi names.appwdADmin123<str>YesDevice system password.: Used in AP password (access point mode) + webrepl password + micrOS authboothookn/a<str>YesAdd Load Module execution(s) to the boot sequence. Separator;. Examples:rgb load_n_init; cct load_n_initbut you can call any load module function here if you want to run it at boot time.webuiFalseboolYesLaunch http rest server on port 80 (in parallel with micrOS shell on port 9008 akasocport). It has 2 endpoints: / aka main page (index.html) and /rest aka rest (json) interface for load module execution. Example:<devfid>.localor<devfid>.local/rest+ optional parameters:/rgb/toggle.Apple shortcuts compatiblecronFalse<bool>YesEnable timestamp based Load Module execution aka Cron scheduler (linux terminology), Timer(1) hardware interrupt enabler.crontasksn/a<str>YesCron scheduler input, task format:WD:H:M:S!module functione.g.:1:8:0:0!system heartbeat, task separator in case of multiple tasks:;. [WD:0-6, H:0-23, M:0-59, S:0-59] in case of each use:*. InsteadWD:H:M:Syou can use suntime tags:sunset,sunrise, optional offset:sunset+-<minutes>,sunrise+-<minutes>, example:sunset-30!system heartbeat. Range of days: WD can be conrete day number or range like: 0-2 means Monday to Wednesday.irq1False<bool>YesExternal event interrupt enabler - Triggers when desired signal state detected - button press happens / motion detection / etc.irq1_cbfn/a<str>Yesirq1enabled, calls the given Load Modules, e.x.:module function optional_parameter(s)when external trigger happens.irq1_trign/a<str>YesSets trigger mode for external irq, signal phase detection, valuesup(default:n/a) ordownorboth.irq2False<bool>YesExternal event interrupt enabler - Triggers when desired signal state detected - button press happens / motion detection / etc.irq2_cbfn/a<str>Yesirq2enabled, calls the given Load Modules, e.x.:module function optional_parameter(s)when external trigger happens.irq2_trign/a<str>YesSets trigger mode for external irq, signal phase detection, valuesup(default:n/a) ordownorboth.irq3False<bool>YesExternal event interrupt enabler - Triggers when desired signal state detected - button press happens / motion detection / etc.irq3_cbfn/a<str>Yesirq3enabled, calls the given Load Modules, e.x.:module function optional_parameter(s)when external trigger happens.irq3_trign/a<str>YesSets trigger mode for external irq, signal phase detection, valuesup(default:n/a) ordownorboth.irq4False<bool>YesExternal event interrupt enabler - Triggers when desired signal state detected - button press happens / motion detection / etc.irq4_cbfn/a<str>Yesirq4enabled, calls the given Load Modules, e.x.:module function optional_parameter(s)when external trigger happens.irq4_trign/a<str>YesSets trigger mode for external irq, signal phase detection, valuesup(default:n/a) ordownorboth.irq_prell_ms300<int>Yes"Prell": contact recurrence (hw property), for fake event filtering... :D Time window to ignore external IRQ events in ms.timirqFalse<bool>YesTimer(0) interrupt enabler - background "subprocess" like execution, timer based infinite loop for the LoadModule execution.timirqcbfn/a<str>Yesiftimirqenabled, calls the given Load Module(s), e.x.:module function optional_parameter(s), task separator:;timirqseq1000<int>YesTimer interrupt period in ms, default:3000ms (fortimirqinfinite loop timer value)telegramn/astrNoTELEGRAM_BOT_TOKENto enable micrOS Notifications.Hint, to create bot with botfather:click. After enabling this, send/pingto telegram chat for chat ID sync.Advanced parameter options:Config keysDefault value and typeReboot requiredDescriptionutc60<int>YesNTP-RTC - timezone setup (UTC in minute) - it is automatically calibrated in STA mode based on geolocation.cstmpmapn/a<str>YesDefault (n/a), select pinmap automatically based on platform (IO_<platform>). Manual control / customization of application pins, syntax:pin_map_name; pin_name:pin_number;etc. [1][optional]pin_map_namerepresented asIO_<pin_map_name>.py/.mpyfile on device. [2+][optinal]dht:22overwrite individual existing load module pin(s). Hint:<module> pinmap()to get app pins, example:neopixel pinmap()boostmdTrue<bool>Yesboost mode - set up cpu frequency low or high 16Mhz-24MHz (depends on the board).aioqueue3<int>YesSystem async queue controller (resource limiter).:#1Set asyc task queue limit (for soft tasks:&). Furthermore#2Socker server-s (webCli, ShellCli) client number limiter. 3 means: 3 cooperative connection (queue) shared by webCli and shellCli. It can be increased based on available resources.devipn/a<str>Yes(N/A)Device IP address, (first stored IP in STA mode will be the device static IP on the network), you can set specific static IP address here.nwmdn/a<str>YesPrefered network mode -APorSTA, default isSTA.soctout30<int>YesSocket server connection timeout. If user is passive forsoctoutsec, and new connection incoming, then close passive connection. So it is time limit per connection in theaioqueue.socport9008<int>YesSocket server service port (should not be changed due to client and API inconpatibility).authFalse<bool>YesEnables socket password authentication, password:appwd. Passwordless functions:hello,version,exit.WARNINGOTA upade not supported in this mode (yet).dbgTrue<bool>YesDebug mode - enable micrOS system printout, server info, etc. + progress LED.hwuidn/a<str>N/AUSED BY SYSTEM (state storage) - hardware address - dev uidguimetan/astrNoUSED BY micrOS Client (state storage) - stores - offloaded parameter type in config. Clinet widget meta data storage.Note: Default empty value:n/ain case of string parameter.
Note: Cron is only available on devices with Timer(1): esp32Networking - automatic network modesmicrOS Gateway in dockerWith prometheus database.
Check the micrOS Gateway dockerREADMEfor details.Resources:modifyprometheus.ymlregarding what sensors on which endpoint do you want to scrapre data from.docker-composeprometheus configcd./env/docker
docker-compose-pgatewayup-dOfficialDockerHubmicrOS CustomizationAka How to write Load ModulesCreate python file with the following naming convension:LM_your_app.pyYou can create any function in this modul, these will be exposed by micrOS framework over tcp/ip so these can be accessable via phone client.drag-n-drop LM file to micrOS devToolKit GUISelect devicePress uploadLM_simple.pydefhello(name="Anonymous"):returnf"Hello{name}!"defadd_two_numbers(a,b):returnf"{a}+{b}={a+b}"LM_simple_led.pyfrommachineimportPin# Import micropython Pin modulePIN=None# Cache created Pin instancedefload_n_init():globalPINifPINisNone:PIN=Pin(4,Pin.OUT)# Init PIN 4 as OUTPUT and store (cache) in global var.returnPINdefon():pin=load_n_init()pin.value(1)# Set pin high - LED ONreturn"LED ON"defoff():pin=load_n_init()pin.value(0)# Set pin low - LED OFFreturn"LED OFF"deftoggle():pin=load_n_init()pin.value(notpin.value())return"LED ON"ifpin.value()else"LED OFF"defhelp():return'load_n_init','on','off','toggle'For more info: Micropython officialPinsLM_template.pyFunction naming convesions for Load Modules.fromLogicalPinsimportphysical_pin,pinmap_dumpfrommachineimportPindefload_n_init():"""[RECOMMENDED]Function naming convension to create IO (Pin) objects- function to initialize IO peripheriesphysical_pin - to resolve pin on board by logical name (tag)"""pin_number=physical_pin('redgb')# select pin number from platfrom lookup tablered=Pin(pin_number)returnreddeflmdep():"""[OPTIONAL] [IN CASE OF LM DEPENDENCY]Function to return Load Module dependencies (tuple)- example: if this module uses LM_rgb.py, you shouldreturn 'rgb'"""return'<module_name>'defpinmap():"""[OPTIONAL]Return list of pinsExample:RoboArm $  rgb pinmap >json{"rgbue": 15, "rgreenb": 12, "redgb": 14}return: dict {pinkey: pinvalue}pinmap_dump - logical pinmap resolver based on IO_<device_tag>.pyExample:return pinmap_dump(['redgb', 'rgreenb', 'rgbue'])"""returnpinmap_dump(['redgb'])defstatus(lmf=None):"""[OPTIONAL]Function naming convension formodule state-machine returnreturn: dictExample in case of RGB color state returnreturn {'R': data[0], 'G': data[1], 'B': data[2], 'S': data[3]}"""return{'key':'value'}defhelp():"""[OPTIONAL]Return help message tuple"""return'load_n_init','pinmap','status','lmdep'micrOS Common moduleCommon module with additinal features for LoadModule-sModule responsible for collecting additional feature definitions dedicated to the micrOS framework and LoadModules. Code:micrOS/source/Common.pysocket_stream decoratorAdds an extramsgobjto the wrapped function's argument list. Themsgobjprovides a socket message interface for the open connection.Example:LM_my_module.pyfromCommonimportsocket_stream@socket_streamdeffunction_name(arg1,arg2,...,msgobj=None):# function bodymsgobj("Reply from Load Module to shellCli :)")Usage(s):LM_systemtransition(from_val, to_val, step_ms, interval_sec)Generator for color transitions.Parameters:from_val: Starting valueto_val: Target valuestep_ms: Step to reach to_valinterval_sec: Full intervalsReturns:A generator that yields the intermediate values between from_val and to_val in steps of step_ms.Usage(s):LM_rgbLM_cctLM_servotransition_gen(*args, interval_sec=1.0)Create multiple transition generators.Parameters:args: Pairs of from_val and to_val values for each channelinterval_sec: Interval in seconds to calculate the optimal fade/transition effectReturns:If only one transition generator is created, it returns the generator and the step size in milliseconds (gen, step_ms). If multiple transition generators are created, it returns a list of generators and the step size in milliseconds ([gen1, gen2, ...], step_ms).Usage(s):LM_rgbLM_cctLM_servoclass SmartADCADC wrapper class for reading analog values.Methods:__init__(self, pin): Initializes the ADC object with the specified pin.get(self): Reads the analog value from the ADC and returns a dictionary with the raw value, percentage, and voltage.get_singleton(pin): Returns a singleton SmartADC object for the specified pin.micro_task(tag, task=None)Async task creation from LoadModules.Parameters:tag: If None, returns the task generator object. If a taskID is provided, returns the existing task object by tag.task: Coroutine to execute.Returns:If tag is None, returns the task generator object. If a taskID is provided, returns the existing task object by tag. If task is provided, returns the task creation state: True for success, False for failure.Example:LM_my_task.pyimportuasyncioasasynciofromCommonimportmicro_taskasyncdef__task(period_ms):counter=0withmicro_task(tag="mytask")asmy_task:whileTrue:# DO something here in the async loop...counter+=1# Store data in task cache (task show mytask)my_task.out=f'MyTask Counter:{counter}'# Async sleep - feed event loopawaitasyncio.sleep_ms(period_ms)defcreate_task():# [!] ASYNC TASK CREATION [1*] with async task callback + taskID (TAG) handlingstate=micro_task(tag="mytask",task=__task(period_ms=5))return"Starting"ifstateelse"Already running"Usage(s):LM_presenceLM_buzzerLM_cctLM_dimmerLM_neopixelLM_neopixelLM_rgbLM_roboarmetc.data_logger(f_name, data=None, limit=12, msgobj=None)micrOS Common Data logger solution.Parameters:f_name: Log name (without extension, automatically appends .dat)data: Data to append to the log. If None, reads the log and returns it as a message stream.limit: Line limit for the log (default: 12)msgobj: Socket stream object (automatically set)Returns:If data is None, returns the log as a message stream. If data is provided, returns True if the write operation was successful, False otherwise.Example:LM_my_logger.pyfromCommonimportdata_loggerdeflog_data(data):ifnotdata_logger(f_name="mylog",data=data,limit=20):return"data_logger, error... check system alarms"return"data saved."defget_data():returndata_logger(f_name="mylog")defhelp():return'log_data data="value"','get_data'Usage(s):LM_dht22notify(text)micrOS common notification handler (Telegram).PrerequisiteSet Telegram API KEY in node config: telegram keyconf
 telegram <API KEY>
noconf
my_notification "hello"
 notify, msg was sent.Parameters:text: Notification textReturns:True if the notification was sent successfully, False otherwise.Example:LM_my_notification.pyfromCommonimportnotifydefsend_notification(msg="Hello from micrOS board"):ifnotnotify(msg):return"notify, error... check system alarms"return"notify, msg was sent."Usage(s):LM_presencerest_endpoint(endpoint, function):Add custom endpint<localhost.local>/endpointfrom Load Modules to WebCli html server.PrerequisiteEnablewebui Truein node config.Parameters:endpoint: name of the http endpoint after the main address, likelocalhost.local/my_endpoint, in this case themy_endpointis the input paramater here.Simplefunctionreturn: callback function, this will be called when endpoint is called, it must return 2 values: html type and data for examplehtml/text, datadata for example:hello world. Supported data types:text/html,text/plain,image/jpeg. In short:return"image/jpeg"|"text/html"|"text/plain",<data># <data>: binary | stringselect one from between | signsStream function return:return"multipart/x-mixed-replace"|"multipart/form-data",<data># <data>: {'callback':<func>, 'content-type': 'image/jpeg' | 'audio/l16;...'}select one from between | signsReturns:True if function successfuly registered on the endpointExample:LM_my_endpoint.pyfromCommonimportrest_endpointdefload_n_init():...rest_endpoint('my_endpoint',_response)return"Endpoint was created: http://localhost/my_endpoint"def_response():reply="hello world"return'text/plain',replyUsage(s):LM_OV2640RELESE NOTENextmain releaseversion2.0.0.0coming soon (24 April).Current v1.57.0 content
	Core:
		- WebCli (http server with endpoints: / and /rest and /<custom>)
		- Full async as technically possible (WebCLI, ShelCLI, TaskManager (LM), InterCon)
			- rest (urequests) stays sync module (https limitation with async.) 
		- Extensive testing and quality checks (system tests, pylint) 
		Web Frontends:
			- index.html (built-in)
	
	Load Module:
		- Camera support (LM_OV2640.py)
		- I2S mic support
		- dashboard backend (LM_dashboard_be.py)
		Web Frontends:
		- dashboard.html

TODO:
	- LM_KeyChain HW+SW for the 2.0 anniversary 🎲Future planned features in version2.1+.0-0Core:
		- Socket SSL/TLS integration (with auth.)
			- WebCli (http), ShellCli (terminal) and InterCon
			- micropython 1.22+ required
		- Study of ESP-NOW integration into InterCon (micropython requirements?)
	
	Load Module:
		- Camera support (LM_OV2640.py) embed into dashboard.htmlFuture planned features in version2.2+.0-0Core:
		- Network stack redesign
			- Network
				- wifi (defualt, current interfaces)
				- Study of ble (Shell)
	
	Load Module:
		- (?)Future main Version3.0.0-0Optimization of new features...
	Core:
		- Low power mode (with ble)VERSION (TAG)RELEASE INFOMICROS CORE MEMORY USAGESUPPORTED DEVICE(S)APP PROFILESLoad ModulesNOTEv0.1.0-0release_Info-0.1.0-078,4%29 776 byteesp8266App ProfilesLM manualStable Core with applications - first releasev0.4.0-0release_Info-0.4.0-081,0%30768 byteesp8266App ProfilesLM manualmicrOS multi device support with finalized core and so more. OTA update feature.v0.4.0-0release_Info-0.4.0-047,1%52 416 byteesp32App ProfilesLM manualmicrOS multi device support with finalized core and advanced task scheduler based on time, and and so more. OTA update feature.v1.0.0-0release_Info-1.0.0-047,9%53 280 byteesp32App ProfilesLM manualRelease of v1 micrOS, timer and event based irqs, cron task scheduling, realtime communication, multiple device support. OTA, etc.v1.2.2-0release_Info-1.2.2-048,6%54 032 byteesp32App ProfilesLM manualPublic Release of v1 micrOS, timer and event based irqs, cron task scheduling, realtime communication, multiple device support. OTA update, thread from socket shell (beta) etc.v light-1.3.0-0--esp8266lightweight branch-remove esp8266 due to memory limitation - BUT still supported with limited functionalities onlightweightbranch. Hint: Change branch on github and download zip file, then start micrOSDevToolKit dashboard GUIv 1.5.0-1release_Info-1.5.0-158,2%64 704 byteesp32 (tinyPico)App ProfilesLM manualAdvanced Timer IRQ based scheduling (cron & timirq), Geolocation based timing features, External IRQs with 4 channel (event filtering), finalized light controls, Device-Device comminucation support, etc.v 1.21.0-4release_Info-1.21.0-457.3%63 728 byteesp32 (tinyPico, esp32s2, esp32s3)App ProfilesLM manualFull async core system with advanced task management and device to device communication, task scheduling and much more ... with more then 30 application/pheriphery support.v 2.0.0-0TODO~47.0%~52kbesp32 (tinyPico, esp32s2, esp32s3)App ProfilesLM manualOptimizations, WebCli with web frontends, Camera support. Micropython 1.21 async maxed out :DDeveloper Quick guideNote:Secure Core (OTA static modules) (GUI):boot.py,micrOSloader.mpy,Network.mpy,ConfigHandler.mpy,Debug.mpyErase device & Deploy micropython & Install micrOSGo to micrOS repo, where thedevToolKit.pylocated.devToolKit.py--makeNote: Follow the steps :)Search and Connect to the devicedevToolKit.py -s -cUser commandsdevToolKit.py -h

optional arguments:
  -h, --help            show this help message and exit

Base commands:
  -m, --make            Erase & Deploy & Precompile (micrOS) & Install (micrOS)
  -r, --update          Update/redeploy connected (usb) micrOS. - node config will be restored
  -s, --search_devices  Search devices on connected wifi network.
  -o, --OTA             OTA (OverTheArir update with webrepl)
  -c, --connect         Connect via socketclinet
  -p CONNECT_PARAMETERS, --connect_parameters CONNECT_PARAMETERS
                        Parameters for connection in non-interactivve mode.
  -a APPLICATIONS, --applications APPLICATIONS
                        List/Execute frontend applications. [list]
  -stat, --node_status  Show all available micrOS devices status data.
  -cl, --clean          Clean user connection data: device_conn_cache.jsonSearch devicesdevToolKit.py --search_devices

or

devToolKit.py -sList discovered devices with status updatesdevToolKit.py -stat

or

devToolKit.py --node_statusOutput:[ UID ]                [ FUID ]		[ IP ]		[ STATUS ]	[ VERSION ]	[COMM SEC]
__localhost__                 __simulator__     127.0.0.1	OFFLINE		<n/a>		n/a
micr<ID>OS            TinyDevBoard      10.0.1.72	ONLINE		1.16.2-2		0.072
micr<ID>OS            LivingKitchen     10.0.1.200	ONLINE		1.16.2-2		0.076
micr<ID>OS            RoboArm           10.0.1.232	ONLINE		1.15.4-0		0.072
micr<ID>S            Cabinet           10.0.1.204	ONLINE		1.16.2-2		0.074
micr<ID>4OS            TestBird          10.0.1.179	ONLINE		1.16.2-1		0.083
micr<ID>OS            RingLamp          10.0.1.75	ONLINE		1.16.2-2		0.099
micr<ID>OS            CatFeeder         10.0.1.111	OFFLINE		<n/a>		n/a
micr<ID>OS            ImpiGamePro       10.0.1.23	OFFLINE		<n/a>		n/a
micr<ID>S            micrOSPublic02    10.0.1.47	ONLINE		1.16.2-2		0.101
micr<ID>cOS            micrOSPublic01    10.0.1.197	ONLINE		1.16.2-2		0.099
micr<ID>cOS            experipurple      10.0.1.94	OFFLINE		<n/a>		n/aOther Developer commandsDevelopment & Deployment & Connection:
  -f, --force_update    Force mode for -r/--update and -o/--OTA
  -e, --erase           Erase device
  -d, --deploy          Deploy micropython
  -i, --install         Install micrOS on micropython
  -l, --list_devs_n_bins
                        List connected devices & micropython binaries.
  -ls, --node_ls        List micrOS node filesystem content.
  -u, --connect_via_usb
                        Connect via serial port - usb
  -b, --backup_node_config
                        Backup usb connected node config.
  -sim, --simulate      start micrOS on your computer in simulated mode
  -cc, --cross_compile_micros
                        Cross Compile micrOS system [py -> mpy]
  -gw, --gateway        Start micrOS Gateway rest-api server
  -v, --version         Get micrOS version - repo + connected device.Socket terminal example - non interactiveIdentify devicedevToolKit.py -c -p '--dev slim01 hello'
Load MicrOS device cache: /Users/bnm/Documents/NodeMcu/MicrOs/tools/device_conn_cache.json
Activate MicrOS device connection address
[i]         FUID        IP               UID
[0] Device: slim01 - 10.0.1.73 - 0x500x20x910x680xc0xf7
Device was found: slim01
hello:slim01:0x500x20x910x680xc0xf7Get helpdevToolKit.py-c-p'--dev BedLamp help'[MICROS]-built-inshellcommandshello-hellomsg-fordeviceidentificationversion-returnsmicrOSversionexit-exitfromshellsocketpromptreboot-systemsoftreboot(vm),hardreboot(hw):reboot-hwebrepl-startwebrepl,forfiletransfersusewith--update[CONF]Configuremode-built-inshellcommandsconf-Enterconfmodedump-Dumpalldatakey-Getvaluekeyvalue-Setvaluenoconf-Exitconfmode[TASK]postfix:&x-one-time,&&x-periodic,x:waitms[xmin:20ms]tasklist-listtaskswith<tag>staskkill<tag>-stoptasktaskshow<tag>-showtaskoutput[EXEC]Commandmode(LMs):helplm-listALLLoadModulesccthelpco2helpdht22helpinterconhelprobustnesshelpsystemhelpEmbedded config handlerdevToolKit.py -c -p '--dev BedLamp conf <a> dump'
  
  staessid  :        <your-wifi-passwd>
  devip     :        10.0.1.204
  version   :        1.11.0-1
  devfid    :        BedLamp
  cron      :        True
  cronseq   :        3000
  soctout   :        10
  irq2_cbf  :        n/a
  stapwd    :        <your-wifi-name>
  dbg       :        False
  irq2      :        False
  irq1      :        False
  irq1_cbf  :        n/a
  appwd     :        ADmin123
  irq2_trig :        n/a
  hwuid     :        micr7c9ebd623ff8OS
  crontasks :        sunset!cct toggle True;*:0:30:0!cct toggle False;*:5:0:0!cct toggle False
  timirq    :        True
  irq3      :        False
  irq3_cbf  :        n/a
  irq4      :        False
  irq4_cbf  :        n/a
  irq4_trig :        n/a
  nwmd      :        STA
  timirqcbf :        system ha_sta
  irq_prell_ms:      300
  boothook  :        cct load_n_init
  aioqueue  :        3
  auth      :        False
  timirqseq :        60000
  utc       :        60
  boostmd   :        True
  socport   :        9008
  irq3_trig :        n/a
  irq1_trig :        n/a
  guimeta   :        ...
  cstmpmap  :        n/aLoad Modules - User defined functionsdevToolKit.py -c -p '--dev BedLamp system info'

CPU clock: 24 [MHz]
Mem usage: 71.0 %
FS usage: 14.6 %
upython: v1.19.1 on 2022-06-18
board: ESP32 module with ESP32
mac: 7c:9e:bd:62:3f:f8
uptime: 0 1:29:19SocketClientConfig:micrOS/toolkit/user_data/device_conn_cache.json{"__devuid__":["192.168.4.1",9008,"__device_on_AP__"],"__localhost__":["127.0.0.1",9008,"__simulator__"],"micr500291863428OS":["10.0.1.72",9008,"BedLamp"]}Interactive modedevToolKit.py -c 
or
devToolKit.py -connect

[i]         FUID        IP               UID
[0] Device: __device_on_AP__ - 192.168.4.1 - __devuid__
[1] Device: __simulator__ - 127.0.0.1 - __localhost__
[2] Device: BedLamp - 10.0.1.72 - micr500291863428OS

Choose a device index: 5
Device was selected: ['10.0.1.204', 9008, 'Cabinet']
BedLamp $ help
[MICROS]   - built-in shell commands
   hello   - hello msg - for device identification
   version - returns micrOS version
   exit    - exit from shell socket prompt
   reboot  - system soft reboot (vm), hard reboot (hw): reboot -h
   webrepl - start webrepl, for file transfers use with --update
[CONF] Configure mode - built-in shell commands
  conf       - Enter conf mode
    dump       - Dump all data
    key        - Get value
    key value  - Set value
  noconf     - Exit conf mode
[TASK] postfix: &x - one-time,  &&x - periodic, x: wait ms [x min: 20ms]
  task list         - list tasks with <tag>s
  task kill <tag>   - stop task
  task show <tag>   - show task output
[EXEC] Command mode (LMs):
   help lm  - list ALL LoadModules
   cct
      help
   co2
      help
   dht22
        help
   intercon
           help
   robustness
             help
   system
         help
BedLamp $  exit
Bye!Project structuremicrOS resources librarymicrOS CoreCore micrOS resources
	1	172	Time.py                  (mlint: True)	(pylint: 8.76)	(ref.: 6)
	2	123	micrOSloader.py          (mlint: True)	(pylint: 7.63)	(ref.: 1)
	3	53	Hooks.py                 (mlint: True)	(pylint: 9.62)	(ref.: 1)
	4	452	Server.py                (mlint: True)	(pylint: 9.23)	(ref.: 4)
	5	516	Tasks.py                 (mlint: True)	(pylint: 9.46)	(ref.: 11)
	6	220	Config.py                (mlint: True)	(pylint: 9.38)	(ref.: 12)
	7	9	reset.py                 (mlint: True)	(pylint: 8.75)	(ref.: 0)
	8	264	Shell.py                 (mlint: True)	(pylint: 9.4)	(ref.: 1)
	9	213	Notify.py                (mlint: True)	(pylint: 9.57)	(ref.: 2)
	10	161	Common.py                (mlint: True)	(pylint: 8.98)	(ref.: 19)
	11	155	InterConnect.py          (mlint: True)	(pylint: 9.11)	(ref.: 1)
	12	204	Debug.py                 (mlint: True)	(pylint: 8.61)	(ref.: 23)
	13	214	Network.py               (mlint: True)	(pylint: 9.64)	(ref.: 9)
	14	225	Scheduler.py             (mlint: True)	(pylint: 9.43)	(ref.: 1)
	15	133	microIO.py               (mlint: True)	(pylint: 9.05)	(ref.: 35)
	16	69	micrOS.py                (mlint: True)	(pylint: 9.3)	(ref.: 1)
	17	159	Interrupts.py            (mlint: True)	(pylint: 9.08)	(ref.: 2)
	18	19	main.py                  (mlint: True)	(pylint: 8.89)	(ref.: 0)
	19	146	urequests.py             (mlint: True)	(pylint: 8.79)	(ref.: 3)

SUM CODE LINES (WITH COMMENTS, WITHOUT EMPTY LINES): 3507micrOS Load ModulesmicrOS Load Module resources
	1	262	LM_roboarm.py            (mlint: True)	(pylint: 9.18)	(ref.: 0)
	2	133	LM_stepper.py            (mlint: True)	(pylint: 9.04)	(ref.: 1)
	3	129	LM_genIO.py              (mlint: True)	(pylint: 7.42)	(ref.: 1)
	4	499	LM_oled_ui.py            (mlint: False)	(pylint: 8.74)	(ref.: 0)
	5	197	LM_system.py             (mlint: True)	(pylint: 7.48)	(ref.: 2)
	6	53	LM_robustness.py         (mlint: True)	(pylint: 7.04)	(ref.: 0)
	7	122	LM_co2.py                (mlint: True)	(pylint: 8.39)	(ref.: 3)
	8	217	LM_oled.py               (mlint: True)	(pylint: 9.31)	(ref.: 1)
	9	85	LM_tinyrgb.py            (mlint: True)	(pylint: 8.18)	(ref.: 0)
	10	104	LM_aht10.py              (mlint: False)	(pylint: 8.39)	(ref.: 0)
	11	299	LM_bme280.py             (mlint: True)	(pylint: 7.98)	(ref.: 0)
	12	39	LM_ph_sensor.py          (mlint: True)	(pylint: 6.32)	(ref.: 0)
	13	240	LM_buzzer.py             (mlint: True)	(pylint: 8.79)	(ref.: 0)
	14	224	LM_switch.py             (mlint: True)	(pylint: 8.64)	(ref.: 2)
	15	124	LM_servo.py              (mlint: True)	(pylint: 7.87)	(ref.: 4)
	16	49	LM_rgbcct.py             (mlint: True)	(pylint: 8.57)	(ref.: 0)
	17	280	LM_oled_sh1106.py        (mlint: True)	(pylint: 8.88)	(ref.: 1)
	18	304	LM_neopixel.py           (mlint: True)	(pylint: 7.34)	(ref.: 2)
	19	317	LM_cct.py                (mlint: True)	(pylint: 8.65)	(ref.: 1)
	20	47	LM_L9110_DCmotor.py      (mlint: True)	(pylint: 8.08)	(ref.: 0)
	21	283	LM_neoeffects.py         (mlint: True)	(pylint: 6.97)	(ref.: 0)
	22	33	LM_i2c.py                (mlint: True)	(pylint: 6.43)	(ref.: 0)
	23	72	LM_dht22.py              (mlint: True)	(pylint: 7.78)	(ref.: 0)
	24	68	LM_L298N_DCmotor.py      (mlint: True)	(pylint: 9.02)	(ref.: 0)
	25	44	LM_esp32.py              (mlint: True)	(pylint: 5.0)	(ref.: 0)
	26	64	LM_pet_feeder.py         (mlint: True)	(pylint: 7.94)	(ref.: 0)
	27	87	LM_rencoder.py           (mlint: False)	(pylint: 8.24)	(ref.: 0)
	28	72	LM_dht11.py              (mlint: True)	(pylint: 7.78)	(ref.: 0)
	29	76	LM_telegram.py           (mlint: False)	(pylint: 9.15)	(ref.: 0)
	30	161	LM_OV2640.py             (mlint: False)	(pylint: 8.94)	(ref.: 0)
	31	282	LM_rgb.py                (mlint: True)	(pylint: 8.4)	(ref.: 2)
	32	70	LM_distance.py           (mlint: True)	(pylint: 8.37)	(ref.: 0)
	33	323	LM_VL53L0X.py            (mlint: True)	(pylint: 9.14)	(ref.: 0)
	34	107	LM_light_sensor.py       (mlint: True)	(pylint: 8.91)	(ref.: 0)
	35	12	LM_rp2w.py               (mlint: True)	(pylint: 5.56)	(ref.: 0)
	36	207	LM_presence.py           (mlint: False)	(pylint: 8.38)	(ref.: 4)
	37	200	LM_dimmer.py             (mlint: True)	(pylint: 8.32)	(ref.: 0)
	38	60	LM_demo.py               (mlint: False)	(pylint: 8.46)	(ref.: 0)
	39	96	LM_lmpacman.py           (mlint: True)	(pylint: 6.98)	(ref.: 0)
	40	60	LM_catgame.py            (mlint: True)	(pylint: 8.85)	(ref.: 0)
	41	46	LM_intercon.py           (mlint: True)	(pylint: 8.64)	(ref.: 3)
	42	54	LM_ds18.py               (mlint: True)	(pylint: 5.38)	(ref.: 0)

SUM CODE LINES (WITH COMMENTS, WITHOUT EMPTY LINES): 6201LM (Load Modules) - Application logic - accessable over socket server as a commandmicrOS devToolkit resourcesDevToolKit Dashboard appsYou can easly copy theTemplate_app.py, and create a new socket based app.Template_app.pymicrOS/toolkit/dashboard_apps
│   ├── AirQualityBME280_app.py
│   ├── AirQualityDHT22_CO2_app.py
│   ├── AnalogCCT_app.py
│   ├── AnalogRGB_app.py
│   ├── CatGame_app.py
│   ├── Dimmer_app.py
│   ├── GetVersion_app.py
│   ├── GetVersion_app.pyc
│   ├── NeopixelTest_app.py
│   ├── RoboArm_app.py
│   ├── SysCheck_app.py
│   ├── Template_app.pyStored connection data and default node configsmicrOS/toolkit/user_data
│   ├── device_conn_cache.json        <- connection cache
│   └── node_config_archive
│       ├── BigRGB-node_config.json
│       ├── Chillight-node_config.json
│       ├── Kapcsolo230-node_config.json
│       ├── LampController-node_config.json
│       ├── MeasureNode-node_config.json
│       ├── MrGreen-node_config.json
│       ├── RingLamp-node_config.json
│       └── test-node_config.jsonVirtaulenv for development and stored USB-Serial driversmicrOS/env/
├── __init__.py
├── driver_cp210x
│   ├── CP210x_Universal_Windows_Driver
│   └── macOS_VCP_Driver
├── requirements.txt
└── venv
    ├── bin
    ├── include
    ├── lib
    └── pyvenv.cfgPrecompiled resources for easy installmicrOS/toolkit/workspace/precompiled
    │   ├── BgJob.mpy
    │   ├── Common.mpy
    │   ├── ConfigHandler.mpy
    │   ├── Debug.mpy
    │   ├── Hooks.mpy
    │   ├── InterConnect.mpy
    │   ├── InterpreterCore.mpy
    │   ├── InterpreterShell.mpy
    │   ├── InterruptHandler.mpy
    │   ├── LM_L298N_DCmotor.mpy
    │   ├── LM_L9110_DCmotor.py
    │   ├── LM_VL53L0X.py
    │   ├── LM_bme280.mpy
    │   ├── LM_buzzer.mpy
    │   ├── LM_catgame.py
    │   ├── LM_cct.mpy
    │   ├── LM_co2.mpy
    │   ├── LM_dht11.mpy
    │   ├── LM_dht22.mpy
    │   ├── LM_dimmer.mpy
    │   ├── LM_distance_HCSR04.py
    │   ├── LM_ds18.mpy
    │   ├── LM_esp32.py
    │   ├── LM_genIO.mpy
    │   ├── LM_i2c.py
    │   ├── LM_intercon.mpy
    │   ├── LM_light_sensor.mpy
    │   ├── LM_neoeffects.mpy
    │   ├── LM_neopixel.mpy
    │   ├── LM_oled.mpy
    │   ├── LM_oled_ui.mpy
    │   ├── LM_pet_feeder.py
    │   ├── LM_ph_sensor.py
    │   ├── LM_rgb.mpy
    │   ├── LM_roboarm.mpy
    │   ├── LM_robustness.py
    │   ├── LM_servo.mpy
    │   ├── LM_stepper.mpy
    │   ├── LM_switch.mpy
    │   ├── LM_system.mpy
    │   ├── LM_tinyrgb.mpy
    │   ├── IO_esp32.mpy
    │   ├── IO_tinypico.mpy
    │   ├── LogicalPins.mpy
    │   ├── Network.mpy
    │   ├── Scheduler.mpy
    │   ├── SocketServer.mpy
    │   ├── Time.mpy
    │   ├── TinyPLed.mpy
    │   ├── boot.py
    │   ├── micrOS.mpy
    │   ├── micrOSloader.mpy
    │   └── reset.mpyNote: From themicrOS/source/by default the LMs are not compiling, to extend complied LM list add LM explicitly to the following file:micrOs/toolkit/LM_to_compile.datHINTSSavescreenconsole buffer (output)
Pressctrl + A :and typehardcopy -h <filename>Create callgraph:pycallgraphConvert PNG/JPG-s to GIF:convert -delay 60 ./*.png mygif.gifmicrOS core and Load Module source code info:devToolKit.py-lint
OR
devToolKit.py--lintermicrOS gateway - Linux service templatePrerequisite: install micrOS devtoolkitPiP packageCreate service:micrOS gateway service[1] createmicros-gw.servicefile:[Unit]Description=micrOSgatewayRESTAPIserviceAfter=network-online.target[Service]Environment="API_AUTH=<usr_name>:<password>"<--replaceExecStart=/usr/bin/python3-mdevToolKit-gw<--check(dependsondeployment)OR/bin/bashWorkingDirectory=/home/gateway<--replaceStandardOutput=inheritStandardError=inheritRestart=alwaysUser=<user><--replace[Install]WantedBy=multi-user.target[2] copy service tosudo cp micros-gw.service /lib/systemd/system/[3] start service:sudo systemctl start micros-gw.service[4] enable service at bootup:sudo systemctl enable micros-gw.service[5] show service state:sudo systemctl status micros-gw.serviceGITAdd git tag:git tag -a vX.Y.Z-K -m "tag message"Publish tags:git push origin --tagsPretty git view:git log --pretty=onelineFile change list:git diff --name-only fbb4875609a3c0ee088b6a118ebf9f8a500be0fd HEAD | grep 'mpy-MicrOS'GitHub embed youtube link:https://github.com/itskeshav/Add-youtube-link-in-Readme.mdGit history visualization with Gourcegource\--highlight-users\--hidefilenames\--file-idle-time0\--max-files0\--seconds-per-day0.01\--auto-skip-seconds1\--title"micrOS Evolution"\--output-ppm-stream-\|ffmpeg-y-r30-fimage2pipe-vcodecppm-i--vcodeclibx264-presetultrafast-pix_fmtyuv420p-crf1-threads0-bf0output.mp4git push -u origin master