stapelberg / airscan Goto Github PK
View Code? Open in Web Editor NEWGo package to scan paper documents π from a scanner π¨οΈ via the network πΈοΈ using the Apple AirScan (eSCL) protocol.
License: Apache License 2.0
Go package to scan paper documents π from a scanner π¨οΈ via the network πΈοΈ using the Apple AirScan (eSCL) protocol.
License: Apache License 2.0
Some printers are using an ADF in simplex mode, because they don't support duplex mode.
Setting the wrong option for duplex
(or in the case of the CLI, having it set to true
as a default) can cause some issues.
For example, in my "Canon MF642C/643C/644C" device (ADF, Simplex), starting a scan with duplex mode causes the scanner to crash, and the only way to get out of this mode is to... reboot the printer.
$ airscan1 -debug=true -host=Canon00000 -source=adf -duplex=true
# Truncated
2023/03/10 01:05:49 device "Canon MF642C/643C/644C" found in 150.795627ms
2023/03/10 01:05:53 http://Canon00000/eSCL/ScanJobs: unexpected HTTP status: got 500 Internal Server Error (), want 201
After this, the printer gets stuck in this view:
After "Cancel" is pressed, the printer remains stuck in this view:
The only way to get rid of that screen is to power off the device entirely (unplug it from the socket) and boot it again.
Make: Canon
Model: MF642C/643C/644C
Main Controller: 05.18
Boot ROM: 01.01
DCON: 02.01
Language: 01.13
(I have no clue on why the language has a version on its own)
Check for the scanner capabilities before assuming it can perform a duplex scan :D
P.S: I hate printers.
me@host:~$ '/home/me/Downloads/go/bin/go' get github.com/stapelberg/airscan/cmd/airscan1
me@host:~$ '/home/me/Downloads/go/bin/go' install github.com/stapelberg/airscan/cmd/airscan1
me@host:~$ ./go/bin/airscan1
2020/08/16 14:35:07 finding device for 5s (use -timeout=0 for unlimited)
panic: runtime error: invalid memory address or nil pointer dereference
[signal SIGSEGV: segmentation violation code=0x1 addr=0x50 pc=0x7111fa]
goroutine 1 [running]:
github.com/stapelberg/airscan.NewClientForService(0x0, 0x0)
/home/me/go/src/github.com/stapelberg/airscan/airscan.go:333 +0x3a
main.(*airscanner).scan1(0xc0000de580, 0x0, 0x0)
/home/me/go/src/github.com/stapelberg/airscan/cmd/airscan1/airscan1.go:173 +0x52
main.airscan1(0x0, 0x0)
/home/me/go/src/github.com/stapelberg/airscan/cmd/airscan1/airscan1.go:155 +0x6e9
main.main()
/home/me/go/src/github.com/stapelberg/airscan/cmd/airscan1/airscan1.go:238 +0x25
This is my printer (I do not know whether it should be supported): HP LaserJet 200 colorMFP M276n. It is being advertised with Zeroconf as _scanner._tcp
.
Wonder how we determine if a printer is / is not compatible ?
Some white list ?
So it say its not compatible :
airscan1
2021/10/29 17:12:50 finding device for 5s (use -timeout=0 for unlimited)
2021/10/29 17:12:50 device "Brother MFC-L2710DW series" discovered (use -host="BRW90324B93B317")
2021/10/29 17:12:55 no compatible scanner found
Yet it works !
airscan1 -host BRW90324B93B317
2021/10/29 17:13:25 finding device for 5s (use -timeout=0 for unlimited)
2021/10/29 17:13:26 device "Brother MFC-L2710DW series" found in 301.239815ms
2021/10/29 17:13:32 wrote /tmp/page1.jpg (136163 bytes)
2021/10/29 17:13:33 scan done in 6.889450047s
works on my printer first time.
Wondering if there is any possibility to control where it puts the documents ?
FOund here: https://openprinting.github.io/OpenPrinting-News-January-2020/#driverless-scanning
airscan SHOUD work over USB also via using https://github.com/OpenPrinting/ipp-usb
golang based :)
I dont have a USB cable to test it. If someone has the time to test out this it be cool.
Q. would you be happy to review a small PR to add a cmdline parameter for the colour mode to pass through to the scanner?
e.g.,
-color_mode string
Color mode to scan using. One of BlackAndWhite1, Grayscale8 (default) or RGB24 (default "Grayscale8")
A declarative, efficient, and flexible JavaScript library for building user interfaces.
π Vue.js is a progressive, incrementally-adoptable JavaScript framework for building UI on the web.
TypeScript is a superset of JavaScript that compiles to clean JavaScript output.
An Open Source Machine Learning Framework for Everyone
The Web framework for perfectionists with deadlines.
A PHP framework for web artisans
Bring data to life with SVG, Canvas and HTML. πππ
JavaScript (JS) is a lightweight interpreted programming language with first-class functions.
Some thing interesting about web. New door for the world.
A server is a program made to process requests and deliver data to clients.
Machine learning is a way of modeling and interpreting data that allows a piece of software to respond intelligently.
Some thing interesting about visualization, use data art
Some thing interesting about game, make everyone happy.
We are working to build community through open source technology. NB: members must have two-factor auth.
Open source projects and samples from Microsoft.
Google β€οΈ Open Source for everyone.
Alibaba Open Source for everyone
Data-Driven Documents codes.
China tencent open source team.