Skip to content

Add comprehensive HL-L1222-V setup tutorial for Raspberry Pi 4B+ on openSUSE Tumbleweed#26

Open
ib-bsb-br wants to merge 1 commit into
mainfrom
codex/create-tutorial-for-brother-hl-l1222-v-setup-on-raspberry-pi
Open

Add comprehensive HL-L1222-V setup tutorial for Raspberry Pi 4B+ on openSUSE Tumbleweed#26
ib-bsb-br wants to merge 1 commit into
mainfrom
codex/create-tutorial-for-brother-hl-l1222-v-setup-on-raspberry-pi

Conversation

@ib-bsb-br

@ib-bsb-br ib-bsb-br commented Apr 29, 2026

Copy link
Copy Markdown
Owner

Motivation

  • Replace a placeholder README with a practical, end-to-end tutorial for configuring a Brother HL-L1222-V on a Raspberry Pi 4B+ running openSUSE Tumbleweed.
  • Provide terminal-safe, copy/paste-ready command patterns that respect the project's output-wrapping constraint.
  • Reduce support friction by documenting driver strategies, CUPS configuration, optional network sharing, troubleshooting, consumables, and backup/restore workflows.

Description

  • Replaced README.md placeholder content with a structured 12-section tutorial covering prerequisites, system update, and installation of CUPS, cups-filters, avahi, and diagnostic tools.
  • Added step-by-step USB detection and queue creation instructions using lpinfo and lpadmin, including guidance for driverless (IPP Everywhere), generic PPD, and Brother RPM driver approaches.
  • Included test-printing, printer-sharing (IPP/Avahi), firewall commands, common lpoptions tuning, manual duplex workflow, consumables notes (TN116, DR116), and a troubleshooting playbook.
  • All example shell commands in the document are formatted with the safe wrapper 2>&1 | fold -w 1500 and a minimal command bundle is provided for quick deployment.

Testing

  • Verified the new file content and formatting by printing the file with nl -ba README.md | sed -n '1,420p' 2>&1 | fold -w 1500 and inspecting output.
  • Performed a repository status check with git status --short 2>&1 | fold -w 1500 to confirm the workspace reflected the change.
  • No runtime or integration tests were executed because this is a documentation-only change.

Codex Task


Open in Devin Review

Summary by Sourcery

Replace the placeholder README with a structured, end-to-end tutorial for configuring and operating a Brother HL-L1222-V printer on a Raspberry Pi 4B+ running openSUSE Tumbleweed.

Documentation:

  • Add a detailed, step-by-step setup guide covering prerequisites, package installation, CUPS configuration, USB detection, queue creation, and test printing for the Brother HL-L1222-V on Raspberry Pi 4B+ with openSUSE Tumbleweed.
  • Document optional network printer sharing, firewall configuration, quality and paper tuning, consumables information, troubleshooting workflows, and backup/restore steps for the CUPS configuration.
  • Provide a minimal copy/paste command bundle that follows the repository’s output-wrapping convention for quick printer setup.

Summary by cubic

Adds a complete, copy/paste-ready tutorial to set up a Brother HL-L1222-V on a Raspberry Pi 4B+ running openSUSE Tumbleweed. Replaces the placeholder README and covers local printing and optional network sharing.

  • New Features
    • 12-section guide with prerequisites, system update, and installation/enablement of cups, cups-filters, ghostscript, gutenprint, avahi, nss-mdns, and usbutils.
    • USB detection and queue creation using lpinfo/lpadmin, with driver paths for IPP Everywhere, generic PPD, and Brother RPM drivers.
    • Test printing, printer sharing via IPP/Avahi, firewall rules, common lpoptions tuning, manual duplex, and consumables notes (TN116, DR116).
    • Troubleshooting and backup/restore of /etc/cups, plus a minimal command bundle; all examples use the 2>&1 | fold -w 1500 wrapper.

