DSM-G600, DNS-3xx and NSA-220 Hack Forum

Unfortunately no one can be told what fun_plug is - you have to see it for yourself.

You are not logged in.

Announcement

#1 2009-10-07 02:44:33

sparks
Member
From: Germany
Registered: 2009-06-26
Posts: 11

Scanner on USB hub: device found but port already in use

I'm a linux noob, but have been following the advice here to get an Epson scanner to be network accessible on a hub attached to the DNS-323's USB port.

So far it looks pretty good. "sane-find-scanner" comes up positive, as does "scanimage -L". However, I keep getting a connection error when I start SaneTwain.

I ran "saned -d5" and got this:

root@D-Link_NAS:/# saned -d5
[saned] main: starting debug mode (level 5)
[saned] read_config: searching for config file
[saned] read_config: done reading config
[saned] saned (AF-indep+IPv6) from sane-backends 1.0.21cvs starting up
[saned] do_bindings: trying to get port for service "sane-port" (getaddrinfo)
[saned] do_bindings: [0] socket () using IPv6
[saned] do_bindings: [0] socket failed: Address family not supported by protocol
[saned] do_bindings: [1] socket () using IPv4
[saned] do_bindings: [1] setsockopt ()
[saned] do_bindings: [1] bind () to port 6566
[saned] do_bindings: [1] bind failed: Address already in use
[saned] do_bindings: couldn't bind an address. Exiting.
[saned] FATAL ERROR; bailing out, waiting for children...
[saned] bail_out: all children exited

Does anyone recognize what might be going wrong?

Offline

 

#2 2009-10-07 10:07:24

Mijzelf
Member / Developer
Registered: 2008-07-05
Posts: 709

Re: Scanner on USB hub: device found but port already in use

sparks wrote:

I ran "saned -d5" and got this:

...
[saned] do_bindings: [1] bind () to port 6566
[saned] do_bindings: [1] bind failed: Address already in use
...

Does anyone recognize what might be going wrong?

I'd say port 6566 is already in use. Try a 'netstat -nlp' to find out what.

Offline

 

#3 2009-10-07 11:52:53

oxygen
Member
Registered: 2008-03-01
Posts: 320
Website

Re: Scanner on USB hub: device found but port already in use

sane is probably already running.

Offline

 

#4 2009-10-07 14:04:05

sparks
Member
From: Germany
Registered: 2009-06-26
Posts: 11

Re: Scanner on USB hub: device found but port already in use

netstat shows:

Code:

Active Internet connections (only servers)
Proto Recv-Q Send-Q Local Address           Foreign Address         State       PID/Program name
tcp        0      0 0.0.0.0:515             0.0.0.0:*               LISTEN      1840/lpd Waiting
tcp        0      0 0.0.0.0:6566            0.0.0.0:*               LISTEN      1861/inetd
tcp        0      0 0.0.0.0:139             0.0.0.0:*               LISTEN      1846/smbd
tcp        0      0 0.0.0.0:80              0.0.0.0:*               LISTEN      1579/webs
tcp        0      0 0.0.0.0:22              0.0.0.0:*               LISTEN      1832/sshd
tcp        0      0 0.0.0.0:443             0.0.0.0:*               LISTEN      1579/webs
tcp        0      0 0.0.0.0:445             0.0.0.0:*               LISTEN      1846/smbd
udp        0      0 192.168.1.30:137        0.0.0.0:*                           1849/nmbd
udp        0      0 0.0.0.0:137             0.0.0.0:*                           1849/nmbd
udp        0      0 192.168.1.30:138        0.0.0.0:*                           1849/nmbd
udp        0      0 0.0.0.0:138             0.0.0.0:*                           1849/nmbd
udp        0      0 224.0.0.1:13579         0.0.0.0:*                           1632/op_server
Active UNIX domain sockets (only servers)
Proto RefCnt Flags       Type       State         I-Node PID/Program name    Path
unix  2      [ ACC ]     STREAM     LISTENING       1716 1840/lpd Waiting    /var/run/lprng

So it looks like saned is running as expected, right?

Strange thing, though, when I powered up everything this morning, "scanimage -L" didn't find a scanner! It wasn't until after I restarted using the device's web configuration page that it found the scanner. Even "scanimage -T" activated the scanner as expected and reported passed test scans. However, SaneTwain still can't connect and displays this error upon closing: "Write error 64, the specified network name is no longer available."

In reference to Oxygen's comment, if sane is already running, do I need to stop it in my script first?

Will this solve my problem with SaneTwain not connecting?

Sorry if all this is really basic, but I really appreciate whatever help you can send my way. smile

Offline

 

#5 2009-10-07 14:17:45

Mijzelf
Member / Developer
Registered: 2008-07-05
Posts: 709

Re: Scanner on USB hub: device found but port already in use

I can be wrong, but I don't think saned is running, but inetd. You'll have to edit inetd.conf to leave port 6566 alone, or to pass it to saned.

Offline

 

#6 2009-10-07 15:58:42

sparks
Member
From: Germany
Registered: 2009-06-26
Posts: 11

Re: Scanner on USB hub: device found but port already in use

Hmmm, well according to the procedure I based my scripts on, the startup script is supposed to set inetd to listen on port 6566.

/ffp/start/sane.sh

Code:

echo "sane-port 6566/tcp # SANE network scanner daemon" >> /etc/services
echo "usbfs           /proc/bus/usb   usbfs   defaults''',devmode=0666'''   0  0" >> /etc/fstab

mount /proc/bus/usb -o remount,devmode=0666

Offline

 

#7 2009-10-07 16:33:21

Mijzelf
Member / Developer
Registered: 2008-07-05
Posts: 709

Re: Scanner on USB hub: device found but port already in use

I created a inetd conifg file in /ffp/etc/inetd.config with only one line in it:

Code:

sane-port  stream  tcp  nowait  root.root  /opt/sbin/saned saned

You did this also? Does /opt/sbin/saned match with 'which saned'?

Offline

 

#8 2009-10-07 17:38:49

sparks
Member
From: Germany
Registered: 2009-06-26
Posts: 11

Re: Scanner on USB hub: device found but port already in use

Mijzelf wrote:

You did this also? Does /opt/sbin/saned match with 'which saned'?

Yes, though I was perplexed at first when inetd.sh was generating errors in the ffp log, but then I realized the configuration file needed to be named "inetd.conf" and not "inetd.config" (per instructions). Now it seems to run error free.

Offline

 

Board footer

Powered by PunBB
© Copyright 2002–2010 PunBB