From f1f8118cce186dc20074cc5b08122259e53520cd Mon Sep 17 00:00:00 2001 From: =?UTF-8?q?=EC=8B=9C=EA=B3=A8=EC=95=BD=EC=82=AC?= Date: Sat, 4 Oct 2025 14:35:22 +0000 Subject: [PATCH] Add AirPrint setup script and README MIME-Version: 1.0 Content-Type: text/plain; charset=UTF-8 Content-Transfer-Encoding: 8bit - Add automated installation script for Brother HL-L2335D with AirPrint - Include README with quick install commands and usage guide - Support curl/wget one-liner installation πŸ€– Generated with [Claude Code](https://claude.com/claude-code) Co-Authored-By: Claude --- README.md | 49 +++++++++++++++++++++++++++++++++ πŸ“„ rpi-brother-airprint.sh | 55 ++++++++++++++++++++++++++++++++++++++ 2 files changed, 104 insertions(+) create mode 100644 README.md create mode 100644 πŸ“„ rpi-brother-airprint.sh diff --git a/README.md b/README.md new file mode 100644 index 0000000..b5e33f2 --- /dev/null +++ b/README.md @@ -0,0 +1,49 @@ +# Raspberry Pi CUPS λΈŒλΌλ” ν”„λ¦°ν„° μ„€μ • + +λΌμ¦ˆλ² λ¦¬νŒŒμ΄μ—μ„œ Brother HL-L2335D ν”„λ¦°ν„°λ₯Ό AirPrint둜 μ‚¬μš©ν•˜κΈ° μœ„ν•œ μžλ™ μ„€μ • μŠ€ν¬λ¦½νŠΈμž…λ‹ˆλ‹€. + +## πŸš€ λΉ λ₯Έ μ„€μΉ˜ + +```bash +curl -fsSL https://raw.githubusercontent.com/YOUR_USERNAME/YOUR_REPO/main/πŸ“„%20rpi-brother-airprint.sh | bash +``` + +λ˜λŠ” + +```bash +wget -qO- https://raw.githubusercontent.com/YOUR_USERNAME/YOUR_REPO/main/πŸ“„%20rpi-brother-airprint.sh | bash +``` + +μˆ˜λ™ λ‹€μš΄λ‘œλ“œ ν›„ μ‹€ν–‰: + +```bash +wget https://raw.githubusercontent.com/YOUR_USERNAME/YOUR_REPO/main/πŸ“„%20rpi-brother-airprint.sh -O rpi-brother-airprint.sh +chmod +x rpi-brother-airprint.sh +./rpi-brother-airprint.sh +``` + +## βœ… 이 μŠ€ν¬λ¦½νŠΈκ°€ ν•΄μ£ΌλŠ” 일 + +1. **CUPS + Avahi-daemon μ„€μΉ˜** (AirPrint 지원) +2. **printer-driver-brlaser μ„€μΉ˜** (HL-L2335D 지원) +3. **ipp-usb 쀑지** (좩돌 λ°©μ§€) +4. **HL-L2335D ν”„λ¦°ν„°λ₯Ό brlaser PPD둜 μžλ™ 등둝** +5. **AirPrint 곡유 ν™œμ„±ν™”** +6. **ν…ŒμŠ€νŠΈ νŽ˜μ΄μ§€ μžλ™ 좜λ ₯** + +## πŸ“± μ‚¬μš© 방법 + +### iPhone/iPad +- μ„€μ • β†’ AirPrint ν”„λ¦°ν„° λͺ©λ‘μ—μ„œ `HLL2335D` 검색 + +### Windows +- λ„€νŠΈμ›Œν¬ ν”„λ¦°ν„° μΆ”κ°€ β†’ `ipp://raspberrypi.local/printers/HLL2335D` + +### 관리 νŽ˜μ΄μ§€ +- http://라즈베리파이IP:631 + +## πŸ“ 참고사항 + +- Brother HL-L2335Dλ₯Ό USB둜 μ—°κ²°ν•œ μƒνƒœμ—μ„œ μ‹€ν–‰ν•˜μ„Έμš” +- μŠ€ν¬λ¦½νŠΈλŠ” μžλ™μœΌλ‘œ μ‹œμŠ€ν…œ μ—…λ°μ΄νŠΈ ν›„ ν•„μš”ν•œ νŒ¨ν‚€μ§€λ₯Ό μ„€μΉ˜ν•©λ‹ˆλ‹€ +- μ™„λ£Œ ν›„ μžλ™μœΌλ‘œ ν…ŒμŠ€νŠΈ νŽ˜μ΄μ§€κ°€ 좜λ ₯λ©λ‹ˆλ‹€ diff --git a/πŸ“„ rpi-brother-airprint.sh b/πŸ“„ rpi-brother-airprint.sh new file mode 100644 index 0000000..11c16ed --- /dev/null +++ b/πŸ“„ rpi-brother-airprint.sh @@ -0,0 +1,55 @@ +#!/bin/bash +set -e + +echo "=== Raspberry Pi AirPrint + Brother HL-L2335D Setup ===" + +### 0. κΈ°λ³Έ μ—…λ°μ΄νŠΈ +sudo apt-get update -y +sudo apt-get upgrade -y + +### 1. CUPS + AirPrint κ΄€λ ¨ νŒ¨ν‚€μ§€ μ„€μΉ˜ +sudo apt-get install -y \ + cups cups-client cups-filters \ + avahi-daemon avahi-discover avahi-utils \ + printer-driver-brlaser printer-driver-gutenprint \ + system-config-printer + +# ipp-usb 좩돌 λ°©μ§€ (USB ν”„λ¦°ν„° 직접 μž‘λ„λ‘) +sudo systemctl stop ipp-usb || true +sudo systemctl disable ipp-usb || true + +### 2. CUPS κΆŒν•œ 및 λ°©ν™”λ²½ +sudo usermod -aG lpadmin $USER +sudo cupsctl --remote-admin --remote-any --share-printers + +### 3. Brother HL-L2335D 큐 등둝 +PRINTER_NAME="HLL2335D" +PRINTER_URI="usb://Brother/HL-L2335D%20series?serial=$(lsusb -d 04f9: | awk '{print $6}' || echo AUTO)" + +# κΈ°μ‘΄ 큐 제거 +sudo lpadmin -x $PRINTER_NAME 2>/dev/null || true + +# brlaser λ“œλΌμ΄λ²„λ₯Ό μ΄μš©ν•œ 큐 생성 +sudo lpadmin -p $PRINTER_NAME -E \ + -v "$PRINTER_URI" \ + -m drv:///brlaser.drv/brl2335d.ppd \ + -D "Brother HL-L2335D (brlaser)" + +# 큐 곡유/ν™œμ„±ν™” +sudo lpadmin -p $PRINTER_NAME -o printer-is-shared=true +sudo cupsaccept $PRINTER_NAME +sudo cupsenable $PRINTER_NAME +sudo lpadmin -d $PRINTER_NAME + +### 4. Avahi AirPrint μ„œλΉ„μŠ€ 확인 +if ! systemctl is-active --quiet avahi-daemon; then + sudo systemctl enable avahi-daemon --now +fi + +### 5. ν…ŒμŠ€νŠΈ νŽ˜μ΄μ§€ 좜λ ₯ +echo "Hello from Raspberry Pi + Brother HL-L2335D (brlaser)" | lp -d $PRINTER_NAME + +echo "=== μ™„λ£Œ! ===" +echo "➑ iPhone/iPad: AirPrint ν”„λ¦°ν„° λͺ©λ‘μ—μ„œ '${PRINTER_NAME}' 확인" +echo "➑ Windows: λ„€νŠΈμ›Œν¬ ν”„λ¦°ν„° μΆ”κ°€ β†’ ipp://raspberrypi.local/printers/${PRINTER_NAME}" +echo "➑ 관리 νŽ˜μ΄μ§€: http://$(hostname -I | awk '{print $1}'):631"