https://github.com/maciekmm/brscanner
Brother DCP-1512E USB scanning CLI
https://github.com/maciekmm/brscanner
brother brother-label-printer reverse-engineering scanner
Last synced: 7 months ago
JSON representation
Brother DCP-1512E USB scanning CLI
- Host: GitHub
- URL: https://github.com/maciekmm/brscanner
- Owner: maciekmm
- Created: 2025-05-11T20:47:02.000Z (11 months ago)
- Default Branch: main
- Last Pushed: 2025-05-12T21:40:54.000Z (11 months ago)
- Last Synced: 2025-08-20T18:16:28.961Z (7 months ago)
- Topics: brother, brother-label-printer, reverse-engineering, scanner
- Language: Go
- Homepage:
- Size: 17.6 KB
- Stars: 0
- Watchers: 1
- Forks: 0
- Open Issues: 0
-
Metadata Files:
- Readme: README.md
Awesome Lists containing this project
README
# brscanner
> [!WARNING]
> This might (probably will) break your scanner, use at your own risk.
`brscanner` is a simplistic CLI to interact with Brother DCP-1512E scanner via USB,
primarily intended for ARM-based systems such as Raspberry Pi as there's no official driver for them.
It may work with other Brother scanners, but it has only been tested with the DCP-1512E.
It currently doesn't support Auto Document Feeder (ADF) as I don't have a scanner with ADF.
All of this was reverse engineered and some of the parts of the protocol are unknown.
## Limitations
- The CLI lacks error handling when the scanner is busy or the scanning is interrupted.
- Interrupting the scanning process is not supported if you do this your scan head will be stuck and the printer needs to be power cycled.
- Only JPEG format is supported as of now
- Only a single scan mode is supported
- ADF is not supported
The above maybe will be worked on, maybe not.
## Building
```bash
go build -o brscanner cmd/brscanner/main.go
```
## Usage
```
Usage of ./brscanner:
-dpi uint
Scan resolution in DPI (default 200)
-height float
Height of the scan area in mm (default 355.567)
-left float
Left margin in mm
-mode string
Scan mode: [CGRAY] (default "CGRAY")
-output string
Output file name for the scanned image - jpeg format
-product string
Product ID of the scanner (default "0x02d0")
-top float
Top margin in mm
-vendor string
Vendor ID of the scanner (default "0x04f9")
-width float
Width of the scan area in mm (default 211.881)
```
## Protocol & Development
Wireshark filter for filtering usb pcaps:
```wireshark
# replace xxxx with proper usb addresses e.g. 1.2
# this omits empty requests that obscure the view
(usb.src matches "^xxxx" or usb.dst matches "^xxxx") and (frame.len != 64 or usb.transfer_type == 0x02)
```
### Protocol
Take a look at [device.go](./device.go).