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

Menu

Show posts

This section allows you to view all posts made by this member. Note that you can only see posts made in areas you currently have access to.

Show posts Menu

Messages - frankentux

#1
That fixed it! Here were the steps:

(1) def extractIPs(fileContent):
    pattern = r"((25[0-5]|2[0-4][0-9]|[01]?[0-9][0-9]?)([ (\[]?(\.|dot)[ )\]]?(25[0-5]|2[0-4][0-9]|[01]?[0-9][0-9]?)){3})"
    ips = [each[0] for each in re.findall(pattern, fileContent)]   
    for item in ips:
        location = ips.index(item)
        ip = re.sub("[ ()\[\]]", "", item)
        ip = re.sub("dot", ".", ip)
        ips.remove(item)
        ips.insert(location, ip)
    return ips
#SCANNER_IP=SCANNER_SANE_NAME.split(' ')[-1]
try:
  SCANNER_IP = extractIPs(SCANNER_SANE_NAME)[0]
except IndexError: # regex failed?
  sys.exit(1)

(2) change the conf file like you said

Would it not make more sense to define SIZE2SANE in the python script rather than in the conf - depending on the sane scanner id, it could be set dynamically?
#2
This is the output of scanimage --help -d 'smfp:net;192.168.178.25'

Options specific to device `smfp:net;192.168.178.25':
    --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..216mm

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

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

    Trying the scan in python now (was there a reason you recommended ipython?)
#3
The package is now working (ish) with some manual fixes:
in force_multipart() I force host = '192.168.178.25' (the ip of the scanner)
in queryPrinterScanStatus() I force SCANNER_IP to '192.168.178.25

The reason for  the first one is that the script dies and complains about a non-numeric host (it accepts the ip address). scanimage -L returns something like snmp:net;192.168.178.25 and this chokes the h = http_client.HTTPConnection(host) - which expects an ip, not a string (I think).

The  reason for the second one is the same as the first except that it is now SCANNER_IP which gets the string returned from scanimage -L - that should also be an ip.

Once I manually force those two variables to ip addresses, I get to choose the options on the scanner itself. Those options are apparently successfully transported (and are displayed by the script). However, once initScan() is called, everything goes pear shaped. I get:

INFO:stderr:    imgs, s = initScan()
INFO:stderr:  File "samsungScannerServer.py", line 451, in initScan
INFO:stderr:    s.page_format = size #t-k: bugfix page_format is correct (not page-format)
INFO:stderr:  File "/usr/lib64/python2.7/site-packages/sane.py", line 183, in __setattr__
INFO:stderr:    self.last_opt = dev.set_option(opt.index, value)
INFO:stderr:_sane.error: Invalid argument

When I run scanimage -d 'smfp:net;192.168.178.25' > out.image, it works and I get an image in out.image - thus I don't think that this is related to the samsung uld backend but rather to how the script is calling the sane scanimage function. Here is the system information for sane:

sane-backends-autoconfig-1.0.23-5.1.1.x86_64
sane-backends-1.0.23-5.1.1.x86_64
python-imaging-sane-1.1.7-34.1.x86_64

I'm using the ULD version contained in ULD_Linux_V1.00.06.tar.gz

Any ideas?

#4
Hi. I built a package for openSUSE (have'nt had a chance to test it yet until I get home). It is available here:
https://build.opensuse.org/package/show?project=home%3Ababelworx&package=python-samsungScannerServer

I still have to do some work with systemd.

What license is this software distributed under? Would it be possible to put a license file in the package?
Repository Information Legal Contact Alternative Drivers