Skip to content

Commit 3f1fbfa

Browse files
committed
Add scanner docs for the scanner in my office
1 parent 3b75824 commit 3f1fbfa

10 files changed

Lines changed: 817 additions & 1 deletion

File tree

course-logistics/exams/index.md

Lines changed: 7 additions & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -9,5 +9,11 @@ parent: Course Logistics
99

1010
## Quick Links
1111

12-
- [How 2 Scan Good](https://docs.google.com/document/d/1WTF5LQXpsJ7E0EwEVHKZAkXZVcsNrw6XVVBdjRNzHnQ/edit?usp=sharing) (shortlink: [eecs.link/scangood](https://eecs.link/scangood)), a guide to scanning paper exams by Weston Hughes, edits by Lisa Yan, Michael Ball, Peyrin Kao
1312
- [Proctoring Script Template](https://docs.google.com/document/d/1JGrZr7OUUDWw8vi7lcaiYhvBGQLxyy4bF7K4u65giHQ/edit?usp=sharing)
13+
14+
## Printing & Scanning
15+
16+
* [How 2 Scan Good](https://docs.google.com/document/d/1WTF5LQXpsJ7E0EwEVHKZAkXZVcsNrw6XVVBdjRNzHnQ/edit?usp=sharing) (shortlink: [eecs.link/scangood](https://eecs.link/scangood)), a guide to scanning paper exams by Weston Hughes, edits by Lisa Yan, Michael Ball, Peyrin Kao
17+
* [Printing to Soda Copiers via USB](/course-logistics/printing/printing-from-usb)
18+
* [Scanning Station Overview](/course-logistics/scanning)
19+
* [Exam Scanning README](/course-logistics/scanning/exam-scanning) (details on the `scan-exams` command, filename conventions, batch numbering, and semester detection)
219 KB
Loading
425 KB
Loading
186 KB
Loading
72 KB
Loading
Lines changed: 101 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,101 @@
1+
---
2+
title: Printing to Soda Copiers via USB
3+
layout: default
4+
nav_order: 1
5+
parent: Course Logistics
6+
permalink: /course-logistics/printing/printing-from-usb
7+
---
8+
9+
# Printing to Soda Copiers via USB
10+
11+
The copiers in Soda are Canon iR-ADV 8786i. They support USB printing, but you need to install the drivers on your computer first. The drivers are available on Canon's website, and you can download the UFRII_v10.19.21_mac.zip file for macOS.
12+
13+
## Get Drivers from Canon
14+
15+
https://www.usa.canon.com/support/p/imagerunner-advance-dx-8786i?srsltid=AfmBOoqs8k-hEBSw8mmbcC18N7j8l8HqhC0QRlNzt_2ASrGxvh4qxenM
16+
17+
Look for the file: UFRII_v10.19.21_mac.zip
18+
19+
## Adding the printer
20+
* Install the drivers by running the installer package in the zip file
21+
* Open System Preferences > Printers & Scanners
22+
* Click the + button to add a new printer
23+
* Select the Canon iR-ADV 8786/8795 UFR II printer from the list of available printers
24+
* Set a custom name for the printer, such as "Canon_iR_ADV_8786_8795_UFR_II_Front"
25+
* Click Add to add the printer to your system
26+
27+
**Tell macOS there's a stapler**
28+
* Open the Printers & Scanners settings
29+
* Select the Canon iR-ADV 8786/8795 UFR II printer from
30+
* Click on "Options & Supplies"
31+
* Go to the "Options" tab
32+
* Find the row for "Paper Deck Unit" and select "Paper Deck Unit E1"
33+
* Find the row for "Output Options" and select "Staple Finisher W1 Pro"
34+
35+
Click OK to save the settings.
36+
37+
![Printer Options Screenshot](./1-setup-add-stapler.png)
38+
39+
## Printing with the Print UI
40+
* Open the file you want to print
41+
* Press Command + P to open the print dialog
42+
* Select the Canon iR-ADV 8786/8795 UFR II printer from the list of available printers
43+
* Click on the "Show Details" button to access the printer options
44+
* Set the number of copies you want to print
45+
* Ensure double-sided printing is enabled
46+
* Click on "Printer Options" to access additional settings
47+
* Click on the "Finishing" (the "i" icon on the right) tab and enable "Staple" if you want to staple the copies together
48+
* Click on "Finishing Details…" to enable Copy Set Numbering if you want to add copy numbers on the bottom corner of each page.
49+
50+
#### Images
51+
52+
![Print Dialog Screenshot](./2-print-dialog.png)
53+
![Finishing Options Screenshot](./3-finishing-options.png)
54+
![Finishing Details Screenshot](./4-finishing-details.png)
55+
56+
## Check stapling options
57+
58+
```sh
59+
lpoptions -p Canon_iR_ADV_8786_8795_UFR_II -l | grep Staple
60+
```
61+
62+
CNStaple/Staple: False *True Stapleless
63+
StapleLocation/Position: *TopLeft BottomLeft Left TopRight BottomRight Right Top Bottom
64+
Paper Source = Cas2
65+
66+
# Set default to staple
67+
68+
```sh
69+
lpoptions -p Canon_iR_ADV_8786_8795_UFR_II -o CNStaple=True
70+
```
71+
72+
# Print One file
73+
74+
```sh
75+
lpr -P Canon_iR_ADV_8786_8795_UFR_II -o Staple=True "Final_Exam_A__printouts_253_to_288_Part2.pdf"
76+
```
77+
78+
## Printing multiple copies of a file
79+
80+
```
81+
lpr -P Canon_iR_ADV_8786_8795_UFR_II -o Staple=True -o NumCopies=3 "Final_Exam_A__printouts_253_to_288_Part2.pdf"
82+
```
83+
84+
### Adding Copyset Numbering to the Output
85+
86+
**TODO**
87+
```sh
88+
lpr -P Canon_iR_ADV_8786_8795_UFR_II .... "file.pdf"
89+
```
90+
91+
## Schedule a batch
92+
on macOS this immediately sends the file to queue, which you can view by opening the printer app.
93+
94+
```sh
95+
PRINTER='Canon_iR_ADV_8786_8795_UFR_II_Front'
96+
for pdffile in $(ls *.pdf | sort -V); do
97+
lpr -P $PRINTER -o InputSlot=Cas2 -o CNStaple=True "$pdffile";
98+
mv $pdffile printed/;
99+
echo $pdffile;
100+
done
101+
```
Lines changed: 90 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,90 @@
1+
---
2+
title: Exam Scanning
3+
layout: default
4+
nav_order: 1
5+
parent: Scanning Station Overview
6+
permalink: /course-logistics/scanning/exam-scanning
7+
---
8+
9+
# Exam Scanning
10+
11+
The `scan-exams` command is a batch scanning tool for the CDSS [scanning station](scanning). It scans exams from the Canon DR-G2110 ADF and produces compressed, timestamped PDFs.
12+
13+
For general scanning station info, see the [Scanning Station Overview](scanning).
14+
15+
## Usage
16+
17+
```
18+
scan-exams # interactive prompts
19+
scan-exams -o # scan and open PDF when done
20+
scan-exams -r -o # reuse last course/exam, open when done
21+
scan-exams -q # no prompts, just scan and save
22+
scan-exams -h # show help
23+
```
24+
25+
## Options
26+
27+
| Flag | Description |
28+
|------|-------------|
29+
| `-o` | Open the PDF automatically after scanning |
30+
| `-r` | Reuse course/exam metadata from the last scan |
31+
| `-q` | Quiet mode — no prompts, auto batch number and timestamp |
32+
| `-h` | Show help |
33+
34+
## Output filename
35+
36+
```
37+
20260429-143022-SP26-cs169-mt1-batch-01-240pg.pdf
38+
│ │ │ │ │ └─ page count
39+
│ │ │ │ └─ auto-incrementing batch number
40+
│ │ │ └─ exam type (mt, mt1, mt2, final, quiz)
41+
│ │ └─ course number
42+
│ └─ semester (SP/SU/FA + 2-digit year)
43+
└─ timestamp (YYYYMMDD-HHMMSS)
44+
```
45+
46+
## Semester detection
47+
48+
Automatically determined from the current date:
49+
50+
| Months | Semester |
51+
|--------|----------|
52+
| January–May | SP (Spring) |
53+
| June–August | SU (Summer) |
54+
| September–December | FA (Fall) |
55+
56+
## Batch numbering
57+
58+
The batch number auto-increments based on existing files in `~/scans/` matching the same course and exam type. Scanning `cs169-mt1` when `batch-01` and `batch-02` already exist produces `batch-03`.
59+
60+
## Reusing metadata (`-r`)
61+
62+
After each scan, the course, exam type, expected copies, pages per exam, and rotation setting are saved to `~/.scan-exams-last`. Use `-r` to reuse these values for the next scan without re-entering them — useful when scanning the same exam in multiple batches.
63+
64+
## Scan settings
65+
66+
| Setting | Value |
67+
|---------|-------|
68+
| Mode | Duplex (double-sided) |
69+
| Color | Grayscale |
70+
| Resolution | 200 DPI |
71+
| Paper size | Letter (8.5" × 11") |
72+
| Compression | JPEG quality 85 |
73+
| Output | Single PDF per batch |
74+
75+
## Files
76+
77+
| File | Purpose |
78+
|------|---------|
79+
| `setup.sh` | Install Canon SANE driver, NAPS2, AirSane, and `scan-exams` command |
80+
| `setup_apps.sh` | Install general dev tools (VS Code, Docker, mise, PostgreSQL, etc.) |
81+
| `scan-exams.sh` | The `scan-exams` bash function |
82+
83+
Source: [berkeley-cdss/docs/scanning-scripts](https://github.com/berkeley-cdss/docs/tree/main/scanning-scripts)
84+
85+
## Data handling
86+
87+
**Scanned files may contain sensitive data (exams, student work, etc.).**
88+
89+
- Copy your PDFs to your own device after scanning.
90+
- **Delete your files from `~/scans/` when you're done.**

course-logistics/scanning/index.md

Lines changed: 164 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,164 @@
1+
---
2+
title: Scanning Station Overview
3+
layout: default
4+
nav_order: 3
5+
parent: Course Logistics
6+
---
7+
8+
# Scanning Station Overview
9+
10+
The CDSS document scanning station is a 2018 Mac Mini running Ubuntu 24.04 LTS, connected to a Canon imageFORMULA DR-G2110 production scanner via USB 3.0. Macs on the same network can also scan directly via AirSane.
11+
12+
## Location & Access
13+
14+
The scanning station is located in **TODO: room/building**. (Currently Michae's office, but will move to a more normal location once the Gateway finally opens.)
15+
16+
- **Username:** `oski`
17+
- **Password:** Posted near the computer
18+
19+
This is a shared local account. Do not store sensitive files on this machine — save scans to your own device, or upload to Gradescope, and clean up `~/scans` when you're done.
20+
21+
## Using the Scanner
22+
23+
**[Jump to the Exam Scanning README](/course-logistics/scanning/exam-scanning) for detailed instructions on using the `scan-exams` command, filename conventions, batch numbering, and semester detection.**
24+
25+
### `scan-exams` (recommended for exams)
26+
27+
Open a terminal and type:
28+
29+
```
30+
scan-exams
31+
```
32+
33+
This walks you through scanning a batch of exams: course number, exam type, expected copies, and pages per exam. It scans duplex at 200 DPI grayscale, compresses the output, and saves a single PDF to `~/scans/`.
34+
35+
Common options:
36+
37+
| Flag | Description |
38+
|------|-------------|
39+
| `-o` | Open the PDF automatically after scanning |
40+
| `-r` | Reuse course/exam metadata from the last scan |
41+
| `-q` | Quiet mode — no prompts, just scan and save |
42+
| `-h` | Show help |
43+
44+
Examples:
45+
46+
```
47+
scan-exams -o # scan and open the PDF when done
48+
scan-exams -r -o # another batch of the same exam
49+
scan-exams -h # full usage info
50+
```
51+
52+
For details on filenames, batch numbering, and semester detection, see the [Exam Scanning README](exam-scanning).
53+
54+
### NAPS2 (GUI scanning)
55+
56+
NAPS2 is a graphical scanning app linked on the desktop. You can also launch it from a terminal:
57+
58+
```
59+
naps2
60+
```
61+
62+
Select **SANE Driver**, choose the Canon DR-G2110, and save directly to PDF.
63+
64+
### `scanimage` (advanced CLI)
65+
66+
For more control over scan settings:
67+
68+
```
69+
scanimage -L # list scanners
70+
scanimage -A # show all scanner options
71+
scanimage --format=tiff --resolution 200 --mode Gray --source="Duplex" --batch=scan_%04d.tiff
72+
img2pdf scan_*.tiff -o output.pdf
73+
```
74+
75+
### Network scanning from a Mac
76+
77+
The scanner is published on the local network via AirSane. On any Mac on the same network:
78+
(This is currently the internal EECS network, and may not be accessible from campus Wi-Fi.)
79+
80+
1. Open **Image Capture** (or **Preview → File → Import from Scanner**)
81+
2. The Canon DR-G2110 should appear in the sidebar
82+
3. Select scan settings and scan — files go directly to your Mac
83+
84+
AirSane also provides a web interface at `http://TODO-HOSTNAME:8090/`.
85+
86+
### After scanning
87+
88+
**Scanned files may contain sensitive data (exams, student work, etc.).**
89+
90+
- Copy your PDFs from `~/scans/` to your own device.
91+
- **Delete your files from `~/scans/` when you're done.** This is a shared machine.
92+
- The workstation does not share files over the network — only the scanner device is exposed via AirSane.
93+
94+
## Equipment
95+
96+
- **Scanner:** Canon imageFORMULA DR-G2110 (USB 3.0)
97+
- **Computer:** 2018 Mac Mini, Intel, 64 GB RAM, Ubuntu 24.04 LTS
98+
- **Network scanning:** AirSane (eSCL/AirScan protocol, auto-discovered by macOS)
99+
100+
## Setup & Maintenance
101+
102+
The setup scripts and scanning tools are maintained in the [berkeley-cdss/docs](https://github.com/berkeley-cdss/docs) repository:
103+
104+
- [scanning-scripts/](https://github.com/berkeley-cdss/docs/tree/main/course-logistics/scanning/) — setup scripts, scan-exams tool, and documentation
105+
106+
To re-run the workstation setup from scratch:
107+
108+
```
109+
git clone https://github.com/berkeley-cdss/docs.git
110+
cd docs/course-logistics/scanning
111+
bash setup.sh # scanner driver, NAPS2, AirSane, scan-exams command
112+
bash setup_apps.sh # general dev tools and apps
113+
```
114+
115+
Setup installs scripts and docs to `~/scanner/` and adds `scan-exams` to `~/.bashrc`.
116+
117+
### Installed files
118+
119+
| Location | Contents |
120+
|----------|----------|
121+
| `~/scanner/scan-exams.sh` | The `scan-exams` function (sourced by `.bashrc`) |
122+
| `~/scanner/README.md` | This documentation |
123+
| `~/scans/` | Default scan output directory |
124+
| `~/.scan-exams-last` | Saved metadata for `scan-exams -r` |
125+
126+
## Troubleshooting
127+
128+
### Scanner not detected
129+
130+
```
131+
lsusb | grep -i canon # check USB connection
132+
scanimage -L # check SANE detection
133+
dpkg -l | grep canon # check driver installation
134+
```
135+
136+
### Scan source options
137+
138+
The scanner uses `--source="Duplex"` for double-sided and `--source="Simplex"` for single-sided. Check available options:
139+
140+
```
141+
scanimage -A | grep -i source
142+
```
143+
144+
### Scanning pauses or is slow
145+
146+
- Confirm USB 3.0 connection (not USB 2.0)
147+
- Check disk write speed — scan output should go to an SSD/NVMe
148+
- Lower resolution (200 DPI is usually sufficient for exams)
149+
- Use grayscale instead of color
150+
151+
### AirSane not visible on Mac
152+
153+
- Ensure both machines are on the same network/subnet
154+
- Check AirSane is running: `sudo systemctl status airsaned`
155+
- Check Avahi is running: `sudo systemctl status avahi-daemon`
156+
- Try the web interface: `http://TODO-HOSTNAME.local:8090/`
157+
158+
### Managing services
159+
160+
```
161+
sudo systemctl status airsaned # AirSane status
162+
sudo systemctl restart airsaned # restart AirSane
163+
sudo journalctl -u airsaned -f # AirSane logs
164+
```

0 commit comments

Comments
 (0)