Written for commit 71d8736. Summary will update on new commits. Review in cubic

@sourcery-ai

sourcery-ai Bot commented Apr 29, 2026

Copy link
Copy Markdown

Reviewer's Guide

Replaces the placeholder README with a detailed, command-focused tutorial for configuring a Brother HL-L1222-V USB laser printer on a Raspberry Pi 4B+ running openSUSE Tumbleweed, including installation, CUPS setup, queue creation, networking, troubleshooting, and backup steps, all using a standardized output-wrapping pattern.

Flow diagram for HL-L1222V driver strategy and setup

flowchart TD
  Start[Start_HL_L1222V_setup]
  DetectUSB[Connect_printer_and_run_lsusb_lpinfo]
  USBSeen{Brother_USB_URI_visible}
  DriverStrategy[Select_driver_strategy]
  TryEverywhere{everywhere_model_available}
  QueueEverywhere[Create_queue_with_lpadmin_and_model_everywhere]
  TryGeneric{Generic_PPD_suitable}
  QueueGeneric[Create_queue_with_lpadmin_and_generic_PPD]
  BrotherRPM[Download_and_install_Brother_RPM_drivers]
  QueueBrother[Create_queue_with_lpadmin_and_Brother_PPD]
  SetDefaults[Set_default_options_lpoptions_lpadmin]
  TestPrint[Print_test_page_via_lp_or_CUPS_UI]
  ShareOptional{Share_printer_over_network}
  EnableSharing[cupsctl_enable_sharing]
  OpenFirewall[Open_firewalld_for_IPP_and_mDNS]
  Done[Setup_complete]
  Troubleshoot[Use_troubleshooting_playbook]

  Start --> DetectUSB
  DetectUSB --> USBSeen
  USBSeen -->|yes| DriverStrategy
  USBSeen -->|no| Troubleshoot
  Troubleshoot --> DetectUSB

  DriverStrategy --> TryEverywhere
  TryEverywhere -->|yes| QueueEverywhere
  TryEverywhere -->|no| TryGeneric

  TryGeneric -->|yes| QueueGeneric
  TryGeneric -->|no| BrotherRPM

  BrotherRPM --> QueueBrother

  QueueEverywhere --> SetDefaults
  QueueGeneric --> SetDefaults
  QueueBrother --> SetDefaults

  SetDefaults --> TestPrint
  TestPrint --> ShareOptional

  ShareOptional -->|yes| EnableSharing
  EnableSharing --> OpenFirewall
  OpenFirewall --> Done

  ShareOptional -->|no| Done
Loading

File-Level Changes

