pinout
Display pinout information for boards
TLDR
View the pinout information and GPIO header diagram for the current Raspberry Pi
Open
SYNOPSIS
pinout [OPTIONS] [DEVICE_OR_BOARD]
Common Usage:
pinout
pinout
pinout --list
pinout --help
PARAMETERS
DEVICE_OR_BOARD
The name of the specific board or device for which to display the pinout. If omitted, and no --board or --device is specified, it may default to a common board or prompt for selection.
--help, -h
Displays a help message detailing command usage and available options.
--version, -v
Shows the program's current version number.
--list, -l
Lists all available boards and devices that pinout can recognize and display.
--board <BOARD_NAME>
Explicitly specifies the board name for which to show the pinout. Useful when a board name might conflict with a device name or for clarity.
--device <DEVICE_NAME>
Explicitly specifies the device name for which to show the pinout.
--json
Outputs the pinout data in JSON format, suitable for programmatic parsing.
--svg
Generates the pinout diagram as an SVG (Scalable Vector Graphics) file. Requires the 'svglib' library.
--png
Generates the pinout diagram as a PNG (Portable Network Graphics) image. This usually requires the 'librsvg' library and 'cairo' or similar rendering backend to be installed on the system.
--style <STYLE_NAME>
Applies a specific visual style to the generated diagram. Available styles may vary depending on the installation.
--config <FILE>
Specifies an alternative configuration file to use instead of the default.
--verbose, -V
Enables verbose output, showing more detailed information about the command's execution and any encountered issues.
--search <TERM>
Searches for boards or devices matching the provided term in their name or description.
DESCRIPTION
The pinout command-line tool provides a convenient way to display pinout diagrams for various embedded boards and devices directly in your terminal. It leverages a comprehensive database of hardware, including popular Single Board Computers (SBCs) like Raspberry Pi, BeagleBone, and various microcontrollers. Users can query specific boards or devices to retrieve their pin configurations, including signal names, functions, and physical locations. Beyond interactive terminal display (often using ASCII art), pinout supports exporting diagrams into machine-readable formats like JSON, or graphical formats such as SVG and PNG, making it invaluable for documentation and integration into other tools. This utility streamlines the process of referencing complex hardware interfaces, aiding developers, students, and hobbyists in rapid prototyping and troubleshooting tasks without needing to consult external datasheets or websites.
CAVEATS
The pinout command is typically a Python-based utility and is not a core Linux command, meaning it usually needs to be installed separately (e.g., via pip).
PNG output functionality often depends on external system libraries like librsvg and potentially cairo for rendering, which may need to be installed manually.
The accuracy and completeness of pinout diagrams depend on the underlying database of boards and devices, which is maintained by the community and can vary over time. Terminal display quality can be affected by terminal font, encoding, and window width.
OUTPUT FORMATS
pinout is versatile in its output. By default, it renders an ASCII art diagram directly in the terminal. However, it can also generate JSON for structured data access, or high-quality graphical outputs like SVG (Scalable Vector Graphics) and PNG (Portable Network Graphics) for integration into documents or web pages. This flexibility allows users to choose the most suitable format for their specific needs, from quick lookups to detailed documentation.
EXTENSIBILITY AND CONFIGURATION
A key strength of pinout is its extensibility. It allows users to manage and expand its database of boards and devices, making it adaptable to new hardware. Users can also define custom styles to change the visual presentation of diagrams. Configuration files allow for persistent settings, including default boards, output formats, and stylistic preferences, enhancing user experience and productivity.
HISTORY
The pinout utility emerged from the embedded systems and open-source hardware communities, notably championed by initiatives like Adafruit. Developed primarily in Python, it addresses the common challenge of quickly referencing pin assignments on various Single Board Computers (SBCs) and microcontrollers without constantly consulting extensive documentation. Its development reflects the growing popularity of DIY electronics and embedded Linux, providing an accessible command-line interface for what was previously a manual, often tedious, lookup process. It aims to standardize and simplify access to essential hardware interface information for developers and hobbyists alike.