Add comprehensive HL-L1222-V setup tutorial for Raspberry Pi 4B+ on openSUSE Tumbleweed#26
Conversation
Reviewer's GuideReplaces 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 setupflowchart 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
File-Level Changes
Tips and commandsInteracting with Sourcery
Customizing Your ExperienceAccess your dashboard to:
Getting Help
|
There was a problem hiding this comment.
Hey - I've found 1 issue, and left some high level feedback:
- The tutorial uses
rgin several commands but never installs it; consider either addingripgrepto the zypper install steps or replacingrgwith a tool that is already present (e.g.,grep). - In the minimal command bundle you install
usbutils, but earlier you installusbutilsandsystem-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>Help me be more useful! Please click 👍 or 👎 on each comment and I'll use the feedback to improve your reviews.
|
|
||
| ```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 |
There was a problem hiding this comment.
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.
There was a problem hiding this comment.
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.
| 3. Install `.rpm` packages with `zypper`: | ||
|
|
||
| ```bash | ||
| sudo zypper install -y ./brother-*.rpm 2>&1 | fold -w 1500 |
There was a problem hiding this comment.
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.
| 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 |
| Backup: | ||
|
|
||
| ```bash | ||
| sudo tar -czf cups-backup-$(date +%F).tar.gz /etc/cups 2>&1 | fold -w 1500 |
There was a problem hiding this comment.
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.
| 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 |
There was a problem hiding this comment.
💡 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".
| sudo lpadmin -d HLL1222V 2>&1 | fold -w 1500 | ||
| lp -d HLL1222V /usr/share/cups/data/testprint 2>&1 | fold -w 1500 |
There was a problem hiding this comment.
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 👍 / 👎.
| Enable CUPS sharing: | ||
|
|
||
| ```bash | ||
| sudo cupsctl --share-printers --remote-any --remote-admin 2>&1 | fold -w 1500 |
There was a problem hiding this comment.
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 👍 / 👎.
|
|
||
| ### Printer not detected on USB | ||
| ```bash | ||
| dmesg | tail -n 120 2>&1 | fold -w 1500 |
There was a problem hiding this comment.
🟡 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."
| dmesg | tail -n 120 2>&1 | fold -w 1500 | |
| dmesg 2>&1 | tail -n 120 2>&1 | fold -w 1500 |
Was this helpful? React with 👍 or 👎 to provide feedback.
| - Confirm `usblp` module if needed: | ||
|
|
||
| ```bash | ||
| lsmod 2>&1 | fold -w 1500 | rg -n "usblp" |
There was a problem hiding this comment.
📝 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.
Was this helpful? React with 👍 or 👎 to provide feedback.
| Enable CUPS sharing: | ||
|
|
||
| ```bash | ||
| sudo cupsctl --share-printers --remote-any --remote-admin 2>&1 | fold -w 1500 |
There was a problem hiding this comment.
🚩 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.
Was this helpful? React with 👍 or 👎 to provide feedback.
There was a problem hiding this comment.
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.
|
|
||
| ### 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. |
There was a problem hiding this comment.
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>
| ```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 |
There was a problem hiding this comment.
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>
| 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 |
Motivation
CUPSconfiguration, optional network sharing, troubleshooting, consumables, and backup/restore workflows.Description
README.mdplaceholder content with a structured 12-section tutorial covering prerequisites, system update, and installation ofCUPS,cups-filters,avahi, and diagnostic tools.lpinfoandlpadmin, including guidance for driverless (IPP Everywhere), generic PPD, and Brother RPM driver approaches.lpoptionstuning, manual duplex workflow, consumables notes (TN116,DR116), and a troubleshooting playbook.2>&1 | fold -w 1500and a minimal command bundle is provided for quick deployment.Testing
nl -ba README.md | sed -n '1,420p' 2>&1 | fold -w 1500and inspecting output.git status --short 2>&1 | fold -w 1500to confirm the workspace reflected the change.Codex Task
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:
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.
cups,cups-filters,ghostscript,gutenprint,avahi,nss-mdns, andusbutils.lpinfo/lpadmin, with driver paths forIPP Everywhere, generic PPD, and Brother RPM drivers.lpoptionstuning, manual duplex, and consumables notes (TN116,DR116)./etc/cups, plus a minimal command bundle; all examples use the2>&1 | fold -w 1500wrapper.Written for commit 71d8736. Summary will update on new commits. Review in cubic