Skip to main content
Archived

This project has been archived by its maintainers, and is no longer receiving any updates.

Stubs for # ALPACA 2.0

© Copyright Delft University of Technology, CC BY 4.0.

ALPACA (Advanced Learning Platform for Analog Circuits and Automation) is a device built on RP2 and MicroPython and equipped with several digital tools to be a guide in introduction to digital systems and electronics for NB2420 Electronic Instrumentation course of TU Delft.

ALPACA splits work across two Picos:

  • Student Pico: the board a student writes code on via Belay. It exposes a tiny RPC client so student programs can ask the Helper to do things. Student Pico is equiiped with a double channel DAC.

  • Helper: a self-contained instrument. It drives an LCD and runs a set of measurement screens (voltmeter, component/resistance tester) that the user can cycles through. It also answers commands sent by the Student over a UART link.

A host-side CLI (alpaca) handles flashing your code onto the boards and opening a serial REPL, so you never have to manage USB ports by hand.

The Student and Helper talk over UART0 with a crossover wiring and a shared ground:

  Student GP00 (TX) ──► Helper GP13 (RX)
  Student GP01 (RX) ◄── Helper GP12 (TX)
  GND ◄──────────────► GND

Repository layout

📁 alpaca folder contains the libraries for Picos. 📁 src/alpaca contains the desktop-side library and the ALPACA CLI for managing the boards (src/alpaca/cli). It is published on PyPI as alpaca2, but the import name and the command stay alpaca, so installed users write from alpaca import list_boards.

alpaca/common is copied alongside alpaca/student or alpaca/helper onto each board at sync time, which is why on-device imports are flat (from command import ..., from link import ...).

Therefore if the folders are like this

📁 alpaca/
  📁 common/
    📄 A.py
  📁 student/
    📄 B.py
  📁 helper/
    📄 C.py

using alpaca sync will copy the files to the root as:

🍓 HelperPico
  📄 A.py
  📄 C.py

🍓 StudentPico
  📄 A.py
  📄 B.py

Setup

uv sync

This installs the project and exposes the alpaca command. Outside a checkout, install the published package instead:

pip install alpaca2   # or: uv tool install alpaca2

Usage

Sync your code onto the boards

uv run alpaca sync

This discovers connected Picos, copies the common + student/helper code onto each, and soft-resets them. To drop into a REPL on one board right after syncing:

uv run alpaca sync --connect student

Open a serial REPL

uv run alpaca connect student   # or: helper

Picking a board

The first time the CLI needs a board it lists the connected Picos in a terminal menu. Hovering an entry lights that board's onboard LED so you can tell which is which, and you can choose to remember the selection — it's cached per role under .alpaca/ so later runs skip the prompt.

Building

The repository workflow should build and publish stubs, and assemble firmware images on creation of a version tag.

git tag v1.0.0
git push origin v1.0.0

The MicroPython version for firmware is set inside the build-firmware.yml (currently 1.28.0).

MicroPython builtins

These stubs cover ALPACA itself. For machine, rp2 and the rest of the MicroPython standard library, install those stubs alongside:

conda install pip
pip install micropython-rp2-stubs

They are not published on any conda channel, so they are not declared as a dependency here. Without them only the MicroPython builtins stay unresolved in your editor; the ALPACA stubs themselves work either way.

Metadata

Release files for alpaca-stubs 1.0.1

For a detailed explanation of source distributions (sdists) and built distributions (wheels), please see the package formats documentation.

Source distribution (sdist)

Source distribution for alpaca-stubs 1.0.1
File Size Uploaded
alpaca_stubs-1.0.1.tar.gz 6.3 kB Details

Built distribution (wheel)

Table of built distributions (wheels) for alpaca-stubs 1.0.1
File Interpreter ABI Platform
alpaca_stubs-1.0.1-py3-none-any.whl Python 3 none any Details

Total release size: 13.6 kB

Release files / alpaca_stubs-1.0.1.tar.gz

Download URL alpaca_stubs-1.0.1.tar.gz
Size 6.3 kB
Tags Source
SHA-256 checksum
How to use checksums
0bf73d00b9676101882dee19a9ac94d4c3a3e0164ec46e09c66b444c4b024de9
BLAKE2b-256 checksum
How to use checksums
4f34dc9ba3ccd083d9d5dc1c666aee55d89e9cda75a9ec3c47b0372bac7a6417
Upload date
Uploaded using Trusted Publishing?
What is trusted publishing?
Yes
Uploaded via uv/0.13.1 {"installer":{"name":"uv","version":"0.13.1","subcommand":["publish"]},"python":null,"implementation":{"name":null,"version":null},"distro":{"name":"Ubuntu","version":"24.04","id":"noble","libc":null},"system":{"name":null,"release":null},"cpu":null,"openssl_version":null,"setuptools_version":null,"rustc_version":null,"ci":true}

Release files / alpaca_stubs-1.0.1-py3-none-any.whl

Download URL alpaca_stubs-1.0.1-py3-none-any.whl
Size 7.3 kB
Tags Python 3
SHA-256 checksum
How to use checksums
557edacbab0833244c683d1c4bf9e727b12e5838dcb81df74af9a8b7b1312f0c
BLAKE2b-256 checksum
How to use checksums
9625434ed1c427b8b3dec08e878cb3b8f8fca9176e656e71cdc4b357777f046a
Upload date
Uploaded using Trusted Publishing?
What is trusted publishing?
Yes
Uploaded via uv/0.13.1 {"installer":{"name":"uv","version":"0.13.1","subcommand":["publish"]},"python":null,"implementation":{"name":null,"version":null},"distro":{"name":"Ubuntu","version":"24.04","id":"noble","libc":null},"system":{"name":null,"release":null},"cpu":null,"openssl_version":null,"setuptools_version":null,"rustc_version":null,"ci":true}
Anthropic, PBC Visionary sponsor Bloomberg Visionary sponsor Hudson River Trading Visionary sponsor Meta Visionary sponsor NVIDIA Visionary sponsor Microsoft Sustainability sponsor Depot Continuous Integration AWS Cloud computing and Security Sponsor Datadog Monitoring Fastly CDN Google Download Analytics Sentry Error logging StatusPage Status page