Change Details Files
Replace placeholder README with a full end-to-end printer setup tutorial for HL-L1222-V on Raspberry Pi 4B+ under openSUSE Tumbleweed.
  • Document prerequisites, hardware/software assumptions, and printer characteristics.
  • Add system update and package installation instructions for CUPS, filters, Avahi, diagnostic tools, and related utilities, with all commands wrapped in `2>&1
fold -w 1500.</li><li>Describe USB printer detection and CUPS device enumeration using lsusbandlpinfo.</li><li>Detail multiple driver strategies (IPP Everywhere, generic PPD, Brother RPM drivers) and show how to create and configure queues with lpadminandlpoptions`.
  • Provide procedures for test printing via CUPS web UI and CLI, plus optional network printer sharing with Avahi and firewall configuration.
  • Include sections on print quality and paper tuning, manual duplex workflow, consumables guidance, and a troubleshooting playbook for common issues.
  • Describe backup and restore of CUPS configuration and provide a minimal copy/paste command bundle for quick deployment.

  • Tips and commands

    Interacting with Sourcery

    • Trigger a new review: Comment @sourcery-ai review on the pull request.
    • Continue discussions: Reply directly to Sourcery's review comments.
    • Generate a GitHub issue from a review comment: Ask Sourcery to create an
      issue from a review comment by replying to it. You can also reply to a
      review comment with @sourcery-ai issue to create an issue from it.
    • Generate a pull request title: Write @sourcery-ai anywhere in the pull
      request title to generate a title at any time. You can also comment
      @sourcery-ai title on the pull request to (re-)generate the title at any time.
    • Generate a pull request summary: Write @sourcery-ai summary anywhere in
      the pull request body to generate a PR summary at any time exactly where you
      want it. You can also comment @sourcery-ai summary on the pull request to
      (re-)generate the summary at any time.
    • Generate reviewer's guide: Comment @sourcery-ai guide on the pull
      request to (re-)generate the reviewer's guide at any time.
    • Resolve all Sourcery comments: Comment @sourcery-ai resolve on the
      pull request to resolve all Sourcery comments. Useful if you've already
      addressed all the comments and don't want to see them anymore.
    • Dismiss all Sourcery reviews: Comment @sourcery-ai dismiss on the pull
      request to dismiss all existing Sourcery reviews. Especially useful if you
      want to start fresh with a new review - don't forget to comment
      @sourcery-ai review to trigger a new review!

    Customizing Your Experience

    Access your dashboard to:

    • Enable or disable review features such as the Sourcery-generated pull request
      summary, the reviewer's guide, and others.
    • Change the review language.
    • Add, remove or edit custom review instructions.
    • Adjust other review settings.

    Getting Help

    @sourcery-ai sourcery-ai Bot left a comment

    Copy link
    Copy Markdown

    Choose a reason for hiding this comment

    The reason will be displayed to describe this comment to others. Learn more.

    Hey - I've found 1 issue, and left some high level feedback:

    • The tutorial uses rg in several commands but never installs it; consider either adding ripgrep to the zypper install steps or replacing rg with a tool that is already present (e.g., grep).
    • In the minimal command bundle you install usbutils, but earlier you install usbutils and system-config-printer; for consistency and to avoid confusion, align the package lists or briefly explain why the minimal bundle differs from the full setup.
    Prompt for AI Agents
    Please address the comments from this code review:
    
    ## Overall Comments
    - The tutorial uses `rg` in several commands but never installs it; consider either adding `ripgrep` to the zypper install steps or replacing `rg` with a tool that is already present (e.g., `grep`).
    - In the minimal command bundle you install `usbutils`, but earlier you install `usbutils` and `system-config-printer`; for consistency and to avoid confusion, align the package lists or briefly explain why the minimal bundle differs from the full setup.
    
    ## Individual Comments
    
    ### Comment 1
    <location path="README.md" line_range="145" />
    <code_context>
    +
    +```bash
    +lpinfo -m 2>&1 | fold -w 1500 > /tmp/cups-models-brother.txt
    +rg -n "Brother.*HL|hll1222|l1222" /tmp/cups-models-brother.txt 2>&1 | fold -w 1500
    +```
    +
    </code_context>
    <issue_to_address>
    **suggestion:** Clarify that `lpadmin` in this section should also be run with `sudo` for consistency.
    
    In 4A you already show `sudo lpadmin`. In 4B, update the example to `sudo lpadmin -m ...` as well to match the earlier usage and help users avoid permission errors.
    </issue_to_address>

    Sourcery is free for open source - if you like our reviews please consider sharing them ✨
    Help me be more useful! Please click 👍 or 👎 on each comment and I'll use the feedback to improve your reviews.

    Comment thread README.md

    ```bash
    lpinfo -m 2>&1 | fold -w 1500 > /tmp/cups-models-brother.txt
    rg -n "Brother.*HL|hll1222|l1222" /tmp/cups-models-brother.txt 2>&1 | fold -w 1500

    Copy link
    Copy Markdown

    Choose a reason for hiding this comment

    The reason will be displayed to describe this comment to others. Learn more.

    suggestion: Clarify that lpadmin in this section should also be run with sudo for consistency.

    In 4A you already show sudo lpadmin. In 4B, update the example to sudo lpadmin -m ... as well to match the earlier usage and help users avoid permission errors.

    @gemini-code-assist gemini-code-assist Bot left a comment

    Copy link
    Copy Markdown

    Choose a reason for hiding this comment

    The reason will be displayed to describe this comment to others. Learn more.

    Code Review

    This pull request replaces a placeholder with a comprehensive tutorial for configuring a Brother HL-L1222-V printer on a Raspberry Pi 4B+ running openSUSE Tumbleweed. The guide covers installation, driver selection, network sharing, and troubleshooting. Review feedback suggests narrowing the wildcard in the RPM installation command to prevent accidental package installs and simplifying the backup filename in the copy-paste command to ensure cross-environment compatibility.

    Comment thread README.md
    3. Install `.rpm` packages with `zypper`:

    ```bash
    sudo zypper install -y ./brother-*.rpm 2>&1 | fold -w 1500

    Copy link
    Copy Markdown

    Choose a reason for hiding this comment

    The reason will be displayed to describe this comment to others. Learn more.

    medium

    The use of a wildcard in the package installation command can lead to unexpected behavior if multiple RPM files are present in the directory. It is safer to specify the exact package name or use a more restrictive pattern.

    Suggested change
    sudo zypper install -y ./brother-*.rpm 2>&1 | fold -w 1500
    sudo zypper install -y ./brother-HL-L1222-V-*.rpm 2>&1 | fold -w 1500

    Comment thread README.md
    Backup:

    ```bash
    sudo tar -czf cups-backup-$(date +%F).tar.gz /etc/cups 2>&1 | fold -w 1500

    Copy link
    Copy Markdown

    Choose a reason for hiding this comment

    The reason will be displayed to describe this comment to others. Learn more.

    medium

    Using $(date +%F) in a command that is intended to be copy-pasted can be problematic if the user's shell environment or locale settings differ. It is better to use a static naming convention or instruct the user to define the filename explicitly.

    Suggested change
    sudo tar -czf cups-backup-$(date +%F).tar.gz /etc/cups 2>&1 | fold -w 1500
    sudo tar -czf cups-backup.tar.gz /etc/cups 2>&1 | fold -w 1500

    @chatgpt-codex-connector chatgpt-codex-connector Bot left a comment

    Copy link
    Copy Markdown

    Choose a reason for hiding this comment

    The reason will be displayed to describe this comment to others. Learn more.

    💡 Codex Review

    Here are some automated review suggestions for this pull request.

    Reviewed commit: 71d8736823

    ℹ️ About Codex in GitHub

    Your team has set up Codex to review pull requests in this repo. Reviews are triggered when you

    • Open a pull request for review
    • Mark a draft as ready
    • Comment "@codex review".

    If Codex has suggestions, it will comment; otherwise it will react with 👍.

    Codex can also answer questions or update the PR. Try commenting "@codex address that feedback".

    Comment thread README.md
    Comment on lines +323 to +324
    sudo lpadmin -d HLL1222V 2>&1 | fold -w 1500
    lp -d HLL1222V /usr/share/cups/data/testprint 2>&1 | fold -w 1500

    Copy link
    Copy Markdown

    Choose a reason for hiding this comment

    The reason will be displayed to describe this comment to others. Learn more.

    P1 Badge Create the printer queue before default/test commands

    In the "Minimal command bundle" the only queue-creation command is commented out, but the next lines still run lpadmin -d HLL1222V and lp -d HLL1222V ...; on a fresh system this sequence fails because HLL1222V does not exist yet. Users who copy/paste this advertised quick-start path will hit "unknown destination" errors and cannot complete validation.

    Useful? React with 👍 / 👎.

    Comment thread README.md
    Enable CUPS sharing:

    ```bash
    sudo cupsctl --share-printers --remote-any --remote-admin 2>&1 | fold -w 1500

    Copy link
    Copy Markdown

    Choose a reason for hiding this comment

    The reason will be displayed to describe this comment to others. Learn more.

    P2 Badge Mark the queue as shared in the network-sharing section

    The sharing workflow enables global CUPS sharing flags, but it never sets printer-is-shared=true for HLL1222V; CUPS' own admin guidance requires this per-printer step after cupsctl --share-printers. As written, readers can complete this section yet still have a non-discoverable/non-shared queue from client machines.

    Useful? React with 👍 / 👎.

    @devin-ai-integration devin-ai-integration Bot left a comment

    Copy link
    Copy Markdown

    Choose a reason for hiding this comment

    The reason will be displayed to describe this comment to others. Learn more.

    Devin Review found 4 potential issues.

    Open in Devin Review

    Comment thread README.md

    ### Printer not detected on USB
    ```bash
    dmesg | tail -n 120 2>&1 | fold -w 1500

    Copy link
    Copy Markdown

    Choose a reason for hiding this comment

    The reason will be displayed to describe this comment to others. Learn more.

    🟡 dmesg stderr bypasses fold due to 2>&1 only applying to tail in pipeline

    On line 240, dmesg | tail -n 120 2>&1 | fold -w 1500 does not correctly capture all command output through fold. In bash, 2>&1 only applies to the immediately preceding command (tail), not to dmesg. If dmesg emits an error to stderr (e.g., "dmesg: read kernel buffer failed: Operation not permitted" on modern kernels when run unprivileged), that output goes directly to the terminal unfolded, violating the AGENTS.md constraint (AGENTS.md:121): "All shell command output MUST be piped as: [[command]] 2>&1 | fold -w 1500."

    Suggested change
    dmesg | tail -n 120 2>&1 | fold -w 1500
    dmesg 2>&1 | tail -n 120 2>&1 | fold -w 1500
    Open in Devin Review

    Was this helpful? React with 👍 or 👎 to provide feedback.

    Comment thread README.md
    - Confirm `usblp` module if needed:

    ```bash
    lsmod 2>&1 | fold -w 1500 | rg -n "usblp"

    Copy link
    Copy Markdown

    Choose a reason for hiding this comment

    The reason will be displayed to describe this comment to others. Learn more.

    📝 Info: fold in middle of pipeline is consistent with AGENTS.md template examples

    Line 249 (lsmod 2>&1 | fold -w 1500 | rg -n "usblp") places fold -w 1500 in the middle of the pipeline rather than at the end. This was investigated as a potential violation of the AGENTS.md constraint "All shell command output MUST be piped as: [[command]] 2>&1 | fold -w 1500" (AGENTS.md:121). However, the template's own examples in AGENTS.md:203 (jq . data.json 2>&1 | fold -w 1500 | sed -n '1,200p') and AGENTS.md:232 (rg -n "ERROR|Exception" server.log 2>&1 | fold -w 1500 | head -n 50) show the same pattern — fold in the middle with a filter after it. Since rg only filters (never lengthens) already-folded lines, output remains safe. Not a violation.

    Open in Devin Review

    Was this helpful? React with 👍 or 👎 to provide feedback.

    Comment thread README.md
    Enable CUPS sharing:

    ```bash
    sudo cupsctl --share-printers --remote-any --remote-admin 2>&1 | fold -w 1500

    Copy link
    Copy Markdown

    Choose a reason for hiding this comment

    The reason will be displayed to describe this comment to others. Learn more.

    🚩 cupsctl --remote-any --remote-admin opens admin interface to all IPs

    Line 177 runs sudo cupsctl --share-printers --remote-any --remote-admin, which configures CUPS to accept admin connections from any IP address. This is a significant security exposure if the Pi is reachable from untrusted networks. The tutorial does partially mitigate this by following up with firewall rules (lines 189-191) and advising the user to "Review /etc/cups/cupsd.conf" (line 180). However, --remote-any combined with --remote-admin is a very permissive default — a more secure approach would be to restrict to a specific subnet. This is not flagged as a bug since the tutorial explicitly addresses mitigation, but reviewers may want to add a security warning or use --remote-admin without --remote-any.

    Open in Devin Review

    Was this helpful? React with 👍 or 👎 to provide feedback.

    @cubic-dev-ai cubic-dev-ai Bot left a comment

    Copy link
    Copy Markdown

    Choose a reason for hiding this comment

    The reason will be displayed to describe this comment to others. Learn more.

    2 issues found across 1 file

    Prompt for AI agents (unresolved issues)
    
    Check if these issues are valid — if so, understand the root cause of each and fix them. If appropriate, use sub-agents to investigate and fix each issue separately.
    
    
    <file name="README.md">
    
    <violation number="1" location="README.md:107">
    P2: `ripgrep` (`rg`) is not installed by default or in the prerequisites. Replace with `grep -nE`.</violation>
    
    <violation number="2" location="README.md:133">
    P1: Brother does not provide ARM-compatible Linux drivers for this model.</violation>
    </file>
    

    Reply with feedback, questions, or to request a fix. Tag @cubic-dev-ai to re-run a review.

    Comment thread README.md

    ### B) Brother official driver path (when generic path quality is poor)

    1. Download ARM-compatible Brother Linux driver package for HL-L1222-V (LPR + CUPS wrapper) from Brother support.

    Copy link
    Copy Markdown

    Choose a reason for hiding this comment

    The reason will be displayed to describe this comment to others. Learn more.

    P1: Brother does not provide ARM-compatible Linux drivers for this model.

    Prompt for AI agents
    Check if this issue is valid — if so, understand the root cause and fix it. At README.md, line 133:
    
    <comment>Brother does not provide ARM-compatible Linux drivers for this model.</comment>
    
    <file context>
    @@ -1,3 +1,328 @@
    +
    +### B) Brother official driver path (when generic path quality is poor)
    +
    +1. Download ARM-compatible Brother Linux driver package for HL-L1222-V (LPR + CUPS wrapper) from Brother support.
    +2. Install dependencies if prompted.
    +3. Install `.rpm` packages with `zypper`:
    </file context>
    

    Comment thread README.md
    ```bash
    lpinfo -v 2>&1 | fold -w 1500
    lpinfo -m 2>&1 | fold -w 1500 > /tmp/cups-models.txt
    rg -n "Brother|HL|laser|everywhere|drv:///sample.drv" /tmp/cups-models.txt 2>&1 | fold -w 1500

    Copy link
    Copy Markdown

    Choose a reason for hiding this comment

    The reason will be displayed to describe this comment to others. Learn more.

    P2: ripgrep (rg) is not installed by default or in the prerequisites. Replace with grep -nE.

    Prompt for AI agents
    Check if this issue is valid — if so, understand the root cause and fix it. At README.md, line 107:
    
    <comment>`ripgrep` (`rg`) is not installed by default or in the prerequisites. Replace with `grep -nE`.</comment>
    
    <file context>
    @@ -1,3 +1,328 @@
    +```bash
    +lpinfo -v 2>&1 | fold -w 1500
    +lpinfo -m 2>&1 | fold -w 1500 > /tmp/cups-models.txt
    +rg -n "Brother|HL|laser|everywhere|drv:///sample.drv" /tmp/cups-models.txt 2>&1 | fold -w 1500
    +```
    +
    </file context>
    
    Suggested change
    rg -n "Brother|HL|laser|everywhere|drv:///sample.drv" /tmp/cups-models.txt 2>&1 | fold -w 1500
    grep -nE "Brother|HL|laser|everywhere|drv:///sample.drv" /tmp/cups-models.txt 2>&1 | fold -w 1500

    Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment

    Labels

    Projects

    None yet

    Development

    Successfully merging this pull request may close these issues.

    1 participant