SULDR Forums Supported Printers Printing Questions Scanning Questions General Questions Samsung Installer

Author Topic: Scan to PC in Linux (Development)  (Read 40129 times)

Secret

  • Testing the water
  • **
  • Posts: 2
    • View Profile
  • Linux Distribution: debian stable
  • Printer: CLX-4195N
Re: Scan to PC in Linux (Development)
« Reply #60 on: March 14, 2014, 09:20:19 AM »
03-14-14 15:00:20 stdout       INFO     Newly registered server 'Storage-Blue' with UniqueID '5cbcd3015823ba0a' has got
03-14-14 15:00:20 stdout       INFO         InstanceID '4'.
03-14-14 15:00:20 stdout       INFO     At program termination unregistering server with:
03-14-14 15:00:20 stdout       INFO         <function unregisterServer at 0x200e770>
03-14-14 15:00:20 stdout       INFO     Init SANE ...
03-14-14 15:00:20 stdout       INFO     Connecting to scanner ...
03-14-14 15:00:24 stdout       INFO     Connected to scanner.
03-14-14 15:00:24 stdout       INFO     Waiting for scan job ...
03-14-14 15:02:13 stdout       INFO         Got it!
03-14-14 15:02:13 stdout       INFO     Waiting for user selection ...
03-14-14 15:02:23 stdout       INFO         Got it!
03-14-14 15:02:23 root         ERROR    Something awful happened! Waiting 10 seconds before trying again.
Traceback (most recent call last):
  File "/usr/bin/samsungScannerServer.py", line 1502, in <module>
    scannWorker()
  File "/usr/bin/samsungScannerServer.py", line 375, in scannWorker
    user_selection = queryUserOptions()
  File "/usr/bin/samsungScannerServer.py", line 292, in queryUserOptions
    user_options['color']=root.find('Color').attrib["Value"]
AttributeError: 'NoneType' object has no attribute 'attrib'
03-14-14 15:02:33 stdout       INFO     Waiting for scan job ...


There is no "Color" in the answer of queryUserOptions().
The Answer is: <?xml version="1.0" encoding="UTF-8"?><root><S2PC_Select><AppIndex Value="3"/><FileFormat Value="FORMAT_JPEG"/><FileName Value=""/></S2PC_Select></root>
The printer seems to only send these 3 attributes, no matter if i change preset values on the panel or not.
Using CLX-4195N with FW V4.00.01.30 and current repository version of samsungScannerServer.

Secret

  • Testing the water
  • **
  • Posts: 2
    • View Profile
  • Linux Distribution: debian stable
  • Printer: CLX-4195N
Re: Scan to PC in Linux (Development)
« Reply #61 on: March 14, 2014, 11:33:49 AM »
03-14-14 17:26:38 stdout       INFO     MODE: Color - 16 Million Colors
03-14-14 17:26:38 stdout       INFO     DPI: 300
03-14-14 17:26:38 stdout       INFO     SIZE: A4
03-14-14 17:26:38 stdout       INFO     Scanning ...
03-14-14 17:26:39 stderr       INFO     Whoops! Problem scanning (maybe version Samsung device driver >= 4.1 and multi-scan?):
03-14-14 17:26:39 stderr       INFO     Traceback (most recent call last):
03-14-14 17:26:39 stderr       INFO       File "/usr/bin/samsungScannerServer.py", line 501, in scanAndSave
03-14-14 17:26:39 stderr       INFO         for im in imgs:
03-14-14 17:26:39 stderr       INFO       File "/usr/lib/python2.7/dist-packages/sane.py", line 113, in next
03-14-14 17:26:39 stderr       INFO         raise
03-14-14 17:26:39 stderr       INFO     TypeError: exceptions must be old-style classes or derived from BaseException, not str

Exceptions from sane.py seem not to be cought correctly there.

nachokb

  • Testing the water
  • **
  • Posts: 1
    • View Profile
  • Linux Distribution: Ubuntu GNOME 14.04
  • Printer: CLX-3305w
Re: Scan to PC in Linux (Development)
« Reply #62 on: May 08, 2014, 08:41:45 AM »
Guys, thanks a lot.

I can confirm I just installed everything from the repo and it all worked smoothly.

This is on Ubuntu GNOME 14.04 + GNOME 3.12 (Staging PPA).

Thanks!

dekkertje

  • Testing the water
  • **
  • Posts: 3
    • View Profile
  • Linux Distribution: Medion
  • Printer: CLX3300
Re: Scan to PC in Linux (Development)
« Reply #63 on: July 07, 2014, 02:44:51 PM »
Hello Everyone,

