{"id":15288270,"url":"https://github.com/carglglz/upydev","last_synced_at":"2025-04-13T05:34:21.310Z","repository":{"id":43163145,"uuid":"199335165","full_name":"Carglglz/upydev","owner":"Carglglz","description":"Command line tool for MicroPython devices","archived":false,"fork":false,"pushed_at":"2023-09-24T16:29:05.000Z","size":18354,"stargazers_count":57,"open_issues_count":10,"forks_count":9,"subscribers_count":9,"default_branch":"master","last_synced_at":"2024-10-14T19:21:16.858Z","etag":null,"topics":["benchmarks","ble","cli","embedded","esp32","micropython","ota","parametric","playbook","pytest","python","repl","serial","shell","tasks","terminal","tls","webrepl","wifi","yaml"],"latest_commit_sha":null,"homepage":"https://pypi.org/project/upydev/","language":"Python","has_issues":true,"has_wiki":null,"has_pages":null,"mirror_url":null,"source_name":null,"license":"mit","status":null,"scm":"git","pull_requests_enabled":true,"icon_url":"https://github.com/Carglglz.png","metadata":{"files":{"readme":"README.md","changelog":"changelog.md","contributing":null,"funding":null,"license":"LICENSE","code_of_conduct":null,"threat_model":null,"audit":null,"citation":null,"codeowners":null,"security":null,"support":null,"governance":null}},"created_at":"2019-07-28T20:42:00.000Z","updated_at":"2024-08-27T10:34:21.000Z","dependencies_parsed_at":"2023-09-22T03:47:35.260Z","dependency_job_id":null,"html_url":"https://github.com/Carglglz/upydev","commit_stats":{"total_commits":558,"total_committers":4,"mean_commits":139.5,"dds":0.008960573476702538,"last_synced_commit":"529aa29f3e1acf8160383fe410b5659110dc96de"},"previous_names":[],"tags_count":12,"template":false,"template_full_name":null,"repository_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/repositories/Carglglz%2Fupydev","tags_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/repositories/Carglglz%2Fupydev/tags","releases_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/repositories/Carglglz%2Fupydev/releases","manifests_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/repositories/Carglglz%2Fupydev/manifests","owner_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/owners/Carglglz","download_url":"https://codeload.github.com/Carglglz/upydev/tar.gz/refs/heads/master","host":{"name":"GitHub","url":"https://github.com","kind":"github","repositories_count":219846875,"owners_count":16556422,"icon_url":"https://github.com/github.png","version":null,"created_at":"2022-05-30T11:31:42.601Z","updated_at":"2022-07-04T15:15:14.044Z","host_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub","repositories_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/repositories","repository_names_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/repository_names","owners_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/owners"}},"keywords":["benchmarks","ble","cli","embedded","esp32","micropython","ota","parametric","playbook","pytest","python","repl","serial","shell","tasks","terminal","tls","webrepl","wifi","yaml"],"created_at":"2024-09-30T15:45:01.306Z","updated_at":"2024-10-14T19:21:45.041Z","avatar_url":"https://github.com/Carglglz.png","language":"Python","funding_links":[],"categories":[],"sub_categories":[],"readme":"\u003cimg align=\"right\" width=\"100\" height=\"100\" src=\"https://raw.githubusercontent.com/Carglglz/upydev/master/uPydevlogo.png\"\u003e\n\n# uPydev\n\n[![PyPI version](https://badge.fury.io/py/upydev.svg)](https://badge.fury.io/py/upydev)[![PyPI license](https://img.shields.io/pypi/l/ansicolortags.svg)](https://pypi.python.org/pypi/ansicolortags/)\n\n### Command line tool for MicroPython devices\n\n**uPydev** is an acronym of '**MicroPy**thon **dev**ice', and it is intended to be a command line tool to make easier the development, prototyping and testing process of devices based on boards running MicroPython. It is intended to be cross-platform and\nconnection agnostic (Serial, WiFi and Bluetooth Low Energy).\n\n### Features:\n\n* Tools to allow configuration, management, communication and control of MicroPython devices\n* Command line Autocompletion\n* File IO operations (upload, download one or multiple files, recursively sync directories...)\n* SHELL-REPL modes: Serial, WiFi (SSL/WebREPL), BLE\n* OTA\\* Firmware updates WiFi (TCP/SSL), BLE  (\\* esp32 only)\n* Custom commands for debugging, testing and prototyping\n* Custom tasks yaml files that can be played like ansible\n* Run tests in device with pytest and parametric tests or benchmarks using yaml files\n* Group mode to operate with multiple devices\n\n------\n\n### [Docs](https://upydev.readthedocs.io/en/latest/)\n\n### Getting Started\n\n#### Installing :\n\n`$ pip install upydev` or ``$ pip install --upgrade upydev`` to update to the latest version available\n\n#### Create a configuration file:\n\nupydev will use local working directory configuration unless it does not find any or manually indicated with `-g` option.\n\n- To save configuration in working directory:\n\n  ``$ upydev config -t [DEVICE ADDRESS] -p [PASSWORD/BAUDRATE]``, where ``[DEVICE ADDRESS]`` must be a valid :\n\n  * **IP/HOSTNAME**\n\n  * **SERIAL ADDRESS**\n\n  * **MAC ADDRESS/ UUID**\n\n  \u003e Hostname must be set in device, e.g. in esp32 default is ``esp32.local``\n  \u003e\n  \u003e ``-p`` is set to 115200 by default, so it is not necessary unless using a different baudrate\n\n  \u003e MAC address format will depend on OS system (e.g. Linux uses MAC format 'XX:XX:XX:XX:XX:XX', and macOS uses UUID format 'XXXXXXXX-XXXX-XXXX-XXXX-XXXXXXXXXXXX')\n\n    e.g.\n\n  ```bash\n  # WiFi\n  $ upydev config -t 192.168.1.53 -p mypass\n\n  # SERIAL\n  $ upydev config -t /dev/tty.usbmodem387E386731342\n\n  # BLE\n  $ upydev config -t 9998175F-9A91-4CA2-B5EA-482AFC3453B9\n  ```\n\n  Default device name is ``upydevice``, to set a custom name use ``-@`` flag as\n\n```bash\n $ upydev config -t 192.168.1.53 -p mypass -@ mycustomdevice\n```\n\n  To check configuration ``upydev`` or ``upydev check``\n\n```bash\n$ upydev\nDevice: mycustomdevice\nAddress: 192.168.1.53, Device Type: WebSocketDevice\n```\n\n  Or to get more information if the device is online\n\n```bash\n$ upydev -i\nDevice: mycustomdevice\nWebSocketDevice @ ws://192.168.1.53:8266, Type: esp32, Class: WebSocketDevice\nFirmware: MicroPython v1.19.1-285-gc4e3ed964-dirty on 2022-08-12; ESP32 module with ESP32\n(MAC: 30:ae:a4:23:35:64, RSSI: -45 dBm)\n```\n\n- To save configuration globally use ``-g`` flag: ``$ upydev config -t [DEVICE ADDRESS] -p [PASSWORD/BAUDRATE] -g``\n\n  e.g.\n\n```bash\n$ upydev config -t 192.168.1.53 -p mypass -g\n```\n\n- To save configuration in a global group use ``-gg`` flag: ``$ upydev config -t [DEVICE ADDRESS] -p [PASSWORD/BAUDRATE] -gg -@ mydevice``\n\n  e.g.\n\n```bash\n$ upydev config -t 192.168.1.53 -p mypass -gg -@ mydevice\n```\n\n- [Optional]\n  Use `register` command to\n  define a function in ``~/.bashrc`` or ``~/.profile``\n\n```bash\n$ upydev register -@ mydevice\n```\n\nReload `~/.bashrc` or `~/.profile`,  e.g. (`$ source ~/.profile`)\n\nNow ``mydevice`` will accept any args and pass them to upydev, as well as\nautocompletion of args, e.g.\n\n```bash\n$ mydevice\nDevice: mydevice\nAddress: 192.168.1.53, Device Type: WebSocketDevice\n```\n\nOr if the device is connected.\n\n```bash\n$ mydevice -i\nDevice: mydevice\nWebSocketDevice @ ws://192.168.1.53:8266, Type: esp32, Class: WebSocketDevice\nFirmware: MicroPython v1.19.1-285-gc4e3ed964-dirty on 2022-08-12; ESP32 module with ESP32\n(MAC: 30:ae:a4:23:35:64, RSSI: -45 dBm)\n```\n\nTo see registered devices do:\n\n```bash\n$ upydev lsdevs\nDevice: mydevice\nAddress: 192.168.1.53, Device Type: WebSocketDevice\n```\n\nWhich adds the `lsdevs`  command to `~.profile`  too. So after reloading  again:\n\n```bash\n$ lsdevs\nDevice: mydevice\nAddress: 192.168.1.53, Device Type: WebSocketDevice\n```\n\nFinally to enter device shell-repl mode do:\n\n```bash\n$ upydev shl@mydevice\nshell-repl @ mydevice\nWebREPL connected\nWARNING: ENCRYPTION DISABLED IN THIS MODE\n\nMicroPython v1.19.1-285-gc4e3ed964-dirty on 2022-08-12; ESP32 module with ESP32\nType \"help()\" for more information.\n\n- CTRL-k to see keybindings or -h to see help\n- CTRL-s to toggle shell/repl mode\n- CTRL-x or \"exit\" to exit\nesp32@mydevice:~ $\n```\n\nor if the device is registered:\n\n```bash\n$ mydevice shl\nshell-repl @ mydevice\nWebSecREPL with TLSv1.2 connected\nTLSv1.2 @ ECDHE-ECDSA-AES128-CCM8 - 128 bits Encryption\n\nMicroPython v1.19.1-285-gc4e3ed964-dirty on 2022-08-12; ESP32 module with ESP32\nType \"help()\" for more information.\n\n- CTRL-k to see keybindings or -h to see help\n- CTRL-s to toggle shell/repl mode\n- CTRL-x or \"exit\" to exit\nesp32@mydevice:~ $\n```\n\n\u003e *To enable WebSocket over TLS or wss check [WebSocket (ws) / WebSocket Secure (wss) TLS ](https://upydev.readthedocs.io/en/latest/sslwebshellrepl.html)*\n\nOnce the device is configured see next section or read  [Usage documentation](https://upydev.readthedocs.io/en/latest/usage.html) to check which modes and tools are available.\n\nOr if you are working with more than one device continue with this [section](https://upydev.readthedocs.io/en/latest/gettingstarted.html#create-a-group-file) to create a group configuration.\n\n------\n\n#### uPydev Usage:\n\n*Requirement* : **Needs REPL to be accessible** (see [Getting Started](https://upydev.readthedocs.io/en/latest/gettingstarted.html))\n\nUsage:\n\n`$ upydev [Mode] [options] or upydev [upy command] [options]`\n\nThis means that if the first argument is not a Mode keyword or a\nupy command keyword it assumes it is a 'raw' upy command to send to the upy device\n\n##### Help: `$ upydev h`, `$ upydev help`, `$ upydev -h` or `$ upydev [command] -h`\n\nExample: Mode\n\n`$ upydev put dummy.py`, `$ upydev get dummy.py`\n\nExample: uPy command\n\n`$ upydev info`\n\nExample: Raw commands\n\n`$ upydev \"my_func()\"`\n\n`$ upydev 2+1`\n\n`$ upydev \"import my_lib;foo();my_var=2*3\"`\n\nTo see documentation check [Upydev readthedocs](https://upydev.readthedocs.io/en/latest/)\n","project_url":"https://awesome.ecosyste.ms/api/v1/projects/github.com%2Fcarglglz%2Fupydev","html_url":"https://awesome.ecosyste.ms/projects/github.com%2Fcarglglz%2Fupydev","lists_url":"https://awesome.ecosyste.ms/api/v1/projects/github.com%2Fcarglglz%2Fupydev/lists"}