An open API service indexing awesome lists of open source software.

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

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).