{"id":15170416,"url":"https://github.com/p4irin/ubitlogger","last_synced_at":"2026-02-14T08:31:59.399Z","repository":{"id":233371283,"uuid":"786928788","full_name":"p4irin/ubitlogger","owner":"p4irin","description":"A micro:bit serial port logger","archived":false,"fork":false,"pushed_at":"2024-04-26T09:12:51.000Z","size":60,"stargazers_count":0,"open_issues_count":0,"forks_count":0,"subscribers_count":1,"default_branch":"main","last_synced_at":"2025-11-28T09:16:29.484Z","etag":null,"topics":["data-logger","iot","micro-python","microbit","microbit-v1","micropython","serial-port-listener"],"latest_commit_sha":null,"homepage":"","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/p4irin.png","metadata":{"files":{"readme":"README.md","changelog":null,"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,"roadmap":null,"authors":null,"dei":null,"publiccode":null,"codemeta":null}},"created_at":"2024-04-15T15:11:12.000Z","updated_at":"2025-02-19T22:28:36.000Z","dependencies_parsed_at":"2024-08-23T15:38:29.909Z","dependency_job_id":null,"html_url":"https://github.com/p4irin/ubitlogger","commit_stats":null,"previous_names":["p4irin/ubitlogger"],"tags_count":7,"template":false,"template_full_name":null,"purl":"pkg:github/p4irin/ubitlogger","repository_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/repositories/p4irin%2Fubitlogger","tags_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/repositories/p4irin%2Fubitlogger/tags","releases_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/repositories/p4irin%2Fubitlogger/releases","manifests_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/repositories/p4irin%2Fubitlogger/manifests","owner_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/owners/p4irin","download_url":"https://codeload.github.com/p4irin/ubitlogger/tar.gz/refs/heads/main","sbom_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/repositories/p4irin%2Fubitlogger/sbom","scorecard":null,"host":{"name":"GitHub","url":"https://github.com","kind":"github","repositories_count":286080680,"owners_count":29440342,"icon_url":"https://github.com/github.png","version":null,"created_at":"2022-05-30T11:31:42.601Z","updated_at":"2026-02-14T07:24:13.446Z","status":"ssl_error","status_checked_at":"2026-02-14T07:23:58.969Z","response_time":53,"last_error":"SSL_read: unexpected eof while reading","robots_txt_status":"success","robots_txt_updated_at":"2025-07-24T06:49:26.215Z","robots_txt_url":"https://github.com/robots.txt","online":false,"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":["data-logger","iot","micro-python","microbit","microbit-v1","micropython","serial-port-listener"],"created_at":"2024-09-27T08:02:21.693Z","updated_at":"2026-02-14T08:31:59.383Z","avatar_url":"https://github.com/p4irin.png","language":"Python","funding_links":[],"categories":[],"sub_categories":[],"readme":"[![ubitlogger CI](https://github.com/p4irin/ubitlogger/actions/workflows/ci.yml/badge.svg)](https://github.com/p4irin/ubitlogger/actions/workflows/ci.yml)\n[![ubitlogger publish](https://github.com/p4irin/ubitlogger/actions/workflows/python-publish.yml/badge.svg)](https://github.com/p4irin/ubitlogger/actions/workflows/python-publish.yml)\n![PyPI - Version](https://img.shields.io/pypi/v/ubitlogger)\n![PyPI - Python Version](https://img.shields.io/pypi/pyversions/ubitlogger)\n![PyPI - License](https://img.shields.io/pypi/l/ubitlogger)\n[![Static Badge](https://img.shields.io/badge/microbit-v1.3x-blue?logo=microbit\u0026link=https%3A%2F%2Ftech.microbit.org%2Fhardware%2F1-3-revision%2F)](https://tech.microbit.org/hardware/1-3-revision/)\n[![Static Badge](https://img.shields.io/badge/Ubuntu-22.04_LTS_jammy-orange?logo=ubuntu)](https://ubuntu.com/download/server)\n[![Static Badge](https://img.shields.io/badge/Raspberry_Pi-4B_8GB-red?logo=raspberrypi\u0026logoColor=red)](https://www.raspberrypi.com/products/)\n[![Ruff](https://img.shields.io/endpoint?url=https://raw.githubusercontent.com/astral-sh/ruff/main/assets/badge/v2.json)](https://github.com/astral-sh/ruff)\n# ubitlogger\n\nA micro:bit serial port logger\n\n## Stack\n\n- Python 3.8, 3.9, 3.10\n- Ubuntu 22.04 LTS jammy on\n    - WSL 2 on Windows 11\n        - usbipd-win to attach micro:bit to WSL\n    - Raspberry Pi 4B, 8GB\n- micro:bit\n    - Board revision 1.3B\n    - Bootloader 02xx\n    - Interface 0253\n    - See [update daplink version](https://tech.microbit.org/software/daplink-interface/#:~:text=It%20is%20possible%20to%20update%20the%20version%20of%20DAPLink%20running%20on%20your%20micro%3Abit)\n\n## Installation\n\n### From PyPI\n\n```bash\n(venv) $ pip install ubitlogger\n(venv) $\n```\n\n### or from GitHub\n\n```bash\n(venv) $ pip install git+https://github.com/p4irin/ubitlogger.git\n(venv) $\n```\n\n## Usage\n\n```bash\n# Show version\n(venv) $ ubitlogger -V\nx.y.x\n\n# Show help\n(venv) $ ubitlogger -h\nusage: ubitlogger [-h] [-V] {start,flash} ...\n\nmicro:bit serial port logger\n\noptions:\n  -h, --help     show this help message and exit\n  -V, --version  show version and exit.\n\nSub commands:\n  {start,flash}\n    start        start logging\n    flash        Flash an example sensor reader script to the micro:bit.\n                 Does NOT work on WSL! On Ubuntu jammy the micro:bit is\n                 NOT auto mounted! You need to mount it like \"sudo mount\n                 /dev/\u003cdevice\u003e /media/MICROBIT\" Figure out the \u003cdevice\u003e\n                 with \"sudo fdisk -l\". To flash, you need sudo and the\n                 path to ubitlogger! I.e., \"sudo venv/bin/ubitlogger\n                 flash -s light\", assuming you use a virtualenv venv.\n\n# Show help on start sub command\n(venv) $ ubitlogger start -h\nusage: ubitlogger start [-h] [-d] [-t TIMEOUT] [-i INTERVAL]\n\noptions:\n  -h, --help            show this help message and exit\n  -d, --debug           show debugging output\n  -t TIMEOUT, --timeout TIMEOUT\n                        set a timeout (float)\n  -i INTERVAL, --interval INTERVAL\n                        time between readings\n\n# Show help on the flash sub command\n(venv) $ ubitlogger flash -h\nusage: ubitlogger flash [-h] -s {temperature,light,accelerometer,radio} [-rg RADIO_GROUP]\n\noptions:\n  -h, --help            show this help message and exit\n  -s {temperature,light,accelerometer,radio}, --sensor {temperature,light,accelerometer,radio}\n                        Specify the sensor to read\n  -rg RADIO_GROUP, --radio-group RADIO_GROUP\n                        Specify the \"group\" the radio should listen on.\n                        A \"group\" is a number between 0 and 255, inclusive.\n                        The default is 0.\n\n# Log to the console with defaults\n(venv) $ ubitlogger start\n...\n\u003cdata\u003e\n...\n# Hit CTRL-C to stop logging\n^C\nExited by CTRL-C\nCleaning up thread\n--\u003e Waiting for thread to finish\n\n# Log to a file\n(venv) $ ubitlogger start \u003e data.log\n\n# Flashing an example script to read a sensor (temperature, light, accelerometer and radio).\n# This doesn't work on WSL as we can't mount the micro:bit as a\n# USB mass storage device.\n# On Ubuntu jammy the micro:bit isn't auto mounted.\n# First figure out the device with\n(venv) $ sudo fdisk -l\n# and then mount it like this\n(venv) $ sudo mount /dev/\u003cdevice\u003e /media/MICROBIT\n\n# Flash a script to the micro:bit that reads the light sensor and sends\n# readings to the serial port.\n(venv) $ sudo venv/bin/ubitlogger flash -s light\n\n# Flash a script to the micro:bit that lets it act like a\n# receiver of data send by other micro:bits. Data received\n# is sent over the serial link to ubitlogger.\n# This example flashes a script that listens on radio group 6.\n(venv) $ sudo venv/bin/ubitlogger flash -s radio -rg 6\n(venv) $ ubitlogger start -d\n```\n\n## Using ubitlogger from a linux distro on WSL 2\n\nConnect a USB device to your linux distro on WSL 2 using [usbipd-win](https://github.com/dorssel/usbipd-win)\n\nList USB devices\n\n```powershell\nPS C:\\Users\\p4irin\u003e usbipd list --usbids\n\nConnected:\nBUSID  VID:PID  DEVICE                          STATE\n1-1    046d:c534  Logitech, Inc., NanoReceiver  Not shared\n1-3    0d28:0204  NXP, ARM  mbed                Not Shared\n...\n```\n\nRegister/bind a USB device for sharing. Device \"NXP, ARM mbed\" with busid _1-3_ identifies our micro:bit:\n\n```powershell\nPS C:\\Users\\p4irin\u003e usbipd bind --busid 1-3\n```\n\nIf you list USB devices again, the microbit wil show up as _Shared_:\n\n```powershell\nPS C:\\Users\\p4irin\u003e usbipd list --usbids\n\nConnected:\nBUSID  VID:PID  DEVICE                          STATE\n1-1    046d:c534  Logitech, Inc., NanoReceiver  Not shared\n1-3    0d28:0204  NXP, ARM  mbed                Shared\n...\nPS C:\\Users\\p4irin\u003e\n```\n\nAttach the USB device to WSL:\n\n```powershell\nPS C:\\Users\\p4irin\u003e usbipd attach --wsl --busid 1-3 --auto-attach\n\nusbipd: info: Using WSL distribution 'Ubuntu-22.04' to attach; the device will be available in all WSL 2 distributions.\nusbipd: info: Using IP address 172.21.144.1 to reach the host.\nusbipd: info: Starting endless attach loop; press Ctrl+C to quit.\n\nPS C:\\Users\\p4irin\u003e\n```\n\nListing USB devices will show the micro:bit attached:\n\n```powershell\nPS C:\\Users\\p4irin\u003e usbipd list --usbids\n\nConnected:\nBUSID  VID:PID  DEVICE                          STATE\n1-1    046d:c534  Logitech, Inc., NanoReceiver  Not shared\n1-3    0d28:0204  NXP, ARM  mbed                Attached\n...\nPS C:\\Users\\p4irin\u003e\n```\n\nIn your WSL distro's terminal, check if the micro:bit is listed:\n\n```bash\n$ lsusb\nBus 002 Device 001: ID 1d6b:0003 Linux Foundation 3.0 root hub\nBus 001 Device 004: ID 0d28:0204 NXP ARM mbed\nBus 001 Device 001: ID 1d6b:0002 Linux Foundation 2.0 root hub\n$\n```\n\nNow run _ubitlogger_ in your Python virtualenv:\n\n```bash\n(venv) $ ubitlogger start -d -t 3\n\nFound a micro:bit on: /dev/ttyACM0\nListening on port /dev/ttyACM0\nBaudrate: 115200\nData bits: 8\nStop bits: 1\nParity: N\ntimeout: 3.0\n18 17\n18 6\n^C\nExited by CTRL-C\nCleaning up thread\n--\u003e Waiting for thread to finish.\n\n(venv) $\n```\n\nTo detach the device from WSL:\n\n```powershell\nPS C:\\Users\\p4irin\u003e usbipd detach --busid 1-3\n```\n\n## Reference\n\n* [pySerial](https://pythonhosted.org/pyserial/)\n* [usbipd-win](https://github.com/dorssel/usbipd-win)\n* [micro:bit 1.3x](https://tech.microbit.org/hardware/1-3-revision/)","project_url":"https://awesome.ecosyste.ms/api/v1/projects/github.com%2Fp4irin%2Fubitlogger","html_url":"https://awesome.ecosyste.ms/projects/github.com%2Fp4irin%2Fubitlogger","lists_url":"https://awesome.ecosyste.ms/api/v1/projects/github.com%2Fp4irin%2Fubitlogger/lists"}