I saw this document and i'm very interessed in this.
But can anyone tell me how to install SANE on a linux device.
I Can't figure it out in the README.linux.

Thanks a lot.

Melis Dekker

bchemnet

  • Administrator
  • *****
  • Posts: 462
    • View Profile
  • Linux Distribution: Debian Testing
  • Printer: none
Re: Scan to PC in Linux (Development)
« Reply #64 on: July 24, 2014, 07:17:18 AM »
SANE is probably available as a package (such as "libsane") through your package manager, if by "device" you mean some sort of computer.

If you mean something like an Android device, I'm not sure whether or not SANE works.

dekkertje

  • Testing the water
  • **
  • Posts: 3
    • View Profile
  • Linux Distribution: Medion
  • Printer: CLX3300
Re: Scan to PC in Linux (Development)
« Reply #65 on: July 25, 2014, 12:59:57 AM »
Hello bchemnet.

Thank you for your reply.
It's a Medion Nas Server. It's accessable via SSH Shell. Can you prefer a good package manager?
I use uwsiteloader, but can't find SANE in it. If you know one, please can you tell me where to find it, and a little help with how to use it?

Thanks a lot.

bchemnet

  • Administrator
  • *****
  • Posts: 462
    • View Profile
  • Linux Distribution: Debian Testing
  • Printer: none
Re: Scan to PC in Linux (Development)
« Reply #66 on: July 26, 2014, 06:57:06 AM »
As far as I can tell, nobody is providing a sane-backends or equivalent package for that type of device.  You might be able to compile it from source, but I have no personal experience that would be helpful to you.

dekkertje

  • Testing the water
  • **
  • Posts: 3
    • View Profile
  • Linux Distribution: Medion
  • Printer: CLX3300
Re: Scan to PC in Linux (Development)
« Reply #67 on: May 31, 2015, 05:12:21 AM »
Hi Guys,

I have a synology nas server. And i would like to have my samsung clx 3305 scanner working on it. I found out i have to use the xerox mfp driver.

But is there someone that can me provide a step by step manual to install the NETWORK scanner on the synology.

Thanks a lot.
Melis

Metafa666

  • Testing the water
  • **
  • Posts: 1
    • View Profile
  • Linux Distribution: Kubuntu
  • Printer: XPress 1860FW
Re: Scan to PC in Linux (Development)
« Reply #68 on: October 01, 2015, 11:24:26 AM »
Hello,

I got today my new Samsung Multi-Printer Xpress 1860FW. I installed the Server from the packages here using Kubuntu Raring, but I get the following error:

