{"id":18103059,"url":"https://github.com/smittytone/depot","last_synced_at":"2025-10-08T21:06:18.056Z","repository":{"id":158060024,"uuid":"610902323","full_name":"smittytone/Depot","owner":"smittytone","description":"Multi-bus clients for macOS and Linux, and bus-host board firmware for the RP2040.","archived":false,"fork":false,"pushed_at":"2025-08-21T17:27:23.000Z","size":1880,"stargazers_count":18,"open_issues_count":1,"forks_count":1,"subscribers_count":2,"default_branch":"main","last_synced_at":"2025-10-08T21:06:14.961Z","etag":null,"topics":["1-wire","i2c","linux","macos","raspberry-pi-pico","rp2040"],"latest_commit_sha":null,"homepage":"","language":"C","has_issues":true,"has_wiki":null,"has_pages":null,"mirror_url":null,"source_name":null,"license":"other","status":null,"scm":"git","pull_requests_enabled":true,"icon_url":"https://github.com/smittytone.png","metadata":{"files":{"readme":"README.md","changelog":null,"contributing":null,"funding":null,"license":"LICENSE.md","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,"zenodo":null,"notice":null,"maintainers":null,"copyright":null,"agents":null,"dco":null,"cla":null}},"created_at":"2023-03-07T17:59:18.000Z","updated_at":"2025-07-13T22:08:43.000Z","dependencies_parsed_at":null,"dependency_job_id":"06917a73-6b19-474d-9f86-ce555faaecbd","html_url":"https://github.com/smittytone/Depot","commit_stats":null,"previous_names":[],"tags_count":3,"template":false,"template_full_name":null,"purl":"pkg:github/smittytone/Depot","repository_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/repositories/smittytone%2FDepot","tags_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/repositories/smittytone%2FDepot/tags","releases_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/repositories/smittytone%2FDepot/releases","manifests_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/repositories/smittytone%2FDepot/manifests","owner_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/owners/smittytone","download_url":"https://codeload.github.com/smittytone/Depot/tar.gz/refs/heads/main","sbom_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/repositories/smittytone%2FDepot/sbom","scorecard":null,"host":{"name":"GitHub","url":"https://github.com","kind":"github","repositories_count":279000716,"owners_count":26082837,"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-10-08T02:00:06.501Z","response_time":56,"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":["1-wire","i2c","linux","macos","raspberry-pi-pico","rp2040"],"created_at":"2024-10-31T22:10:06.837Z","updated_at":"2025-10-08T21:06:18.032Z","avatar_url":"https://github.com/smittytone.png","language":"C","funding_links":[],"categories":[],"sub_categories":[],"readme":"# Depot 1.2.2\n\nMulti-bus clients for macOS and Linux, and bus-host adaptor board firmware for the RP2040.\n\nIt is used as the basis for I\u0026sup2;C client apps for generic I\u0026sup2;C usage, and to operate Holtek HT16K33-controlled matrix and segment LED displays, and 1-Wire apps for generic 1-Wire usage and to use the Analog Devices DS18B20 sensors.\n\n![Driving a pair of LTP305 LED matrices as a CPU activity indicator](images/matrix_002.webp)\n\nThe client code is largely written in C, and will compile and run on both macOS and Linux. The exceptions are the DS18B20 command-line utility and DS18B20 GUI app, both of which are written in Swift — and the latter is built for the macOS GUI.\n\nWhy Depot? Because it’s a place in which you’ll find lots of buses.\n\n**Note** This repo supersedes and extends [cli2c](https://github.com/smittytone/cli2c), the previous repo for this code, now archived. However, Depot maintains the older repo’s versioning.\n\n## Hardware Requirements\n\n### Bus Host Board\n\nThe bus host board is a [Raspberry Pi Pico](https://www.raspberrypi.com/documentation/microcontrollers/raspberry-pi-pico.html), [Adafruit QTPy RP2040](https://www.adafruit.com/product/4900), [Adafruit QT2040 Trinkey](https://www.adafruit.com/product/5056), [SparkFun ProMicro RP2040](https://www.sparkfun.com/products/18288), [Pimoroni Tiny 2040](https://shop.pimoroni.com/products/tiny-2040?variant=39560012234835) or [Arduino Nano RP2040 Connect](https://store.arduino.cc/products/arduino-nano-rp2040-connect-with-headers).\n\nIt runs the included firmware and connects to a host computer via USB.\n\n![Driving a segment display with the Arduino Nano](images/nano_seg.webp)\n\nFrom version 1.2.2, the build system will use the standard Pico SDK environment variable `PICO_BOARD`, if set, to configure compilation for a particular supported board. If the variable is undefined, or set to a board not yet supported by Depot, the firmware will be built for all supported boards.\n\n| Board | `PICO_BOARD` Value |\n| :-- | :-- |\n| Pico | `pico` |\n| QTPy | `adafruit_qtpy_rp2040` |\n| ProMicro | `sparkfun_promicro` |\n| Tiny | `pimoroni_tiny2040` |\n| Trinkey | `adafruit_trinkey_qt2040` |\n| Nano | `arduino_nano_rp2040_connect` |\n\n* There’s more information [in this blog post](https://blog.smittytone.net/2023/03/16/meet-depot-an-rp2040-based-multi-bus-adaptor-for-macs-and-linux-pcs/).\n\n## Build the Client Apps\n\n#### macOS\n\nYou can build the code from the accompanying Xcode project files:\n\n* `cli2c.xcodeproj` — Contains `cli2c`. `segment` and `matrix`.\n* `cliwire.xcodeproj` — Contains `cliwire`, `ds18b20` and `sensor` (GUI).\n\nIn each case:\n\n1. Archive the project.\n1. Save the build products on the desktop.\n1. Copy the binary artifacts to your preferred location listed in `$PATH`.\n\n#### Linux\n\n1. Navigate to the repo directory.\n1. `cd linux`\n1. `cmake -S . -B build -D`\n1. `cmake --build build`\n1. Copy the binary artifacts to your preferred location listed in `$PATH`.\n\n## Build and Deploy the Bus Host Firmware\n\n**Important** WE STRONGLY RECOMMEND YOU BUILD THE FIRMWARE WITH PICO SDK 1.5.0 OR ABOVE.\n\n1. Navigate to the repo directory.\n1. Optionally enter `export PICO_BOARD=x`, where x is a board name ([see above](#bus-host-board)).\n1. `cmake -S . -B firmwarebuild`\n1. `cmake --build firmwarebuild`\n1. Write the firmware depending on which board you are using:\n    * `./deploy.sh /path/to/device firmwarebuild/firmware/pico/firmware_pico_rp2040.uf2`\n    * `./deploy.sh /path/to/device firmwarebuild/firmware/qtpy/firmware_qtpy_rp2040.uf2`\n    * `./deploy.sh /path/to/device firmwarebuild/firmware/promicro/firmware_promicro.uf2`\n    * `./deploy.sh /path/to/device firmwarebuild/firmware/tiny/firmware_tiny2040.uf2`\n    * `./deploy.sh /path/to/device firmwarebuild/firmware/trinkey/firmware_trinkey2040.uf2`\n    * `./deploy.sh /path/to/device firmwarebuild/firmware/nano/firmware_arduino_nano.uf2.uf2`\n\nThe deploy script tricks the RP2040-based board into booting into disk mode, then copies over the newly build firmware. When the copy completes, the RP2040 automatically reboots. This saves of a lot of tedious power-cycling with the BOOT button held down.\n\n#### Debug vs Release\n\nYou can switch between build types when you make the `cmake` call in step 2, above. A debug build is made by default, but you can make this explicit with\n\n```shell\ncmake -S . -B firmwarebuild -D CMAKE_BUILD_TYPE=Debug\n```\n\nFor a release build, which among various optimisations omits UART debugging code, call:\n\n```shell\ncmake -S . -B firmwarebuild -D CMAKE_BUILD_TYPE=Release\n```\n\nFollow both of these commands with the usual\n\n```shell\ncmake --build firmwarebuild\n```\n\n## What’s What\n\nThe contents of this repo are:\n\n```\n/depot\n|\n|___/client                         // Client-side code, written in C\n|   |___/cli2c                      // A generic CLI tool for any I\u0026sup2;C device\n|   |___/matrix                     // An HT16K33 8x8 matrix-oriented version of cli2c\n|   |___/segment                    // An HT16K33 4-digit, 7-segment-oriented version of cli2c\n|   |___/cliwire                    // A generic CLI tool for any 1-Wire device\n|   |___/common                     // Code common to all versions\n|   |___/i2c                        // I2C driver code\n|   |___/onewire                    // 1-Wire driver code\n|   |___/ds18b20                    // A DS18B20-oriented version of cliwire\n|   |___/sensor                     // A macOS GUI app the uses the 1-Wire and serial driver code.\n|\n|___/firmware                       // The RP2040 host firmware, written in C\n|   |___/pico                       // The Raspberry Pi Pico version\n|   |___/nano                       // An Arduino Nano RP2040 Connect version\n|   |___/promicro                   // A SparkFun ProMicro RP2040 version\n|   |___/qtpy                       // An Adafruit QTPy RP2040 version\n|   |___/tiny                       // A Pimoroni Tiny 2040 version\n|   |___/trinkey                    // An Adafruit QT2040 Trinkey version\n|   |___/common                     // Code common to all versions\n|\n|___/examples                       // Demo apps\n|   |___cpu_chart_matrix.py         // CPU utilization display for 8x8 matrix LEDs\n|   |___cpu_chart_segment.py        // CPU utilization display for 4-digit segment LEDs\n|   |___cpu_chart_ltp305_cli2c.py   // CPU utilization display for twin LTP305 matrices\n|   |___mcp9809_temp.py             // Periodic temperature reports from an MCP9808 sensor\n|\n|___/linux                          // Linux build settings (Cmake) for the client apps\n|\n|___CMakeLists.txt                  // Top-level firmware project CMake config file\n|___pico_sdk_import.cmake           // Raspberry Pi Pico SDK CMake import script\n|\n|___firmware.code-workspace         // Visual Studio Code workspace for the RP2040 firmware\n|___cli2c.xcodeproj                 // Xcode project for cli2c, matrix and segment\n|___cliwire.xcodeproj               // Xcode project for cliwire\n|\n|___deploy.sh                       // A .uf2 deployment script that saves pressing\n|                                   // RESET/BOOTSEL buttons.\n|\n|___README.md\n|___LICENSE.md\n```\n\n## Devices\n\nUnder macOS, RP2040-based boards will appear in `/dev` as `cu.usbmodemXXXXX` or `cpu_chart_ltp305_cli2c.py`. You can use my [`dlist()`](https://blog.smittytone.net/2022/09/08/how-to-manage-serial-devices-on-mac/) shell function to save looking up and keying in these names, which can vary across boots.\n\nUnder Linux, specifically Raspberry Pi OS, boards appear as `/dev/ttyACM0`. You may need to add your user account to the group `dialout` in order to access the port:\n\n1. Run `sudo adduser smitty dialout`\n1. Log out and then back in again.\n\n## Client Apps\n\nThe following client apps are included in the repo. They are documented [on my documentation site](https://smittytone.net/docs/depot_i2c.html).\n\n| App | Description | Platform | Docs |\n| --- | --- | --- | --- |\n| `cli2c` | A command line utility for generic I\u0026sup2;C use | macOS, Linux | [Link](https://smittytone.net/docs/depot_i2c.html#cli2c) |\n| `matrix` | A specific driver for HT16K33-based 8x8 LED matrices | macOS, Linux | [Link](https://smittytone.net/docs/depot_i2c.html#matrix) |\n| `segment` | A specific driver for HT16K33-based 4-digit, 7-segment LEDs | macOS, Linux | [Link](https://smittytone.net/docs/depot_i2c.html#segment) |\n| `cliwire` | A generic 1-Wire command line utility | macOS, Linux | [Link](https://smittytone.net/docs/depot_1wire.html#cliwire) |\n\n## Full Examples\n\nThe [`examples`](examples/) folder contains Python scripts that make use the above apps.\n\n* `cpu_chart_matrix.py` — A rudimentary side-scrolling CPU activity chart. Requires an HT16K33-based 8x8 matrix LED.\n* `cpu_chart_segment.py` — A CPU activity numerical percentage readout. Requires an HT16K33-based 4-digit, 7-segment matrix LED.\n* `mcp9809_temp_cli2c.py` — Second-by-second temperature readout. Requires an MCP98008 temperature sensor breakout.\n* `cpu_chart_ltp305_cli2c.py` — A version of the side-scrolling CPU activity chart. Requires a [Pimoroni LED Matrices + Driver](https://shop.pimoroni.com/products/led-dot-matrix-breakout).\n\nAll the examples run at the command line and take the path to the adaptor device as a required argument and a I\u0026sup2;C address as a second, optional address (if you are not using each device’s standard address). For example:\n\n```shell\npython examples/cpu_chart_ltp305_cli2c.py /dev/cu.usbserial-0101 0x63\n```\n\n## Acknowledgements\n\nThis work was inspired by James Bowman’s ([@jamesbowman](https://github.com/jamesbowman)) [`i2ccl` tool](https://github.com/jamesbowman/i2cdriver), which was written as a macOS/Linux/Windows command line tool to connect to his [I2CMini board](https://i2cdriver.com/mini.html).\n\nMy own I\u0026sup2;C driver code started out based on James’ but involves numerous changes and (I think) improvements. I also removed the Windows code removed and some unneeded functionality that I don’t need (I\u0026sup2;C capture, monitoring). Finally, it targets fresh firmware I wrote from the ground up to run on an RP2040-based board, not the I2CMini.\n\nWhy? Originally I was writing an HT16K33 driver based directly on James’ code, but I accidentally broke the pins off my I2CMini — only to find it is very hard to find new ones. James’ firmware is written in a modern version of Forth, so I can no choice but to learn Forth, or write code of my own. I chose the latter.\n\nThanks are also due to Hermann Stamm-Wilbrandt ([@Hermann-SW](https://github.com/Hermann-SW)) for the basis for the [deploy script](#deploy-the-firmware).\n\nThe 1-Wire driver is based on code I produced for the Twilio Electric Imp IoT platform some years ago.\n\n## Release Notes\n\n- 1.2.2 *23 April 2023*\n    - Support the Pico SDK’s `PICO_BOARD` environment variable to select specific firmware targets.\n    - Support the Arduino Nano RP2040 Connect.\n- 1.2.1 *21 March 2023*\n    - Add LTP305 LED matrix example.\n    - Add example instructions.\n- 1.2.0 *17 March 2023*\n    - Rename project to `Depot`.\n    - Add 1-Wire support to adaptor firmware.\n    - Add 1-Wire centric client apps: `cliwire` for generic use, `ds18b20` to read a single DS18B20 sensor, `sensor` to read a single DS18B20 sensor and display the output in a GUI.\n    - Use CMake’s `CMAKE_BUILD_TYPE` variable to choose build types when building at the command line.\n    - Migrate client app documentation from Read Me to my documentation site.\n    - Remove early debug code outputting to a connected segment display.\n\n*You can find release notes for previous versions [here](https://github.com/smittytone/cli2c)*\n\n## Licences and Copyright\n\nAll client apps are © 2023 Tony Smith (@smittytone) and licensed under the terms of the MIT Licence.\n\nThe RP2040 firmware is © 2023, Tony Smith (@smittytone). It is licensed under the terms of the MIT Licence.\n","project_url":"https://awesome.ecosyste.ms/api/v1/projects/github.com%2Fsmittytone%2Fdepot","html_url":"https://awesome.ecosyste.ms/projects/github.com%2Fsmittytone%2Fdepot","lists_url":"https://awesome.ecosyste.ms/api/v1/projects/github.com%2Fsmittytone%2Fdepot/lists"}