Skip to main content

CLI for Badgerd SDWire Devices

Application also supports legacy SDWireC and non-Badger'd sdwires as well as new Badgerd SDwire Gen2 devices.

Please see below for usage:

❯ sdwire --help
Usage: sdwire [OPTIONS] COMMAND [ARGS]...

Options:
--help  Show this message and exit.

Commands:
list
switch  dut/target => connects the sdcard interface to target device

❯ sdwire switch --help
Usage: sdwire switch [OPTIONS] COMMAND [ARGS]...

  dut/target => connects the sdcard interface to target device

  ts/host => connects the sdcard interface to host machine

  off => disconnects the sdcard interface from both host and target

Options:
  -s, --serial TEXT  Serial number of the sdwire device, if there is only one
                     sdwire connected then it will be used by default
  --help             Show this message and exit.

Commands:
  dut     dut/target => connects the sdcard interface to target device
  host    ts/host => connects the sdcard interface to host machine
  off     off => disconnects the sdcard interface from both host and target
  target  dut/target => connects the sdcard interface to target device
  ts      ts/host => connects the sdcard interface to host machine

Installing

Using pip

pip install sdwire

Using apt

sudo add-apt-repository ppa:tchavadar/badgerd
sudo apt install python3-sdwire

Listing SDWire Devices

sdwire list command will search through usb devices connected to the system and prints out the list of gen2 and legacy devices.

❯ sdwire list
Serial			Product Info
sdwire_gen2_101		[SDWire-Gen2::Badgerd Technologies]
bdgrd_sdwirec_522	[sd-wire::SRPOL]

Switching SD Card Connection

sdwire switch command switches the sd card connection to specified direction. If there is more than one sdwire connected to then you need specify which sdwire you want to alter with --serial or -s options.

If there is only one sdwire connected then you dont need to specify the serial, it will pick the one connected automatically. See the examples below.

❯ sdwire list
Serial			Product Info
sdwire_gen2_101		[SDWire-Gen2::Badgerd Technologies]
bdgrd_sdwirec_522	[sd-wire::SRPOL]

❯ sdwire switch -s bdgrd_sdwirec_522 target

❯ sdwire switch target
Usage: sdwire switch [OPTIONS] COMMAND [ARGS]...
Try 'sdwire switch --help' for help.

Error: There is more then 1 sdwire device connected, please use --serial|-s to specify!

❯ sdwire list
Serial			Product Info
bdgrd_sdwirec_522	[sd-wire::SRPOL]

❯ sdwire switch host

SDWire3 and Linux USB power management

On Linux, the SDWire3 only hands the SD card to the target while the USB device is runtime-suspended. sdwire switch target enables this automatically (power/autosuspend_delay_ms=0, power/control=auto) and verifies that power/runtime_status becomes suspended; otherwise it exits with an error. Writing to sysfs requires root, or install udev/90-sdwire.rules, which applies the setting when the device is plugged in.

To do it by hand (replace 2-8 with your device's sysfs name, e.g. 5-1):

echo 0    | sudo tee /sys/bus/usb/devices/2-8/power/autosuspend_delay_ms
echo auto | sudo tee /sys/bus/usb/devices/2-8/power/control

Metadata

Release files for sdwire 0.4.0

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

Source distribution (sdist)

Source distribution for sdwire 0.4.0
File Size Uploaded Provenance Actions
sdwire-0.4.0.tar.gz 27.1 kB With provenance Details for sdwire-0.4.0.tar.gz

Built distribution (wheel)

Table of built distributions (wheels) for sdwire 0.4.0
File Interpreter ABI Platform Actions
sdwire-0.4.0-py3-none-any.whl Python 3 none any Details for sdwire-0.4.0-py3-none-any.whl

Total release size: 57.4 kB

Release files / sdwire-0.4.0.tar.gz

Download URL sdwire-0.4.0.tar.gz
Size 27.1 kB
Tags Source
SHA-256 checksum
How to use checksums
440a672e4339710cef2d621a22e71d6e4bc75af21cff80541a650b753758c812
BLAKE2b-256 checksum
How to use checksums
42fbe2d71f6bfe5e553b242adfcb8acd400e88a0c0490486bb61f247fb26f9f7
Upload date
Uploaded using Trusted Publishing?
What is trusted publishing?
Yes
Uploaded via twine/7.0.0 CPython/3.13.16

Provenance

Provenance describes where a file came from. On PyPI, provenance is shared via attestations, which provide a verifiable record of the build or publishing details. View details, limitations and caveats.

PyPI Publish Attestation

PyPI verified that this artifact, at this checksum, originated from the publisher listed below.

Signed by GitHub Actions, verified by PyPI on Oct 28, 2026.

Transparency log

Release files / sdwire-0.4.0-py3-none-any.whl

Download URL sdwire-0.4.0-py3-none-any.whl
Size 30.4 kB
Tags Python 3
SHA-256 checksum
How to use checksums
341cacf87cad5299657998164792932106e2d47066b2f5ef4f5f91877f17ff67
BLAKE2b-256 checksum
How to use checksums
698002b46782b1fdf9716ee3d13dc5f2042ed0cdb0b918ed22fc911520305ffd
Upload date
Uploaded using Trusted Publishing?
What is trusted publishing?
Yes
Uploaded via twine/7.0.0 CPython/3.13.16

Provenance

Provenance describes where a file came from. On PyPI, provenance is shared via attestations, which provide a verifiable record of the build or publishing details. View details, limitations and caveats.

PyPI Publish Attestation

PyPI verified that this artifact, at this checksum, originated from the publisher listed below.

Signed by GitHub Actions, verified by PyPI on Oct 28, 2026.

Transparency log

Security for sdwire 0.4.0

Provenance

Provenance describes where a file came from. On PyPI, provenance is shared via attestations, which provide a verifiable record of the build or publishing details. View details, limitations and caveats.

Full provenance

Both files in this release have been uploaded with provenance metadata.

Select from 2 files

Attestation for sdwire-0.4.0.tar.gz

PyPI Publish Attestation

PyPI verified that this artifact, at this checksum, originated from the publisher listed below.

Signed by GitHub Actions, verified by PyPI on Oct 28, 2026.

Transparency log

A note on package security

PyPI is a repository for distributing packages, not a service for auditing them. While third-party security researchers and our staff do their best to detect and remove malicious packages, PyPI cannot guarantee the quality, security or suitability of any given package.

To learn more about protecting yourself from malicious actors, visit our package security documentation.

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