./samsungScannerServer.py
Using circumvention for PDF save because you use pillow 2.0.0
INFO:stdout:###########################
INFO:stdout:# Initiating version 0.4.5
INFO:stdout:###########################
INFO:stdout:At program termination joining log listener process with:
INFO:stdout:    <function exitListener at 0x93e517c>
INFO:stdout:Used '/etc/samsungScannerServer.conf' as configuration file.
INFO:stdout:Below is what was configured with it.
INFO:stdout:CONFIG: ENABLED_SERVER=True
INFO:stdout:CONFIG: MODIFIED_SANE=False
INFO:stdout:CONFIG: PROXY_DEBUGLEVEL=1
INFO:stdout:CONFIG: SCANNER_CACHING=True
INFO:stdout:CONFIG: SCANNER_SANE_NAME='smfp:net;192.168.0.109'
INFO:stdout:CONFIG: SERVER_NAME='adweso-laptop'
INFO:stdout:CONFIG: OWNER_UID=1000
INFO:stdout:CONFIG: OWNER='adweso'
INFO:stdout:CONFIG: OUTPUT_PREFIX='${homedir}/Scans/SCAN_${date}__${uid}'
INFO:stdout:CONFIG: def contrastFilter(im):
INFO:stdout:CONFIG:     return ImageOps.autocontrast(im,10)
INFO:stdout:CONFIG: OPTIONS=[
INFO:stdout:CONFIG:     {'name':'Gray-M_PDF-300' ,'color':'COLOR_GRAY','resolution':'DPI_300','format':'FORMAT_M_PDF','size':'SIZE_A4','output':OUTPUT_PREFIX, 'filters':[]},
INFO:stdout:CONFIG:     {'name':'Color-M_PDF-300','color':'COLOR_TRUE','resolution':'DPI_300','format':'FORMAT_M_PDF','size':'SIZE_A4','output':OUTPUT_PREFIX, 'filters':[]},
INFO:stdout:CONFIG:     {'name':'Gray-JPEG-300'  ,'color':'COLOR_GRAY','resolution':'DPI_300','format':'FORMAT_JPEG' ,'size':'SIZE_A4','output':OUTPUT_PREFIX, 'filters':[]},
INFO:stdout:CONFIG:     {'name':'Color-JPEG-300' ,'color':'COLOR_TRUE','resolution':'DPI_300','format':'FORMAT_JPEG' ,'size':'SIZE_A4','output':OUTPUT_PREFIX, 'filters':[]},
INFO:stdout:CONFIG:     {'name':'Gray-M_PDF-75'  ,'color':'COLOR_GRAY','resolution':'DPI_75' ,'format':'FORMAT_M_PDF','size':'SIZE_A4','output':OUTPUT_PREFIX, 'filters':[]},
INFO:stdout:CONFIG:     {'name':'Gray-S_PDF-75'  ,'color':'COLOR_GRAY','resolution':'DPI_75' ,'format':'FORMAT_S_PDF','size':'SIZE_A4','output':OUTPUT_PREFIX, 'filters':[]},
INFO:stdout:CONFIG: ]
INFO:stdout:CONFIG: MODES2SANE={'COLOR_MONO':'Black and White - Line Art', 'COLOR_GRAY':'Grayscale - 256 Levels','COLOR_TRUE':'Color - 16 Million Colors'}
INFO:stdout:CONFIG: EXTENSIONS={'FORMAT_S_PDF':'pdf','FORMAT_M_PDF':'pdf','FORMAT_PDF':'pdf','FORMAT_JPEG':'jpg','FORMAT_S_TIFF':'tiff','FORMAT_M_TIFF':'tiff'}
INFO:stdout:CONFIG: LOG_NAME="/var/log/samsungScannerServer.log"
INFO:stdout:CONFIG: LOG_MAXBYTES=100000
INFO:stdout:CONFIG: LOG_BACKUPCOUNT=1
INFO:stdout:The following was automatically configured.
INFO:stdout:AUTOCONFIG: HOME_DIR = '/home/adweso'
INFO:stdout:AUTOCONFIG: SCANNER_IP = '192.168.0.109'
INFO:stdout:Newly registered server 'adweso-laptop' with UniqueID '2176ad6d8bafe09e' has got
INFO:stdout:    InstanceID '4'.
INFO:stdout:At program termination unregistering server with:
INFO:stdout:    <function unregisterServer at 0x93ca304>
INFO:stdout:Init SANE ...
INFO:stdout:Connecting to scanner ...
INFO:stderr:Error while trying to configure scanning options:
INFO:stderr:    ValueError: SIZE2SANE dictionary must not be empty!
INFO:stderr:You should manually configure SIZE2SANE in '/etc/samsungScannerServer.conf'.
INFO:stdout:Unregistered server 'adweso-laptop' with UniqueID '2176ad6d8bafe09e'.

I uncommented one of the two SIZE2SANE lines in the config file, but the result is the same ?

scanimage -help gives:

