{"id":14967314,"url":"https://github.com/carglglz/upyble","last_synced_at":"2025-09-02T23:38:22.647Z","repository":{"id":57477319,"uuid":"265602315","full_name":"Carglglz/upyble","owner":"Carglglz","description":"Command line tool for Bluetooth Low Energy MicroPython devices","archived":false,"fork":false,"pushed_at":"2020-08-20T18:22:34.000Z","size":4918,"stargazers_count":20,"open_issues_count":2,"forks_count":5,"subscribers_count":2,"default_branch":"master","last_synced_at":"2025-07-11T05:35:08.568Z","etag":null,"topics":["ble","bluetooth-low-energy","cli","embedded","micropython","python","repl","shell","terminal"],"latest_commit_sha":null,"homepage":null,"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}},"created_at":"2020-05-20T15:07:44.000Z","updated_at":"2025-01-09T11:40:11.000Z","dependencies_parsed_at":"2022-09-26T17:41:05.832Z","dependency_job_id":null,"html_url":"https://github.com/Carglglz/upyble","commit_stats":null,"previous_names":[],"tags_count":1,"template":false,"template_full_name":null,"purl":"pkg:github/Carglglz/upyble","repository_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/repositories/Carglglz%2Fupyble","tags_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/repositories/Carglglz%2Fupyble/tags","releases_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/repositories/Carglglz%2Fupyble/releases","manifests_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/repositories/Carglglz%2Fupyble/manifests","owner_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/owners/Carglglz","download_url":"https://codeload.github.com/Carglglz/upyble/tar.gz/refs/heads/master","sbom_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/repositories/Carglglz%2Fupyble/sbom","scorecard":{"id":27360,"data":{"date":"2025-08-11","repo":{"name":"github.com/Carglglz/upyble","commit":"e95ecc235e7d1d863efaa80eb092aeb070c6de3a"},"scorecard":{"version":"v5.2.1-40-gf6ed084d","commit":"f6ed084d17c9236477efd66e5b258b9d4cc7b389"},"score":2.7,"checks":[{"name":"Packaging","score":-1,"reason":"packaging workflow not detected","details":["Warn: no GitHub/GitLab publishing workflow detected."],"documentation":{"short":"Determines if the project is published as a package that others can easily download, install, easily update, and uninstall.","url":"https://github.com/ossf/scorecard/blob/f6ed084d17c9236477efd66e5b258b9d4cc7b389/docs/checks.md#packaging"}},{"name":"Code-Review","score":0,"reason":"Found 0/30 approved changesets -- score normalized to 0","details":null,"documentation":{"short":"Determines if the project requires human code review before pull requests (aka merge requests) are merged.","url":"https://github.com/ossf/scorecard/blob/f6ed084d17c9236477efd66e5b258b9d4cc7b389/docs/checks.md#code-review"}},{"name":"Token-Permissions","score":-1,"reason":"No tokens found","details":null,"documentation":{"short":"Determines if the project's workflows follow the principle of least privilege.","url":"https://github.com/ossf/scorecard/blob/f6ed084d17c9236477efd66e5b258b9d4cc7b389/docs/checks.md#token-permissions"}},{"name":"Dangerous-Workflow","score":-1,"reason":"no workflows found","details":null,"documentation":{"short":"Determines if the project's GitHub Action workflows avoid dangerous patterns.","url":"https://github.com/ossf/scorecard/blob/f6ed084d17c9236477efd66e5b258b9d4cc7b389/docs/checks.md#dangerous-workflow"}},{"name":"Maintained","score":0,"reason":"0 commit(s) and 0 issue activity found in the last 90 days -- score normalized to 0","details":null,"documentation":{"short":"Determines if the project is \"actively maintained\".","url":"https://github.com/ossf/scorecard/blob/f6ed084d17c9236477efd66e5b258b9d4cc7b389/docs/checks.md#maintained"}},{"name":"SAST","score":0,"reason":"no SAST tool detected","details":["Warn: no pull requests merged into dev branch"],"documentation":{"short":"Determines if the project uses static code analysis.","url":"https://github.com/ossf/scorecard/blob/f6ed084d17c9236477efd66e5b258b9d4cc7b389/docs/checks.md#sast"}},{"name":"CII-Best-Practices","score":0,"reason":"no effort to earn an OpenSSF best practices badge detected","details":null,"documentation":{"short":"Determines if the project has an OpenSSF (formerly CII) Best Practices Badge.","url":"https://github.com/ossf/scorecard/blob/f6ed084d17c9236477efd66e5b258b9d4cc7b389/docs/checks.md#cii-best-practices"}},{"name":"Binary-Artifacts","score":10,"reason":"no binaries found in the repo","details":null,"documentation":{"short":"Determines if the project has generated executable (binary) artifacts in the source repository.","url":"https://github.com/ossf/scorecard/blob/f6ed084d17c9236477efd66e5b258b9d4cc7b389/docs/checks.md#binary-artifacts"}},{"name":"Security-Policy","score":0,"reason":"security policy file not detected","details":["Warn: no security policy file detected","Warn: no security file to analyze","Warn: no security file to analyze","Warn: no security file to analyze"],"documentation":{"short":"Determines if the project has published a security policy.","url":"https://github.com/ossf/scorecard/blob/f6ed084d17c9236477efd66e5b258b9d4cc7b389/docs/checks.md#security-policy"}},{"name":"Pinned-Dependencies","score":-1,"reason":"no dependencies found","details":null,"documentation":{"short":"Determines if the project has declared and pinned the dependencies of its build process.","url":"https://github.com/ossf/scorecard/blob/f6ed084d17c9236477efd66e5b258b9d4cc7b389/docs/checks.md#pinned-dependencies"}},{"name":"Fuzzing","score":0,"reason":"project is not fuzzed","details":["Warn: no fuzzer integrations found"],"documentation":{"short":"Determines if the project uses fuzzing.","url":"https://github.com/ossf/scorecard/blob/f6ed084d17c9236477efd66e5b258b9d4cc7b389/docs/checks.md#fuzzing"}},{"name":"Vulnerabilities","score":10,"reason":"0 existing vulnerabilities detected","details":null,"documentation":{"short":"Determines if the project has open, known unfixed vulnerabilities.","url":"https://github.com/ossf/scorecard/blob/f6ed084d17c9236477efd66e5b258b9d4cc7b389/docs/checks.md#vulnerabilities"}},{"name":"License","score":10,"reason":"license file detected","details":["Info: project has a license file: LICENSE:0","Info: FSF or OSI recognized license: MIT License: LICENSE:0"],"documentation":{"short":"Determines if the project has defined a license.","url":"https://github.com/ossf/scorecard/blob/f6ed084d17c9236477efd66e5b258b9d4cc7b389/docs/checks.md#license"}},{"name":"Signed-Releases","score":0,"reason":"Project has not signed or included provenance with any releases.","details":["Warn: release artifact v0.0.3 not signed: https://api.github.com/repos/Carglglz/upyble/releases/28092741","Warn: release artifact v0.0.3 does not have provenance: https://api.github.com/repos/Carglglz/upyble/releases/28092741"],"documentation":{"short":"Determines if the project cryptographically signs release artifacts.","url":"https://github.com/ossf/scorecard/blob/f6ed084d17c9236477efd66e5b258b9d4cc7b389/docs/checks.md#signed-releases"}},{"name":"Branch-Protection","score":0,"reason":"branch protection not enabled on development/release branches","details":["Warn: branch protection not enabled for branch 'master'"],"documentation":{"short":"Determines if the default and release branches are protected with GitHub's branch protection settings.","url":"https://github.com/ossf/scorecard/blob/f6ed084d17c9236477efd66e5b258b9d4cc7b389/docs/checks.md#branch-protection"}}]},"last_synced_at":"2025-08-14T18:12:45.648Z","repository_id":57477319,"created_at":"2025-08-14T18:12:45.648Z","updated_at":"2025-08-14T18:12:45.648Z"},"host":{"name":"GitHub","url":"https://github.com","kind":"github","repositories_count":273367403,"owners_count":25092862,"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","status":"online","status_checked_at":"2025-09-02T02:00:09.530Z","response_time":77,"last_error":null,"robots_txt_status":"success","robots_txt_updated_at":"2025-07-24T06:49:26.215Z","robots_txt_url":"https://github.com/robots.txt","online":true,"can_crawl_api":true,"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":["ble","bluetooth-low-energy","cli","embedded","micropython","python","repl","shell","terminal"],"created_at":"2024-09-24T13:37:50.133Z","updated_at":"2025-09-02T23:38:22.594Z","avatar_url":"https://github.com/Carglglz.png","language":"Python","funding_links":[],"categories":[],"sub_categories":[],"readme":"\u003cimg align=\"right\" width=\"200\" height=\"100\" src=\"https://raw.githubusercontent.com/Carglglz/upyble/master/uPyblelogo.png\"\u003e\n\n# uPyble\n\n[![PyPI version](https://badge.fury.io/py/upyble.svg)](https://badge.fury.io/py/upyble)[![PyPI license](https://img.shields.io/pypi/l/ansicolortags.svg)](https://pypi.python.org/pypi/ansicolortags/)\n\n### Command line tool for Bluetooth Low Energy  devices\n\n**uPyble** is intended to be a command line tool [upydev-like](https://github.com/Carglglz/upydev/) to make easier the development, prototyping and testing process of devices based on boards running *MicroPython with **Bluetooth Low Energy** capabilities.\n\n\\*( Any other BLE device should work as well)\n\n⚠️ ***Keep in mind that this project is in ALPHA state, sometimes, some commands may not work/return anything*** ⚠️\n\n### Features:\n\n* Command line wireless communication/control of MicroPython/other devices.\n* Custom commands to automate communication/control\n* Command line autocompletion\n* Terminal BLE SHELL-REPL 🔸🔺\n* Custom DFU Profile (`dfu_target.py` in profiles) and dfu commands to send scripts through BLE.\n\n\n\n🔸 (REPL works,  but some SHELL commands are still under development)\n\n🔺 There is a limit in the amount of output it can produce, so long lists or `cat` a big file will freeze the BLE SHELL-REPL and possibly the device, which makes a reset almost inevitable.\n\n------\n\n### Getting Started\n\nTo use Terminal BLE SHELL-REPL :\n\nFirst be sure that the **BLE REPL daemon is enabled** and running:\n\n* 1) Put `ble_advertising.py` ,`ble_uart_peripheral.py` and `ble_uart_repl.py` in the device\n\n* 2) Add these lines to `main.py`:\n  \n     ```python\n     import ble_uart_repl\n     ble_uart_repl.start()\n     ```\n\n*These scripts are in upybleutils directory. (Originals from [MicroPython repo bluetooth examples](https://github.com/micropython/micropython/tree/master/examples/bluetooth))*\n\n#### Installing :\n\n`$ pip install upyble` or ``$ pip install --upgrade upyble`` to update to the last version available\n\n#### Finding BLE devices:\n\nUse `$ upyble scan` or `$ upyble tscan` for table output format.\n\n```\n$ upyble tscan\nScanning...\nScanning...\nBLE device/s found: 1\n==============================================================================\n        NAME         |                   UUID                   | RSSI (dBm) |\n esp32-30aea4233564  |   9998175F-9A91-4CA2-B5EA-482AFC3453B9   |   -68.0    |\n```\n\n#### Create a configuration file:\n\n\\*upyble 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: `$ upyble config -t [UPYDEVICE UUID]`\n  \n  e.g:\n  \n  `$ upyble config -t 9998175F-9A91-4CA2-B5EA-482AFC3453B9 `\n* To save configuration globally use -g flag: `$ upyble config -t [UPYDEVICE UUID]  -g`\n  \n  e.g.\n  \n  `$ upyble config -t 9998175F-9A91-4CA2-B5EA-482AFC3453B9 -g `\n  \n  \\* Be aware that some devices may generate random UUID every a couple of minutes, so this won't be useful in those cases.\n\n------\n\n### uPyble Usage:\n\nUsage:\n\n`$ upyble [Mode] [options]`\n\nThis means that if the first argument is not a Mode keyword it assumes it is a 'raw' upy command to send to the upy device\n\n##### Help: `$ upyble -h`\n\n------\n\n#### uPyble Mode/Tools:\n\n- **`upyble check`**: to check local machine Bluetooth characterisctics\n- **`upyble config`**: save upy device settings (*see `-t`, `-g`)*, so the target uuid argument wont be required any more\n- **`upyble scan`**: to scan for BLE devices (*see `-n` for max number of scans)*\n- **`upyble tscan`**: to scan for BLE devices, results with table format\n- **`upyble sconf`**: to scan and configure a device that matches a name *`-d [NAME]`*\n- **`upyble get_services`**: to get services of a device, use *`-r`* to read them and *`-mdata`* to see available metadata\n- **`upyble get_stag`**: to get service tag from a service code, use *`-scode`* to indicate the code\n- **`upyble get_scode`**: to get service code from a service tag, use *`-stag`* to indicate the tag\n- **`upyble get_ctag`**: to get characteristic tag from characteristic code, use *`-ccode`* to indicate the code\n- **`upyble get_ccode`**: to get characteristic code from a characteristic tag, use *`-ctag`* to indicate the tag\n- **`upyble get_aptag`**: to get appearance tag from an appearance code, use *`-apcode`* to indicate the code\n- **`upyble get_apcode`**: to get appearance code from an appearance tag, use *`-aptag`* to indicate the tag\n- **`upyble get_mtag`:** to get manufacturer tag from manufacturer code, use *`-mcode`* to indicate the code\n- **`upyble get_mcode`**: to get manufacturer code from a manufacturer tag, use *`-mtag`* to indicate the tag\n- **`upyble cmdata`**: to get characteristic metadata (name, type, uuid, unit, format, notes...). (Not all characteristics are available yet), Use *`-c`* option to indicate characteristic or *`-c all`* to see all that are available. Use *`-xml`* to see the xml file instead.\n- **`upyble cmdata_t`**: get_cmdata in table format.\n- **`upyble dmdata `**:  to get descriptor metadata (Name, uuid, format...). Use *`-desc`* option to indicate a descriptor or  *`-desc all`* to see all that are available.\n- **`upyble follow`**:   to read from a service (see *`-s`,* *` -c`* , *` -tm`*) , e.g : `upyble follow -s \"Battery Service\" `, will read all readable characteristics, or use  *` -c`*  to indicate a specific one/group. e.g:  `upyble follow -s \"Battery Service\" -c \"Battery Level\"`. This mode autodetects format and unit from characteristic metadata\n- **`upyble rfollow`**:   to read from a service (see *`-s`,* *` -c`* , *` -tm`*, *`-u`* , *`fmt`* and  *`-x`*) , e.g : `upyble follow -s \"Battery Service\" `, will read all readable characteristics, or use  *` -c`*  to indicate a specific one/group. e.g:  `upyble follow -s \"Battery Service\" -c \"Battery Level\"`\n- **`upyble see`**: to get specific info about a devices group use `-G` option as `see -G [GROUP NAME]`\n- **`upyble brepl`**: to enter the BLE SHELL-REPL\n- **`upyble ble@[DEVICE]`**: to access brepl in a 'ssh' style command if a device is stored in a global group called `UPYBLE_G` (this needs to be created first doing e.g. `$ upyble make_group -g -f UPYBLE_G -devs foo_device UUID`) The device can be accessed as `$ upyble ble@foo_device` or redirect any command as e.g. `$ upyble get_services -@foo_device`.\n- **`upyble make_group`**: to make a group of boards to send commands to. Use -f for the name  of the group and -devs option to indicate a name and uuid of each board. (To store the group settings globally use -g option)\n- **`upyble mg_group`**: to manage a group of boards to send commands to. Use -G for the name of the group and -add option to add devices (indicate a name and uuid of each board) or -rm to remove devices (indicated by name)\n\n____\n\n#### Examples: \n\n##### \tFollow the Battery Level and Temperature (cpu) of an Esp32.\n\n​\tThis needs `ble_batt_temp.py` in the device. (See [upybleutils](https://github.com/Carglglz/upyble/tree/master/upybleutils))\n\n​\tIn the device REPL do:\n\n```python\n\u003e\u003e\u003e import ble_batt_temp\n\u003e\u003e\u003e ble_batt_temp.ble_batt.start_batt_bg()\n```\n\nNow in local Shell/Terminal:\n\n1. Scan and configure device:\n\n   ```bash\n   $ upyble scan\n   Scanning...\n   Scanning...\n   BLE device/s found: 1\n   NAME: esp32-batt-temp, UUID: 9998175F-9A91-4CA2-B5EA-482AFC3453B9, RSSI: -59.0 dBm, Services: Environmental Sensing\n   \n   $ upyble config -t 9998175F-9A91-4CA2-B5EA-482AFC3453B9 -g\n   upyble device settings saved globally!\n   ```\n\n   \n\n2. Follow services\n\n```bash\n$ upyble follow -s all\nFollowing service: all\n[Service] 180A: Device Information\n\t[Characteristic] 2A01: (read) | Name: Appearance\n\t[Characteristic] 2A29: (read) | Name: Manufacturer Name String\n[Service] 180F: Battery Service\n\t[Characteristic] 2A19: (read,notify) | Name: Battery Level\n\t\t[Descriptor] 2902: (Handle: 19)\n[Service] 181A: Environmental Sensing\n\t[Characteristic] 2A6E: (read,notify) | Name: Temperature\n\t\t[Descriptor] 2902: (Handle: 23)\n15:35:28,813 [upyble@esp32-batt-temp] Battery Service [Battery Level] : 77.0 %\n15:35:28,843 [upyble@esp32-batt-temp] Environmental Sensing [Temperature] : 56.67 °C\n15:35:33,883 [upyble@esp32-batt-temp] Battery Service [Battery Level] : 76.0 %\n15:35:33,913 [upyble@esp32-batt-temp] Environmental Sensing [Temperature] : 56.67 °C\n15:35:38,954 [upyble@esp32-batt-temp] Battery Service [Battery Level] : 76.0 %\n15:35:38,983 [upyble@esp32-batt-temp] Environmental Sensing [Temperature] : 56.67 °C\n15:35:44,024 [upyble@esp32-batt-temp] Battery Service [Battery Level] : 71.0 %\n15:35:44,053 [upyble@esp32-batt-temp] Environmental Sensing [Temperature] : 56.67 °C\n^CDisconnected successfully\n```\n\nSee more usage examples at [EXAMPLES](https://github.com/Carglglz/upyble/blob/master/DOCS/EXAMPLES.md) doc.\n\n___\n\n### ABOUT\n\nTo see more information about upyble dependencies, requirements, tested devices, etc see [ABOUT](https://github.com/Carglglz/upyble/blob/master/DOCS/ABOUT.md) doc.\n","project_url":"https://awesome.ecosyste.ms/api/v1/projects/github.com%2Fcarglglz%2Fupyble","html_url":"https://awesome.ecosyste.ms/projects/github.com%2Fcarglglz%2Fupyble","lists_url":"https://awesome.ecosyste.ms/api/v1/projects/github.com%2Fcarglglz%2Fupyble/lists"}