simulpiscator / airsane Goto Github PK
View Code? Open in Web Editor NEWPublish SANE scanners to MacOS, Android, and Windows via Apple AirScan.
License: GNU General Public License v3.0
Publish SANE scanners to MacOS, Android, and Windows via Apple AirScan.
License: GNU General Public License v3.0
Many thanks for this project.
I have just given Airsaned a try on Ubuntu 18.04.2.
scanimage -d "brother4:bus5;dev1" --format tiff > raw.tiff
works great every time.
On OSX Mojave the Image Capture keeps refreshing the list of shared scanners upon clicking on the the scanner. But Airsaned does not exit.
While trying to access the scanner via the web interface it crashes with "Segmentation fault (core dumped)"
I built it with debug symbols and attached the valgrind output.
This is how I run it
airsaned --local-scanners-only=true --debug=true
enumerating local devices...
sane_init(nullptr, nullptr)
sane_exit()
found: brother4:bus5;dev1 (Brother DCP-L2510D)
sane_init(nullptr, nullptr)
sane_open(brother4:bus5;dev1) -> 0xaa96d80
sane_close(0xaa96d80)
sane_exit()
uuid: 3406f97c-f7d4-58d1-92f4-551373ed15bf
published as 'Brother DCP-L2510D'
listening on 127.0.0.1:8090
listening on 10.0.1.194:8090
listening on ::1:8090
listening on fe80::5054:ff:fe66:13cb:8090
Segmentation fault
I am trying to find the keyword in ScannerStatus when a scan is ready for download. I am working on a project but do not have access to an eSCL scannner right now
ScannerStatus
pwg:State can be "Idle", "Preparing", "Stopped" or "????" once the document is ready. I can ot identify this I can see clients trying to read it and sending "Idle" is not what they want to hear.
Can you tell me what this "document ready" state is?
I've noticed that the service may fail with the following error on boot:
Jul 29 15:26:11 nanopi airsaned[1240]: [bjnp] create_broadcast_socket: ERROR - bind socket to local address failed - Cannot assign requested address
Jul 29 15:26:17 nanopi airsaned[1240]: server finished with error status -1, last error was 99: Cannot assign requested address
I'm not an expert in networking services loading order but one hacky way to get around it could be delay the service by a couple of seconds e.g.:
[Service]
ExecStartPre=/bin/sleep 10
In the Bonjour advertisement I see some things although not necessary can contribute to a "prettier" interface . One of thise things the txt "representation" field, which both OSX and Mopria will use. At least one version of mopria I tested did have a problem with a "." after hostname.local. As I reported it maybe it got fixed. I know it would be complicated to accommodate thousands if different scanner models icons, but consistent with another suggestion I made here about the ability to customize ScannerSettings xml, one may need the ability to override (with custom) or even deactivate the Bonjour advertisement. Maybe some do not want automatic discovery of scanners, to help keep unauthorized users from using them.
Hi,
is it possible to add support for adf-scanners? (like canon p215, etc ?)
Regards,
Simon
Hi,
I see a different behaviour in AIC if I scan with simple options or advanced options. There is a part missing at the top of the page.
I own a Brother DCP-1510 which uses the brother4 SANE driver (deb package version 0.4.9-1), running on Ubuntu 20.04.
Looking at the debug output, [tl-y] = 64.994mm is set when using the advanced options, this is not the case in "simple mode".
airsaned-log.txt
Scan AIC simple options.png
Scan AIC advanced options.pdf
Here are the AIC advanced options settings:
Scan AIC settings.pdf
BTW, everything works fine when scanning via the web interface or the Android Mopria app.
Thanks in advance for having a look.
Best regards,
meiser
There're two issues in the macOS documentation.
diff --git a/README.macOS.md b/README.macOS.md
index 9d09b37..bbcac0b 100644
--- a/README.macOS.md
+++ b/README.macOS.md
@@ -12,7 +12,7 @@ There, execute the following commands:
sudo port install sane-backends jpeg libpng
sudo port install cmake
-git clone github.com/SimulPiscator/AirSane.git
+git clone https://github.com/SimulPiscator/AirSane.git
mkdir AirSane-build && cd AirSane-build
cmake ../AirSane
make
diff --git a/README.md b/README.md
index 50a6ed8..24c0af6 100644
--- a/README.md
+++ b/README.md
@@ -61,7 +61,7 @@ Build files and instructions for OpenWRT have been published here:
### Build on macOS
AirSane may be run on a macOS installation in order to serve locally attached
scanners to eSCL clients such as Apple Image Capture. For instructions, see
-[the macOS README file](README-macOS.md).
+[the macOS README file](README.macOS.md).
### Build and install from source on Debian/Ubuntu/Raspbian
#### Build
When following the README.md
instructions, I got the following error:
$ sudo apt install libusb-1.*-dev
Reading package lists... Done
Building dependency tree
Reading state information... Done
E: Unable to locate package libusb-1.*-dev
I forget how I got it to work when I was initially running through the instructions. This is what I currently have installed:
$ apt list --installed | grep libusb
WARNING: apt does not have a stable CLI interface. Use with caution in scripts.
libusb-0.1-4/focal,now 2:0.1.12-32 amd64 [installed,automatic]
libusb-1.0-0-dev/focal,now 2:1.0.23-2build1 amd64 [installed]
libusb-1.0-0/focal,now 2:1.0.23-2build1 amd64 [installed,automatic]
libusb-1.0-0/focal,now 2:1.0.23-2build1 i386 [installed,automatic]
libusb-1.0-doc/focal,focal,now 2:1.0.23-2build1 all [installed,automatic]
libusb-dev/focal,now 2:0.1.12-32 amd64 [installed]
libusbmuxd6/focal,now 2.0.1-2 amd64 [installed,automatic]
Judging by what's installed, it looks like this is what I did that ended up working:
$ sudo apt install libusb-1.0-0-dev
Reading package lists... Done
Building dependency tree
Reading state information... Done
libusb-1.0-0-dev is already the newest version (2:1.0.23-2build1).
0 upgraded, 0 newly installed, 0 to remove and 0 not upgraded.
(IIRC I tried installing just libusb-dev
, since that is indeed also manually installed on my system, but the make
script didn't like that and insisted I use libusb-1.0-0-dev
instead.)
So, I guess, if it's okay to specify libusb-1.0-0-dev
rather than libusb-1.*-dev
, you could just update that in the instructions.
from https://ftp.pwg.org/pub/pwg/candidates/cs-ippscan10-20140918-5100.17.pdf
rs Resource portion of Scanner URI without leading
slash.
It is in table 10 page 42 of mentioned document
I am trying to make the scanner part of a Brother DCP-7030 work with AirSane but it keeps failing:
Whether I start the scan via the AirSane web interface or via "Image Capture" on a Mac, the scanner makes it's starting noises but then stops after a second or so. Meanwhile scanning with scanimage
works perfectly fine.
AirSane debug mode always reports sane_read(0x7f895c1098b0): Out of memory
Output from sudo airsaned --debug=true --access-log=-
:
reading device options from '/etc/airsane/options.conf'
enumerating local devices...
sane_init(nullptr, nullptr)
sane_get_devices() ...
... sane_get_devices() -> SANE_Status Success
sane_exit()
found: brother3:bus2;dev1 (Brother DCP-7030)
sane_init(nullptr, nullptr)
sane_open(brother3:bus2;dev1) -> 0x7f811c136c70
[source] := "FlatBed"
sane_close(0x7f811c136c70)
sane_exit()
stable unique name: brother3:Brother DCP-7030:1
uuid: 2bd3004d-341f-5655-abba-3dccc99c3448
/etc/airsane/options.conf: regex 'brother3:.*' matches device name 'brother3:bus2;dev1'
published as 'Brother DCP-7030'
listening on 127.0.0.1:8090
listening on 192.168.178.22:8090
listening on 172.17.0.1:8090
listening on 172.18.0.1:8090
listening on [::1]:8090
listening on [fe80::7285:c2ff:fe30:f4df]:8090
listening on [fe80::42:2dff:febf:4f11]:8090
listening on [fe80::20bd:c6ff:fef2:47f5]:8090
192.168.178.35 - - [14/Nov/2020:14:15:46 +0100] "GET /" 200 516 "" "Mozilla/5.0(Macintosh;IntelMacOSX10_15_7)AppleWebKit/605.1.15(KHTML,likeGecko)Version/14.0.1Safari/605.1.15"
192.168.178.35 - - [14/Nov/2020:14:15:46 +0100] "GET /" 200 516 "" "Mozilla/5.0(Macintosh;IntelMacOSX10_15_7)AppleWebKit/605.1.15(KHTML,likeGecko)Version/14.0.1Safari/605.1.15"
192.168.178.35 - - [14/Nov/2020:14:15:48 +0100] "GET /2bd3004d-341f-5655-abba-3dccc99c3448" 200 2896 "http://192.168.178.22:8090/" "Mozilla/5.0(Macintosh;IntelMacOSX10_15_7)AppleWebKit/605.1.15(KHTML,likeGecko)Version/14.0.1Safari/605.1.15"
document format requested: image/jpeg
document format used: image/jpeg
using grayscale gamma of 0.555555
sane_init(nullptr, nullptr)
sane_open(brother3:bus2;dev1) -> 0x7f895c1098b0
[mode] := "True Gray" -> reload options
[source] := ""
[resolution] := 300dpi
[tl-x] := 0mm
[tl-y] := 0mm
[br-x] := 210mm
[br-y] := 297mm
sane_start(0x7f895c1098b0) with options:
[br-x] = 209.981mm
[br-y] = 296.973mm
[brightness] = 0%
[contrast] = 0%
[mode] = "True Gray"
[resolution] = 300dpi
[source] = "FlatBed"
[tl-x] = 0mm
[tl-y] = 0mm
sane_read(0x7f895c1098b0): Out of memory
sane_cancel(0x7f895c1098b0)
sane_close(0x7f895c1098b0)
sane_exit()
192.168.178.35 - - [14/Nov/2020:14:15:56 +0100] "POST /2bd3004d-341f-5655-abba-3dccc99c3448" 200 0 "http://192.168.178.22:8090/2bd3004d-341f-5655-abba-3dccc99c3448" "Mozilla/5.0(Macintosh;IntelMacOSX10_15_7)AppleWebKit/605.1.15(KHTML,likeGecko)Version/14.0.1Safari/605.1.15"
Output from sudo scanimage -d "brother3:bus2;dev1" -A
:
All options specific to device `brother3:bus2;dev1':
Mode:
--mode Black & White|Gray[Error Diffusion]|True Gray|24bit Color [24bit Color]
Select the scan mode
--resolution 100|150|200|300|400|600|1200|2400|4800|9600dpi [200]
Sets the resolution of the scanned image.
--source FlatBed [FlatBed]
Selects the scan source (such as a document-feeder).
--brightness -50..50% (in steps of 1) [inactive]
Controls the brightness of the acquired image.
--contrast -50..50% (in steps of 1) [inactive]
Controls the contrast of the acquired image.
Geometry:
-l 0..215.9mm (in steps of 0.0999908) [0]
Top-left x position of scan area.
-t 0..355.6mm (in steps of 0.0999908) [0]
Top-left y position of scan area.
-x 0..215.9mm (in steps of 0.0999908) [215.88]
Width of scan-area.
-y 0..355.6mm (in steps of 0.0999908) [355.567]
Height of scan-area.
I have to note that the reported resolutions seem not correct as the scanner only supports 100, 200, 300 and 600 dpi.
Addition:
I see now that airsane reports my experiments with the config file in line /etc/airsane/options.conf: regex 'brother3:.*' matches device name 'brother3:bus2;dev1'
. I tried to set default options for the printer as I suspected wrong default settings (like the scan area), but this didn't help.
Hello! Is it possible to build AirSane for OpenWRT?
I'm currently using sane, but I had to use command line to scan.
It would be great if I could use my scanner via default "Image Capture" OS X app
Hi!
This is a recent problem that didn't appear weeks (or months) ago when I installed AirSane for the first time.
The problem appeared on a RaspberryPi 3 B+ with Raspbian Buster.
I followed all instructions for installing AirSane, I have done it before with same scanner and same Raspberry Pi but on Raspbian Stretch and worked perfectly. Now it installed nicely but AirSane is not showing the scanner.
If I run sudo scanimage -L
I get the right scanner: device epson2:libusb:001:004 is a Epson GT-9800 flatbed scanner
But on the AirSane server I get that there are no scanners:
Scanners
No scanners available
Build
date: Oct 12 2019, 18:22:53
commit: 7fbaa42 (branch master, revision 44)
Any idea what can be causing this problem?
And by the way, thanks for such a wonderful tool...
My server running AirSane is a KVM VM. When I power-on my Brother scanner, the device is attached to the VM via a udev rule.
When I power-off the scanner, the device is currently NOT detached from the VM (issue with udev remove rule).
That's why the device is still shown in lsusb output and AirSane thinks that it's still available.
As soon as e.g. AirSane tries to access the scanner because AIC requests a preview scan, AirSane segfaults.
Here's the gdb backtrace (first part is a successful preview scan after powering on the device, the second is the one causing the segfault as device is powered off):
gdb-backtrace.txt
Of the three scanners I have tested, one offers A5 and A6 paper size but no A4. The other two do not offer A4 Landscape .
--
Brian.
I also tried this after su root and it is the same. Can you offer any advice?
Ubuntu 16.04_x86
sudo make install
Scanning dependencies of target airsaned
[ 5%] Building CXX object CMakeFiles/airsaned.dir/server/main.cpp.o
In file included from /usr/include/c++/5/thread:35:0,
from /usr/src/AirSane/server/main.cpp:19:
/usr/include/c++/5/bits/c++0x_warning.h:32:2: error: #error This file requires compiler and library support for the ISO C++ 2011 standard. This support must be enabled with the -std=c++11 or -std=gnu++11 compiler options.
#error This file requires compiler and library support
^
In file included from /usr/src/AirSane/server/scanner.h:26:0,
from /usr/src/AirSane/server/scanserver.h:22,
from /usr/src/AirSane/server/main.cpp:21:
/usr/src/AirSane/./sanecpp/sanecpp.h:45:14: error: ‘shared_ptr’ in namespace ‘std’ does not name a template type
typedef std::shared_ptr device_handle;
^
/usr/src/AirSane/./sanecpp/sanecpp.h:47:1: error: ‘device_handle’ does not name a type
device_handle open(const std::string&, SANE_Status* = nullptr);
^
/usr/src/AirSane/./sanecpp/sanecpp.h:48:1: error: ‘device_handle’ does not name a type
device_handle open(const device_info&, SANE_Status* = nullptr);
^
/usr/src/AirSane/./sanecpp/sanecpp.h:109:5: error: ‘device_handle’ does not name a type
device_handle m_device;
^
/usr/src/AirSane/./sanecpp/sanecpp.h:115:29: error: field ‘device_handle’ has incomplete type ‘sanecpp::option_set’
option_set(device_handle);
^
/usr/src/AirSane/./sanecpp/sanecpp.h:106:7: note: definition of ‘class sanecpp::option_set’ is not complete until the closing brace
class option_set
^
/usr/src/AirSane/./sanecpp/sanecpp.h:116:37: warning: defaulted and deleted functions only available with -std=c++11 or -std=gnu++11
option_set(const option_set&) = delete;
^
/usr/src/AirSane/./sanecpp/sanecpp.h:117:48: warning: defaulted and deleted functions only available with -std=c++11 or -std=gnu++11
option_set& operator=(const option_set&) = delete;
^
/usr/src/AirSane/./sanecpp/sanecpp.h:119:15: error: ‘device_handle’ is not a type
void init(device_handle);
^
/usr/src/AirSane/./sanecpp/sanecpp.h:144:35: error: only declarations of constructors and conversion operators can be ‘explicit’
explicit session(device_handle);
^
/usr/src/AirSane/./sanecpp/sanecpp.h:144:35: error: field ‘device_handle’ has incomplete type ‘sanecpp::session’
/usr/src/AirSane/./sanecpp/sanecpp.h:140:7: note: definition of ‘class sanecpp::session’ is not complete until the closing brace
class session
^
/usr/src/AirSane/./sanecpp/sanecpp.h:157:5: error: ‘device_handle’ does not name a type
device_handle m_device;
^
In file included from /usr/src/AirSane/server/scanserver.h:22:0,
from /usr/src/AirSane/server/main.cpp:21:
/usr/src/AirSane/server/scanner.h:35:31: warning: defaulted and deleted functions only available with -std=c++11 or -std=gnu++11
Scanner(const Scanner&) = delete;
^
/usr/src/AirSane/server/scanner.h:36:42: warning: defaulted and deleted functions only available with -std=c++11 or -std=gnu++11
Scanner& operator=(const Scanner&) = delete;
^
/usr/src/AirSane/server/scanner.h:62:10: error: ‘shared_ptr’ in namespace ‘std’ does not name a template type
std::shared_ptr createJobFromScanSettingsXml(const std::string&, bool autoselectFormat = false);
^
/usr/src/AirSane/server/scanner.h:63:10: error: ‘shared_ptr’ in namespace ‘std’ does not name a template type
std::shared_ptr getJob(const std::string& uuid);
^
/usr/src/AirSane/server/scanner.h:66:25: error: ‘shared_ptr’ is not a member of ‘std’
typedef std::vector<std::shared_ptr> JobList;
^
/usr/src/AirSane/server/scanner.h:66:25: error: ‘shared_ptr’ is not a member of ‘std’
/usr/src/AirSane/server/scanner.h:66:51: error: ‘JobList’ was not declared in this scope
typedef std::vector<std::shared_ptr> JobList;
^
/usr/src/AirSane/server/scanner.h:66:51: error: template argument 1 is invalid
/usr/src/AirSane/server/scanner.h:66:51: error: template argument 2 is invalid
/usr/src/AirSane/server/scanner.h:66:18: warning: ‘typedef’ was ignored in this declaration
typedef std::vector<std::shared_ptr> JobList;
^
/usr/src/AirSane/server/scanner.h:67:5: error: ‘JobList’ does not name a type
JobList jobs() const;
^
/usr/src/AirSane/server/scanner.h:69:10: error: ‘shared_ptr’ in namespace ‘std’ does not name a template type
std::shared_ptrsanecpp::session open();
^
A nice, useful application with good instructions for compilation and installation.
I have a local HP aio (a PSC 1300) which offers scan resolutions of 75, 300 and 600 dpi in the browser.
returns
Is there a reason for the difference?
--
Brian.
Hi, I'm trying to use an old scanner that works perfectly with xsane, but the program crashes and I don't know what I am doing wrong:
user@ubuntu-linux:~$ airsaned --debug=true
enumerating local devices...
sane_init(nullptr, nullptr)
sane_exit()
found: plustek:libusb:002:003 (Canon CanoScan N650U/N656U)
sane_init(nullptr, nullptr)
sane_open(plustek:libusb:002:003) -> 0x7fca1803fa30
sane_close(0x7fca1803fa30)
sane_exit()
uuid: b3ebec0b-d7ff-a6aa-7553-3510934a8447
terminate called after throwing an instance of 'std::out_of_range'
what(): basic_string::substr: __pos (which is 1) > this->size() (which is 0)
Aborted (core dumped)
If I disconnect the scanner and enable the test backend, it runs correctly and I can see the dummy scanners on my browser:
user@ubuntu-linux:~$ airsaned --debug=true
enumerating local devices...
sane_init(nullptr, nullptr)
sane_exit()
found: test:0 (Noname frontend-tester)
sane_init(nullptr, nullptr)
sane_open(test:0) -> 0x7f4b9c041360
[source] := "Flatbed"
[source] := "Automatic Document Feeder"
sane_close(0x7f4b9c041360)
sane_exit()
uuid: e2a87172-2497-5763-fb24-12e41c529760
published as 'Noname frontend-tester'
found: test:1 (Noname frontend-tester)
sane_init(nullptr, nullptr)
sane_open(test:1) -> 0x7f4b9c089f60
[source] := "Flatbed"
[source] := "Automatic Document Feeder"
sane_close(0x7f4b9c089f60)
sane_exit()
uuid: f1f7c52b-99b7-84c8-0ac3-69b370c194d9
published as 'Noname frontend-tester #2'
listening on 127.0.0.1:8090
listening on 10.211.55.10:8090
listening on ::1:8090
listening on fdb2:2c26:f4e4:0:70e4:21a3:8b9f:44b9:8090
listening on fdb2:2c26:f4e4:0:21c:42ff:fe82:9e1:8090
listening on fe80::21c:42ff:fe82:9e1:8090
I think you are on to something great here.
I recently wrote an email to the SANE Devs list that to date, has not received an reply. I think the antiquated SANE over network needs to be seriously revamped for something more modern and a standard in use today, CUPS has managed to keep up with the times and did so before Apple aquired it. SANE needs to follow that example.
There are three potential models
eSCL/AirScan
WSD
IPP scanning
Any of which if replacing SANE over network would be better than what we have now. I think the first two are xml based, not sure about the third. It is far too easy to read ScannerSettings and derive settings to submit an xml to POST then read the resulting file. It opens up new ways for machine to machine communication, which as we step in to the 21st centrury becomes more and more important. Maybe today you do not need your refridgerator to scan something but tomorrow some new whizbang device will come out incorporating one of these standards. This is without mentioning the ease with which one might convert WSD xml to eSCL xml or visa versa;
What you have here is the potential foundation for that, with the single exception that SANE still has no eSCL Back-end. If such a back-end existed the need for the antiquated SANE over network protocol would be eliminated.
I recently installed the precompiled Sane backends and AirSane from pcloadletter on my synology DS414. I can now access my scanner (a Canon Lide 700F) via my browser and scan images that way.
However I cannot add it in my Macs (latest version of Mojave) Printer and Scanner settings or access it in the Image Capture app.
Today I opened a Finder window and navigated to the Airscan app you mentioned in your description (system - library - image capture...) and double clicked on it. Suddenly the scanner appeared and I was able to add it.
However after a reboot I couldn’t manage to get it working again. Do I miss anything?
Hi SimulPiscator,
Your software is awesome and it really does the job like expected.
After several successful scans, I noticed in some scenario the AirSane service is easily hanged, so I make this report hope to help improve this software.
The problem is, when something goes wrong in the backend, the AirSane service will not handle them properly, and will hang and not respond to any further operations, until a manual restart of AirSane service through systemctl.
When the service is hanged, I can still use the "imagescan" command to scan image directly on the server, so it's not the backend/scanner problem. Any further oprations to the hanged AirSane service will cause an "session in use" error in the log.
So it's maybe the AirSane's session management part thing, and it may be improved.
Details of the problem and how to reproduce the hang:
Now it just hang there forever:
After my several tweaking, I think there are maybe two problems to be solved:
1. Some session management/check mechanism can be added, when it detects an error in the session, it can be auto-recovered, instead of a manual restart of the service from the server console.
So if something wrong with the backend in the session, this session should be destroyed or closed or reset or something and should be recovered by itself, other than just hang. And it's better to have an error report to the App side, so the App can know it's failed and can take its reaction.
This will solve most of the problem, because an ordinary user don't know how to log on to the server and restart it, as for them the wireless scanner is just broken and they just have nothing to do with it.
In my experience, such an error in the backend can be easily triggered even if you don't do anything strange, just open the Scanner App, everything default, click "Scan", with some specific document layout and it will just broken.
To solve every possible error is one thing, get recovered from it is another.
This auto-recovery mechanism can hugely improve the robustness of this service. Without solving every possible problem, it can become a real work horse.
2. Add an operation/session queue, so multiple scan area selections and/or frequent user actions will not easily cause an backend error, and cause AirSane hang.
In my experiments, multiple small selections will randomly cause an error, frequent user actions too.
For example, when the Scanner App displays "Scanner is warming up", you press "Cancel", and then press "Overview", or when the scan is in process, you "cancel" and then "overview", or just press "Overview" multiple times, it will easily hang and the console log will say "session in use".
So I think maybe it's the command is delivered while the scanner it self is not totally finished with the previous job, that causes the new job is discarded at the scanner side, and cause the session to be waiting forever, and block further actions. (That's my presumption, hope to provide some clue to this).
This may be another cause of the hang problem mentioned above.
So, If these issues are fixed, the robustness of AirSane can be improved greatly and become more error proof so ordinary users can rely on it without the mess of the console.
Hope this helps, thanks again!
I'm interested in basically writing the reverse of this code - a SANE backend that talks to AirScan/eSCL devices on the network, and allows existing SANE frontends (e.g. xsane) to scan from them.
You say this in your README:
AirSane has been developed by reverse-engineering the communication protocol implemented in Apple's AirScanScanner client
Would you be willing to share your reverse-engineering notes? Or any resources you may have found that documents this protocol?
Hi,
For including your software in debian, we should have a statement of the reverse engineering.
I suppose you have done a clean room implementation.
Could you certify that you have done correctyl and legally the reverse engineering ?
Thanks
[email protected]
I am looking for wireshark (or other) traces of successful eSCL/AirScan scans. If anyone can help please .
I am looking for all exchanges between scanner and client from scanner detection all the way through to client loading the image.
I have no eSCL devices here. I would prefer to see it from a Mac to an "officially supported" scanner but will take what I can get.
You can send them to markosjal at the email with a G.
Hi @SimulPiscator, thanks for your quick response on the other issue! It seems to have fixed some things, but there are still some quirks to be ironed out. For example, the ESCL version of the scanner shows up as a flatbed, rather than sheet-fed. Scanning still works on macOS, but the scanner settings in Image Capture indeed think the device is a flatbed, so neither double-sided nor automatic multi-page scans work. Both double-sided and automatic multi-page scans work locally using SANE over USB, so this seems to be a problem with AirSane, not SANE.
Here's one set of outputs:
$ sudo -u saned scanimage -L
device `fujitsu:ScanSnap iX500:1200753' is a FUJITSU ScanSnap iX500 scanner
device `escl:http://127.0.0.1:8090' is a ESCL FUJITSU ScanSnap iX500 flatbed scanner
device `escl:http://192.168.4.34:8090' is a ESCL FUJITSU ScanSnap iX500 flatbed scanner
device `escl:http://fd10:e07c:45dd:1:c98a:733d:a197:6f53:8090' is a ESCL FUJITSU ScanSnap iX500 flatbed scanner
Notice that the ESCL scanners (which shouldn't be visible after your change), add the word "flatbed".
Hi, this is not really an issue, but can you maybe share some information about how to build / compile (or whatever it's called) Airsane for a Synology Diskstation (DS 414 specifically in my case).
About a year ago I installed a pre-compiled package from pcloadletter as you suggest in your instructions, but the version provided there is quite old by now and I'd like to make use of all of the improvements and new features of Airsane that you added recently.
Please don't get me wrong I'm fully aware that it would be very time consuming for you to compile your app for all those different architectures so I'm really not complaining.
It's just that I have literally no clue how to do it myself. And it's frustrating because SANE means Scanner Access Now Easy. And with your app it is in fact very easy. But still so difficult (for me at least)...
When trying to scan with an Oki_MC853 on Debian testing, I always get the error "Error during device I/O" with sane. The eScl/ScanJobs always returns 400 Bad request. But if I try the same with curl, the scan succeeds.
Testing with Mopria Android , the program crashes and closes. Wireshark reveals that It Sent ScannerStatus.xml just before the crash. So it looks like possibly someting in ScannerrStatus.xml is causing the crash.
Since Mopria is involved in defining these standards it seems compatibility should be a priority
sudo make install
[ 5%] Building CXX object CMakeFiles/airsaned.dir/imageformats/pngencoder.cpp.o
/usr/src/AirSane/imageformats/pngencoder.cpp: In member function ‘virtual void PngEncoder::onWriteLine(const void*)’:
/usr/src/AirSane/imageformats/pngencoder.cpp:122:47: error: ‘png_const_bytep’ does not name a type
::png_write_row(p->mpPng, static_cast<png_const_bytep>(data));
^
/usr/src/AirSane/imageformats/pngencoder.cpp:127:52: error: ‘png_const_bytep’ does not name a type
::png_write_row(p->mpPng, reinterpret_cast<png_const_bytep>(p->mLineBuf
^
CMakeFiles/airsaned.dir/build.make:398: recipe for target 'CMakeFiles/airsaned.dir/imageformats/pngencoder.cpp.o' failed
make[2]: *** [CMakeFiles/airsaned.dir/imageformats/pngencoder.cpp.o] Error 1
CMakeFiles/Makefile2:67: recipe for target 'CMakeFiles/airsaned.dir/all' failed
make[1]: *** [CMakeFiles/airsaned.dir/all] Error 2
Makefile:127: recipe for target 'all' failed
make: *** [all] Error 2
I am not a programmer at all but find myself deepely involved in supporting a specific scanner that has pretty bad driver support. I have created a web interface that allows it to scan from anywhere on the network by way of a Linux host. I would like to add Apple AirScan compatibility to it if possible, so that the host listens for airscan requests and passes them along to the scanner, even if some features like PDF require the use of imagemagick
It seems you had to disassemble the AirScan protocol and emulate it .
I would like to know if you could be so kind ... are these two parts the most responsible for listening for AirScan Requests? It seems these are the most relevant.
airsaned.default Listening by interface rather than address to fix IPv6 issue a year ago
airsaned.service Listening by interface rather than address to fix IPv6 issue a year ago
I am looking for a way to get airscan service added to my custom webserver so that iOS devices will work with it.I thought you might offer a pointer or two?
Hi,
as I also have some Windows 10 clients, I'd like to also be able to use my network scanner in Windows.
May I ask to integrate WSD support? I know, this is totally different to AirScan, but I hope to see it integrated.
Thanks in advance,
meiser
This AirSane is really something, it should be added to the SANE's project page, and recommend everyone give it a try.
Other remote frontend of SANE is either outdated(TwainSane) or have problems here or there (phpsane, scanserv and it's updated version scanservjs, some java frontends.....).
Before I found this, I have already give up searching, and prepared my self to write something similar myself, to get this simple scan functionality just work through my Lan...
Everything in AirSane works just like expected, and beyond!
The Apple's AirScan protocol works fairly well without any further mess, open the image capture app in my iMac and the scanner is just there, everything just works.
Even the installation guide's quality is the best, with great clarity, I don't get a single error during the process, just copy and paste your command and it's just built and work fine. I really hope all the other software programmer's can do just the same, then we can save a lot time and cheer.
Anyway, thank you man, you got me saved. Keep moving on, make AirSane the best SANE frontend up to date!
Hi,
After a lot of wrestling with cmake I finally managed to get this cross-compiled for Synology NAS Linux. Some time ago I built a sane-backends package for these devices and their very diverse CPU architectures (7 targets). Ideally I aim to include your software with that package so that sane-supported scanners connected to the NAS work seamlessly with modern Macs.
Using the latest source I encountered an error compiling pdfencoder.cpp: 'runtime_error' is not a member of 'std' which I resolved by adding an include for stdexcept to that source file. I linked to sane-backends version 1.0.28.
AirSane works as described, however I notice that the plustek backend which my own scanner uses (Canon LiDE 20) seems to be limited to 50dpi in macOS Image Capture. The GUI only shows that one value in the resolution dropdown. I notice however that the airsaned local web server does offer resolutions of 50, 300, 600, and 1200dpi. I have verified that acquisition via this method does function correctly all the way to 1200dpi. Typical values 75 and 150 are missing.
Test system:
Mac OS High Sierra 10.13.6, Image Capture 7.0 (1106)
The same behaviour persists using:
Mac OS Mojave 10.14.6, Image Capture 8.0 (1106)
Since the web acquisition method on TCP8090 works, this does suggest the available resolutions are perhaps not being communicated correctly to Image Capture.
Please can you take a look?
Thanks
Patters
I am running AirSane on a Raspberry Pi 3B (Raspbian GNU/Linux 10 \n \l (v 10.2)). I am using macOS 10.15.2 as a client.
When trying to use Image Capture I get the following error message:
In System Preferences the Scanner gets configured as:
I runned the server via
sudo -u saned airsaned --debug=true --access-log=-
and when using Image Capture I saw no activity at all:
enumerating local devices...
sane_init(nullptr, nullptr)
sane_get_devices() ...
... sane_get_devices() -> SANE_Status Success
sane_exit()
found: hpaio:/usb/Deskjet_F4500_series?serial=[SOME SERIAL] (Hewlett-Packard Deskjet_F4500_series)
sane_init(nullptr, nullptr)
sane_open(hpaio:/usb/Deskjet_F4500_series?serial=[SOME SERIAL]) -> 0x752362c0
[source] := "Flatbed"
sane_close(0x752362c0)
sane_exit()
uuid: 27b46af4-f1f6-55ca-b60d-dc7814f8d43b
published as 'Hewlett-Packard Deskjet_F4500_series'
listening on 127.0.0.1:8090
listening on 192.168.0.11:8090
listening on ::1:8090
listening on [SOME IPV6 IP]:8090
listening on [SOME IPV6 IP]::8090
listening on [SOME IPV6 IP]::8090
Scanning via "http://local-ip-of-pi:8090" works without any issue and making a test scan results into this:
enumerating local devices...
sane_init(nullptr, nullptr)
sane_get_devices() ...
... sane_get_devices() -> SANE_Status Success
sane_exit()
found: hpaio:/usb/Deskjet_F4500_series?serial=[SOME SERIAL] (Hewlett-Packard Deskjet_F4500_series)
sane_init(nullptr, nullptr)
sane_open(hpaio:/usb/Deskjet_F4500_series?serial=[SOME SERIAL]) -> 0x752362c0
[source] := "Flatbed"
sane_close(0x752362c0)
sane_exit()
uuid: 27b46af4-f1f6-55ca-b60d-dc7814f8d43b
published as 'Hewlett-Packard Deskjet_F4500_series'
listening on 127.0.0.1:8090
listening on 192.168.0.11:8090
listening on ::1:8090
listening on [SOME IPV6 IP]:8090
listening on [SOME IPV6 IP]::8090
listening on [SOME IPV6 IP]::8090
192.168.0.4 - - [06/Jan/2020:18:51:12 +0000] "GET /" 404 0 "" "Mozilla/5.0(Macintosh;IntelMacOSX10_15_2)AppleWebKit/605.1.15(KHTML,likeGecko)Version/13.0.4Safari/605.1.15"
192.168.0.4 - - [06/Jan/2020:18:51:34 +0000] "GET /27b46af4-f1f6-55ca-b60d-dc7814f8d43b" 200 2866 "http://192.168.0.11:8090/" "Mozilla/5.0(Macintosh;IntelMacOSX10_15_2)AppleWebKit/605.1.15(KHTML,likeGecko)Version/13.0.4Safari/605.1.15"
sane_init(nullptr, nullptr)
sane_open(hpaio:/usb/Deskjet_F4500_series?serial=[SOME SERIAL]) -> 0x73019918
[mode] := "Gray"
[source] := "" -> Invalid argument
[resolution] := 600dpi
[tl-x] := 0mm
[tl-y] := 0mm
[br-x] := 148mm
[br-y] := 210mm
sane_start(0x73019918) with options:
[batch-scan] = 0
[br-x] = 148mm
[br-y] = 210mm
[brightness] = 0
[compression] = "JPEG"
[contrast] = 0
[jpeg-quality] = 10
[length-measurement] = "Padded"
[mode] = "Gray"
[resolution] = 600dpi
[source] = "Flatbed"
[tl-x] = 0mm
[tl-y] = 0mm
sane_read(0x73019918): End of file reached
sane_close(0x73019918)
sane_exit()
192.168.0.4 - - [06/Jan/2020:18:57:07 +0000] "POST /27b46af4-f1f6-55ca-b60d-dc7814f8d43b" 200 17375883 "http://192.168.0.11:8090/27b46af4-f1f6-55ca-b60d-dc7814f8d43b" "Mozilla/5.0(Macintosh;IntelMacOSX10_15_2)AppleWebKit/605.1.15(KHTML,likeGecko)Version/13.0.4Safari/605.1.15"
It seems like Image Capture is not even trying to communicate to the server.
This one confused me. In my testing I had commented out all the backends except my own scanner's plustek one and airsaned was very reliable - starting and stopping as expected hundreds of times as I developed the package for Synology NAS.
However, now that I am close to release-ready, when testing a fresh installation of the very same sane-backends 1.0.28 (with libusb 1.0.23 since the system has a pre-v1.0 version) airsaned would not start:
enumerating local devices...
sane_init(nullptr, nullptr)
Segmentation fault (core dumped)
Oddly, it would start if sane was removed from the inetd config. This is the same system I have used since the start, and the only difference I can find is that now the list of enabled backends is back to the very inclusive default state.
AirSane returns to a reliable working state once all the unwanted backends are commented out from etc/sane.d/dll.conf.
Trying again several times I find that sometimes it works fine despite all the backends remaining enabled. In summary then it appears to be inconsistent with all backends enabled, and reliable when most of them are commented out. I notice that your README recommends to comment out unused ones, so is there a timeout issue in airsaned perhaps during device detection? Ideally I want this to be a package that requires no manual configuration, so most users will in fact have the default inclusive list.
sane-find-scanner -q and scanimage -L worked fine throughout - and presumably AirSane's device enumeration will be using those same sane library functions so I think it's unlikely the cause of the issue lies with sane-backends.
Any ideas?
I am not a great fan of Scan(2).pdf as a file name because "(" and ")" have to be escaped on the command line. I would alter it to a more convenient Scan-2.pdf if I knew which part of the code to change.
--
Brian.
VueScan, I believe should detect the scanner from the Avahi advertisement as it does with tested eSCL Scanners and this project https://github.com/markosjal/AirScanning.
Vuescan simply is looking for something it is not seeing or understanding in the Avahi/Bonjour advertisement . This was tested on Localhost and over LAN with current VueScan Version
I just did a clean install of Mint 19.1 after seeing that ubuntu 16.04 has issues with PNG support.
I can get all the way through building and installing then I get the following at sudo systemctl ststus airsand (full status pasted below)
io/hpmud/pp.c 627: unable to read device-id ret=-1
I am currently using the SANE test back-end tester but as far as I can see it works in Simple Scan . I then reduced the number of virtual scanners to 1 (default is 2)
Also I tried to access http://localhost:8090/eSCL/ScannerStatus and get a page not found but as I understand it an AirScan Scanner (AirSANE in this case) should respond to that URL.
sudo systemctl status airsaned
● airsaned.service - AirSane Imaging Service
Loaded: loaded (/lib/systemd/system/airsaned.service; enabled; vendor preset: enabled)
Active: active (running) since Thu 2019-06-06 14:19:47 CDT; 8min ago
Main PID: 2722 (airsaned)
Tasks: 6 (limit: 4464)
CGroup: /system.slice/airsaned.service
└─2722 /usr/local/bin/airsaned --interface=* --listen-port=8090 --access-log= --hotplug=true --mdns-announce=true -
Jun 06 14:19:47 mark-HP-EliteBook-6930p systemd[1]: Started AirSane Imaging Service.
Jun 06 14:19:47 mark-HP-EliteBook-6930p airsaned[2722]: io/hpmud/pp.c 627: unable to read device-id ret=-1
lines 1-10/10 (END)
Not an issue, but have you ever thought about doing the same thing for WS-Scan? One server for all scanners is such a nice idea...
Hi,
running airsaned on macOS 10.15, I'd like the daemon only to listen on the loopback interface lo0.
When the scanner is not yet connected and the daemon is started, the daemon listens on lo0. As soon as the scanner is connected, the daemon listens on all interfaces. On disconnect, the daemon then again only listens on lo0.
$ /usr/local/sbin/airsaned --interface=lo0 --base-port=8090 --options-file=/usr/local/etc/airsane/options.conf --ignore-list=/usr/local/etc/airsane/ignore.conf --debug=true
git commit: 538f5d6 (branch master, rev 154+)
build date: 2021-01-10T14:17:06Z
reading device options from '/usr/local/etc/airsane/options.conf'
enumerating local devices...
sane_init(nullptr, nullptr)
sane_get_devices() ...
... sane_get_devices() -> SANE_Status Success
sane_exit()
listening on 127.0.0.1:8090
listening on [::1]:8090
listening on [fe80::1]:8090
hotplug event, reloading configuration
received SIGHUP, reloading
reading device options from '/usr/local/etc/airsane/options.conf'
enumerating local devices...
sane_init(nullptr, nullptr)
sane_get_devices() ...
... sane_get_devices() -> SANE_Status Success
sane_exit()
found: genesys:libusb:020:016 (Canon LiDE 90)
sane_init(nullptr, nullptr)
sane_open(genesys:libusb:020:016) -> 0x7fadbfe0d9a0
[source] := "Flatbed"
sane_close(0x7fadbfe0d9a0)
sane_exit()
stable unique name: genesys:Canon LiDE 90:1
uuid: f623eb2c-baa8-543b-a71a-24b9a75abd1b
/usr/local/etc/airsane/options.conf: regex 'genesys:.*' matches device name 'genesys:libusb:020:016'
published as 'Canon LiDE 90'
listening on 127.0.0.1:8091
listening on 127.0.0.1:8090
listening on [::1]:8091
listening on [::1]:8090
listening on [fe80::1]:8091
listening on [fe80::1]:8090
listening on [fe80::c7a:c89a:f723:19f8]:8091
listening on 192.168.2.2:8091
listening on [IPv6 GUA]:8091
listening on [IPv6 GUA]:8091
listening on [fe80::2c3d:5cff:fe96:8199]:8091
listening on [fe80::2c3d:5cff:fe96:8199]:8091
listening on [fe80::300c:3fde:382a:cdfc]:8091
listening on [fe80::fe2c:73fd:f8cb:1dd5]:8091
listening on [fe80::5ab8:d839:b1e6:8165]:8091
listening on 192.168.217.1:8091
listening on 172.16.210.1:8091
listening on [fe80::aede:48ff:fe00:1122]:8091
hotplug event, reloading configuration
received SIGHUP, reloading
reading device options from '/usr/local/etc/airsane/options.conf'
enumerating local devices...
sane_init(nullptr, nullptr)
sane_get_devices() ...
... sane_get_devices() -> SANE_Status Success
sane_exit()
listening on 127.0.0.1:8090
listening on [::1]:8090
listening on [fe80::1]:8090
I had my ScanSnap ix500 set up and working locally using SANE. I briefly had it working in Apple Image Capture with AirSane, but now it isn't working anymore, either locally in simple-scan
or over AirSane. There's no error message in Apple Image Capture (it just sits indefinitely), but in localhost:8090 I get the error Error: Aborted: ResourcesAreNotReady
when I try to run a scan.
Somewhat strangely, the original ScanSnap device ("FUJITSU ScanSNAP ix500") disappeared from simple-scan
and was replaced with a new one (three new ones, in fact), titled "ESCL FUJITSU ScanSnap ix500", and on localhost:8090
there are two identically named scanners, one of which is a dead link. Incidentally, clicking the dead link just caused airsaned
to SEGFAULT:
$ sudo -u saned airsaned --debug=true --access-log=-
reading device options from '/etc/airsane/options.conf'
enumerating local devices...
sane_init(nullptr, nullptr)
sane_get_devices() ...
... sane_get_devices() -> SANE_Status Success
sane_exit()
found: fujitsu:ScanSnap iX500:1200753 (FUJITSU ScanSnap iX500)
sane_init(nullptr, nullptr)
sane_open(fujitsu:ScanSnap iX500:1200753) -> 0x7f99a81501c0
[source] := "ADF Duplex" -> reload options
sane_close(0x7f99a81501c0)
sane_exit()
stable unique name: fujitsu:FUJITSU ScanSnap iX500:1
uuid: 643027f6-f4aa-540e-beb3-2b8dd8266466
published as 'FUJITSU ScanSnap iX500'
found: escl:ScanSnap iX500:1200753 (FUJITSU ScanSnap iX500)
sane_init(nullptr, nullptr)
sane_open(escl:ScanSnap iX500:1200753) -> SANE_Status Invalid argument
sane_exit()
error: failed to open device
listening on 127.0.0.1:8090
listening on 192.168.4.34:8090
listening on [::1]:8090
listening on [fd10:e07c:45dd:1:d87:f4a4:20d7:b2f7]:8090
listening on [fd10:e07c:45dd:1:eeda:2a26:b3f4:3fcc]:8090
listening on [fe80::1599:88b7:1612:3a0e]:8090
127.0.0.1 - - [20/Dec/2020:22:15:39 -0500] "GET /" 200 604 "" "Mozilla/5.0(X11;Ubuntu;Linuxx86_64;rv:84.0)Gecko/20100101Firefox/84.0"
127.0.0.1 - - [20/Dec/2020:22:15:39 -0500] " " 200 -85 "" ""
Segmentation fault
Any idea what's happening here?
When open Capture Application on MacOS Catalina 10.15, selecting "sharing" scanner (this scanner connecting to Synology NAS and shares by AirSane application running on NAS) and trying to receive preview picture, scanner start to scan but at the end of scanning it shows that connection to shared scanner is lost and it does not appear in "shared" list. In NAS AirSane application appears as stopped and needs to be restarted. This continues every time when trying to scan from Capture Application.
Hi,
while AIC scanned the preview, I pressed the cancel button. After this, I couldn't scan anymore. I had to power-off and power-on my scanner.
I own a Brother DCP-1510 which uses the brother4 SANE driver (deb package version 0.4.9-1), running on Ubuntu 20.04.
The log shows which indicates that airsaned "hangs" at sane_open(brother4:bus1;dev2)
document format requested: image/jpeg
document format used: image/png
using color gamma of 0.555555
sane_init(nullptr, nullptr)
sane_open(brother4:bus1;dev2) -> 0x7fd4c001cbc0
[mode] := "24bit Color" -> reload options
[source] := "FlatBed"
[resolution] := 100dpi
[tl-x] := 0mm
[tl-y] := 0mm
[br-x] := 212mm
[br-y] := 356mm
sane_start(0x7fd4c001cbc0) with options:
[br-x] = 211.881mm
[br-y] = 355.567mm
[mode] = "24bit Color"
[resolution] = 100dpi
[source] = "FlatBed"
[tl-x] = 0mm
[tl-y] = 0mm
sane_cancel(0x7fd4c001cbc0) -> pressed cancel during preview scan
sane_close(0x7fd4c001cbc0)
sane_exit()
document format requested: image/jpeg
document format used: image/png
using color gamma of 0.555555
sane_init(nullptr, nullptr)
sane_open(brother4:bus1;dev2)
Thanks in advance for having a look.
Best regards,
meiser
I would like to add @ $hostname
after the shared Bonjour name (same behavior as CUPS/mDNS). For example:
I looked around file zeroconf/mdnspublisher.cpp
but not sure where to inject the additional string. This is not super important but a good-to-have feature. This additional hostname can also merge with CUPS when played right for multifunction printers.
Thanks again.
To whom it may concern:
I have been getting this error message with AirSANE:
stable unique name: genesys:Canon LiDE 110:1
uuid: d8945d57-e60e-5593-9694-3343e3b55408
/etc/airsane/options.conf: regex 'genesys:.*' matches device name 'genesys:libusb:001:003'
published as 'Canon LiDE 110 #2'
server finished with error status -1, last error was 98: Address already in use
Can some please help with this?
I have tried Googling for a solution, but I cannot find any problem that is similar to the one I am having. I appreciate any help or guidance.
I have Epson L3150 scanner and I struggle to make it network shared. I can use scanimage to scan manually but couldn't get AirSane working because of Segmentation fault. Scanner is discoverable and web interface returns valid options. I managed to access scanner with SwingSane, scan starts but images are empty. scanimage
works perfectly fine
Looks like sane's backends do not support epsonscan2 at all?
enumerating local devices...
sane_init(nullptr, nullptr)
sane_get_devices() ...
... sane_get_devices() -> SANE_Status Success
sane_exit()
found: epsonscan2:L3150 Series:esci2:usb:ES016E:4419 (EPSON L3150 Series)
sane_init(nullptr, nullptr)
sane_open(epsonscan2:L3150 Series:esci2:usb:ES016E:4419) -> 0x7f806c038ab0
[source] := "Flatbed" -> reload options
sane_close(0x7f806c038ab0)
sane_exit()
stable unique name: epsonscan2:EPSON L3150 Series:1
uuid: d26d9bff-4dce-529a-b7a4-ec731da1002e
published as 'EPSON L3150 Series'
listening on 127.0.0.1:8090
listening on 192.168.88.240:8090
listening on 10.8.0.6:8090
listening on [::1]:8090
listening on [fe80::e23f:49ff:fe77:e9b3]:8090
listening on [fe80::79a8:a404:fba6:e16]:8090
[fe80::cf0:c3f2:f3c4:9ae7] - - [30/Oct/2020:05:28:01 +0300] "GET /eSCL/ScannerCapabilities" 200 2556 "" "AirScanScanner/58CFNetwork/1206Darwin/20.1.0"
[fe80::cf0:c3f2:f3c4:9ae7] - - [30/Oct/2020:05:28:01 +0300] "GET /eSCL/ScannerIcon" 200 48698 "" "AirScanScanner/58CFNetwork/1206Darwin/20.1.0"
[fe80::cf0:c3f2:f3c4:9ae7] - - [30/Oct/2020:05:28:02 +0300] "GET /eSCL/ScannerStatus" 200 364 "" "AirScanScanner/58CFNetwork/1206Darwin/20.1.0"
document format requested: image/jpeg
document format used: image/png
using color gamma of 0.555555
[fe80::cf0:c3f2:f3c4:9ae7] - - [30/Oct/2020:05:28:02 +0300] "POST /eSCL/ScanJobs" 201 0 "" "AirScanScanner/58CFNetwork/1206Darwin/20.1.0"
[fe80::cf0:c3f2:f3c4:9ae7] - - [30/Oct/2020:05:28:02 +0300] "GET /eSCL/ScannerStatus" 200 795 "" "AirScanScanner/58CFNetwork/1206Darwin/20.1.0"
sane_init(nullptr, nullptr)
sane_open(epsonscan2:L3150 Series:esci2:usb:ES016E:4419) -> 0x7f8064025a80
[mode] := "Color"
[source] := "Flatbed" -> reload options
[resolution] := 50dpi -> reload options
[tl-x] := 0mm
[tl-y] := 0mm
[br-x] := 216mm
[br-y] := 297mm
sane_start(0x7f8064025a80) with options:
[br-x] = 216mm
[br-y] = 297mm
[brightness] = 0
[contrast] = 0
[dropout] = "None"
[gamma-correction] = 2.2
[image-count] = 0
[long-paper-mode] = 0
[mode] = "Color"
[remove-background] = "None"
[resolution] = 200dpi
[rotate] = "0 degrees"
[scan-area] = "Manual"
[source] = "Flatbed"
[threshold] = 128
[tl-x] = 0mm
[tl-y] = 0mm
[transfer-format] = Segmentation fault
sudo -u saned scanimage -d 'epsonscan2:L3150 Series:esci2:usb:ES016E:4419' -A
returns
All options specific to device `epsonscan2:L3150 Series:esci2:usb:ES016E:4419':
General:
--mode Color|Grayscale|Monochrome [Color]
Selects the scan mode (e.g., lineart, monochrome, or color).
--source Flatbed [Flatbed]
Selects the scan source (such as a document-feeder).
--duplex[=(yes|no)] [inactive]
Selects the ADF mode (yes:duplex/no:simplex)
--resolution 50..1200dpi (in steps of 1) [200]
Sets the resolution of the scanned image.
--x-resolution 50..1200dpi (in steps of 1) [inactive]
Sets the horizontal resolution of the scanned image.
--y-resolution 50..1200dpi (in steps of 1) [inactive]
Sets the vertical resolution of the scanned image.
--scan-area Letter|A4|A5|A5 (Landscape)|A6|A6 (Landscape)|A8|A8 (Landscape)|B5 [JIS]|Postcard|Postcard (Landscape)|PlasticCard|Maximum|Manual [Manual]
Select an area to scan based on well-known media sizes.
Geometry:
-l 0..215.9mm [0]
Top-left x position of scan area.
-t 0..297.18mm [0]
Top-left y position of scan area.
-x 0..215.9mm [215.9]
Width of scan-area.
-y 0..297.18mm [297.18]
Height of scan-area.
Enhancement:
--deskew[=(yes|no)] [inactive]
Rotate image so it appears upright.
--dropout None|Red|Blue|Green [None]
Selects the dropout.
--rotate 0 degrees|90 degrees|180 degrees|270 degrees|Auto [0 degrees]
Rotate
--skip-blankpages 0..100 (in steps of 1) [inactive]
Skip Blank Pages Settings.
--brightness -100..100 (in steps of 1) [0]
Controls the brightness of the acquired image.
--contrast -100..100 (in steps of 1) [0]
Controls the contrast of the acquired image.
--threshold 0..255 [128]
Select minimum-brightness to get a white point
Other:
--double-feed-detection None [inactive]
Detection Double Feed
--gamma-correction 0.5..3 (in steps of 0.0999908) [2.2]
Selects the gamma correction value from a list of pre-defined devices
or the user defined table, which can be downloaded to the scanner
--image-count 1..999 (in steps of 1) [0]
Image Count
--long-paper-mode[=(yes|no)] [no]
Select this mode if you want to scan documents longer than what the
ADF would normally support. Please note that it only supports automatic
detection of the document height.
I have set up AirSane server on Debian Buster/Arm64 and can download scanned images on http://:8090. On MacOS Catalina side, the scanner pops up in Image Capture and also shown up as Bonjour Scanner. However it throws the error "Failed to open a connection to the device (-21345)".
I then tried to get some log on the server end as instructed:
sudo -u saned airsaned --debug=true --access-log=-
It shows nothing when I am connecting with Image Capture. However it can tell me when I access the web interface. I'm wondering if my avahi is not set up properly?
Hey there,
first of all thank you very much for your efforts for this project :)
I am currently trying to set up my Raspberry Pi 3b+ to act as a scan server.
The scanner is found on my MacBook and everything seems to run smoothly.
Unfortunately as soon as I hit "scan" I get a segfault on the server:
> airsaned --debug=true
enumerating local devices...
sane_init(nullptr, nullptr)
sane_exit()
found: pixma:04A91748_17209A (CANON Canon PIXMA MG5100)
sane_init(nullptr, nullptr)
sane_open(pixma:04A91748_17209A) -> 0x7544ef28
[source] := "Automatic Document Feeder" -> Invalid argument
[source] := "Flatbed"
sane_close(0x7544ef28)
sane_exit()
uuid: 9d226c1e-7148-9ccf-9a2b-5607a4c7ad44
published as 'CANON Canon PIXMA MG5100'
listening on 127.0.0.1:8090
listening on 192.168.2.183:8090
listening on ::1:8090
listening on fe80::746f:e962:5761:4170:8090
sane_init(nullptr, nullptr)
sane_open(pixma:04A91748_17209A) -> 0x72d006f0
[mode] := "Color" -> reload options
[source] := "Flatbed"
[resolution] := 300dpi
[tl-x] := 0mm
[tl-y] := 0mm
[br-x] := 210mm
[br-y] := 297mm
sane_start(0x72d006f0) with options:
[br-x] = 210mm
[br-y] = 297mm
[button-1] = 0
[button-2] = 0
[button-controlled] = 0
[button-update] = n/a
[custom-gamma] = 1
[gamma] = 2.2
[gamma-table] = segmentation fault
I am using the Canon MG5150 multifunctional printer as a scanner and am running the latest Raspbian: "Linux raspberrypi 4.14.34-v7+ #1110 SMP Mon Apr 16 15:18:51 BST 2018 armv7l GNU/Linux".
If I use the "test" scanner on saned it works, so this might be related to my very scanner model :( The "test" scanner doesn't seem to offer a gamma table though.
I use saned in parallel to access the scanner from my Linux machine and this works without problems, so it's likely not sane-related.
Let me now if you need more info!
Hello,
I tried to use your program for making my scanner in my Mac but I cannot see my scanner in add printer scanner settings page. After a little research I saw my scanner won't add in avahi service. I tried to use web client and I found my scanner as CX7400 in web and can make scan file, preview file. I look tags in git hub for find latest working version but as I see you didn't use that option can you help me?
My system Debian buster and updated latest versions in docker.
2021-01-02 11:23:23,203 DEBG 'saned' stdout output:
sane_init(nullptr, nullptr)
2021-01-02 11:23:23,204 DEBG 'saned' stdout output:
sane_open(epson2:libusb:002:012) ->
2021-01-02 11:23:23,259 DEBG 'saned' stdout output:
0x7f11b8038e00
2021-01-02 11:23:23,273 DEBG 'saned' stdout output:
sane_close(0x7f11b8038e00)
2021-01-02 11:23:23,277 DEBG 'saned' stdout output:
sane_exit()
2021-01-02 11:23:23,277 DEBG 'saned' stdout output:
stable unique name: epson2:Epson CX7400:1
uuid: d956892e-4077-52a9-bc2d-fba035adaa30
2021-01-02 11:23:23,763 DEBG 'saned' stdout output:
getaddrinfo() error: Name or service not known
2021-01-02 11:23:23,764 DEBG 'saned' stdout output:
airsaned: entrygroup.c:108: avahi_entry_group_new: Assertion 'client' failed.
2021-01-02 11:23:23,765 DEBG fd 15 closed, stopped monitoring <POutputDispatcher at 139696539178048 for <Subprocess at 139696539578024 with name saned in state RUNNING> (stdout)>
2021-01-02 11:23:23,765 INFO exited: saned (terminated by SIGABRT; not expected)
2021-01-02 11:23:23,765 DEBG received SIGCLD indicating a child quit
2021-01-02 11:23:24,768 INFO spawned: 'saned' with pid 21
2021-01-02 11:23:24,809 DEBG 'saned' stdout output:
reading device options from '/etc/airsane/options.conf'
enumerating devices...
2021-01-02 11:23:24,810 DEBG 'saned' stdout output:
sane_init(nullptr, nullptr)
sane_get_devices() ...
2021-01-02 11:23:25,811 INFO success: saned entered RUNNING state, process has stayed up for > than 1 seconds (startsecs)
2021-01-02 11:23:34,400 DEBG 'saned' stdout output:
... sane_get_devices() -> SANE_Status Success
sane_exit()
2021-01-02 11:23:34,404 DEBG 'saned' stdout output:
found: epson2:libusb:002:012 (Epson CX7400)
2021-01-02 11:23:34,404 DEBG 'saned' stdout output:
sane_init(nullptr, nullptr)
2021-01-02 11:23:34,405 DEBG 'saned' stdout output:
sane_open(epson2:libusb:002:012) ->
2021-01-02 11:23:34,425 DEBG 'saned' stdout output:
0x7f96240144d0
2021-01-02 11:23:34,426 DEBG 'saned' stdout output:
sane_close(0x7f96240144d0)
2021-01-02 11:23:34,431 DEBG 'saned' stdout output:
sane_exit()
2021-01-02 11:23:34,432 DEBG 'saned' stdout output:
stable unique name: epson2:Epson CX7400:1
uuid: d956892e-4077-52a9-bc2d-fba035adaa30
2021-01-02 11:23:34,434 DEBG 'saned' stdout output:
getaddrinfo() error: Name or service not known
2021-01-02 11:23:34,434 DEBG 'saned' stdout output:
Avahi error when adding service: Bad state (-2)
2021-01-02 11:23:34,434 DEBG 'saned' stdout output:
listening on 127.0.0.1:8090
listening on 192.168.1.106:8090
Compiling on Arch Linux fails because of libpng not being found.
/home/rosi/AirSane/imageformats/pngencoder.cpp:20:10: fatal error: libpng/png.h: No such file or directory
#include <libpng/png.h>
^~~~~~~~~~~~~~
compilation terminated.
Turns out libpng is available as 1.16 and 1.12 Version in two different packages and put in renamed subfolders to allow for parallel installation
/usr/include/libpng16/
/usr/include/libpng16/png.h
So creating a symlink fixed my build problem:
ln -s /usr/include/libpng16/ /usr/include/libpng/
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.