Options specific to device `smfp:usb;04e8;346b;0796BJEG700143V':                                                                                                                                         
    --preview[=(yes|no)] [no]                                                                                                                                                                             
        Request a preview-quality scan                                                                                                                                                                   
  Image Quality:                                                                                                                                                                                         
    --mode Color - 16 Million Colors|Grayscale - 256 Levels|Black and White - Halftone|Black and White - Line Art [Color - 16 Million Colors]
        Set the color composition mode of the scanned image
    --resolution 75|100|150|200|300|600|1200dpi [300]
        Set the resolution of the scanned image
  Scan Area:
    --doc-source Flatbed|ADF Simplex [Flatbed]
        Select source of the document to be scanned
    --page-format Statement|Statement(Rotated)|A5|A5(Rotated)|B5(JIS)|Executive|A4|Letter|Custom [A4]
        Set the paper format of the scanned page
    -l 0..215mm

        Set left position of the scan area
    -t 0..297mm

        Set top position of the scan area
    -x 0..215mm [210]
        Width of scan-area.
    -y 0..297mm [297]
        Height of scan-area.

How I can fix this ?

best regards


Andy
« Last Edit: October 01, 2015, 11:32:55 AM by Metafa666 »

Hec

  • Testing the water
  • **
  • Posts: 1
    • View Profile
  • Linux Distribution: Ubuntu server 14.04 LTS
  • Printer: Xpress C1860 FW
Re: Scan to PC in Linux (Development)
« Reply #69 on: February 27, 2016, 07:50:30 PM »
Hi guys,

First of all, thank you for this awesome work. Unfortunately it doesn't work with my printer c1860 series, and I suspect a tiny detail to be the source of this trouble.

Here is what show the logs :

Traceback (most recent call last):
  File "/usr/bin/samsungScannerServer.py", line 1439, in <module>
    SERVER_INSTANCE_ID = registerServer()
  File "/usr/bin/samsungScannerServer.py", line 208, in registerServer
    raise NameError("Error registering server: "+result)
NameError: Error registering server: <HTML>
<HEAD>
</HEAD>

<BODY BGCOLOR="#FFFFFF" TEXT="#000000">
<CENTER>
<FONT SIZE="+2" COLOR="#FFFFFF" ALIGN="Center">
</FONT>
<B>The document has moved</B><BR>
<B></B>
</BODY>

</HTML>


I am not at all into programming but I had a look into /usr/bin/samsungScannerServer.py
On line 201 (v. 0.4.5) I saw something strange "c:\IDS.XML" which looks like a Windows path to me (but again I am not a programmer, and this may have non incidence at all).

Anyway, I don't think this is the problem as I tried to debug on a machine running Windows.

1) First /IDS/CAP.XML is called and received from the printer
2) then an exchange is made from the GNU machine towards the printer with /IDS/ScanFaxToPC.cgi

So basically, this is all good.


So I wanted to debug the exchanges on GNU/Linux with ssldump on port 443 as https is forced by the printer either through the Samsung programs on Windows or through a simple browser. Surprise, no packets were intercepted. With tcpdump I discovered only http exchanges are made between my GNU box and the printer.

So I think the problem lays here. For registration, the printer forces the client to use https while the script keeps calling on http as it is unable to switch. I have no idea how to change that.

EDIT :
Eureka !! I changed two lines in /usr/bin/samsungScannerServer.py :

Line 154: h = http_client.HTTPSConnection(host, 443)
and line 388: capxmlfile = urllib2.urlopen('https://%s/IDS/CAP.XML' % REAL_SCANNER_IP)

It's not elegant but now registration works.

I then encountered the problem described by Metafa666. So I went to /etc/samsungScannerServer.conf and uncommented the first line. No more SIZE2SANE error.

But unfortunately this is the end of the road for me, as when I try to scan to my Ubuntu server I encounter an error previously exposed by Secret :

02-28-16 04:26:05 root         ERROR    Something awful happened! Waiting 10 seconds before trying again.
Traceback (most recent call last):
  File "/usr/bin/samsungScannerServer.py", line 1504, in <module>
    scannWorker()
  File "/usr/bin/samsungScannerServer.py", line 377, in scannWorker
    user_selection = queryUserOptions()
  File "/usr/bin/samsungScannerServer.py", line 295, in queryUserOptions
    user_options['color']=root.find('Color').attrib["Value"]
AttributeError: 'NoneType' object has no attribute 'attrib'

...

02-28-16 04:37:18 root         ERROR    Something awful happened! Waiting 10 seconds before trying again.
Traceback (most recent call last):
  File "/usr/bin/samsungScannerServer.py", line 1504, in <module>
    scannWorker()
  File "/usr/bin/samsungScannerServer.py", line 347, in scannWorker
    while (queryPrinterScanStatus(SERVER_INSTANCE_ID) != 1):
  File "/usr/bin/samsungScannerServer.py", line 335, in queryPrinterScanStatus
    "Error message: %(e)s.") % locals())
Exception: Could not query printer scan status.
    Result was '[(ObjectName(1.3.6.1.4.1.236.11.5.11.81.11.7.2.1.2.6), Integer32(-1))]'.
    Error message: Integer32 instance has no attribute '__getitem__'.
« Last Edit: February 27, 2016, 09:42:14 PM by Hec »

divx118

  • Testing the water
  • **
  • Posts: 1
    • View Profile
  • Linux Distribution: Ubuntu Xenial
  • Printer: CLX3305FW
Re: Scan to PC in Linux (Development)
« Reply #70 on: April 25, 2016, 01:19:34 PM »
Thanks all for creating this nice tool. I have a CLX3305FW which works great, although I needed to set snmp access to read/write for being able to use MODIFIED_SANE=TRUE. I use ubuntu 16.04 (Xenial) as server. Below the Firmware version of my printer.

Main Firmware Version
V3.00.02.17 DEC-20-2014
Network Firmware Version
V6.01.00
IP Core Software Version
22.01.NW Stack Version
Engine Firmware Version
V1.00.20 2014-07-09
PCL5E Firmware Version
PCL5Ce 6.79.05 07-10-2014
PCL6 Firmware Version
PCL6 7.44.03 08-29-2012
PostScript Firmware Version
4.02.01.01.00.94.01 03-07-2014
SPL Firmware Version
SPL-C 5.59.02 02-24-2014
PDF Firmware Version
4.02.01.01.00.94.01 03-07-2014

 

Repository Information Legal Contact Alternative Drivers