OpenWrt Forum Archive

Topic: Some problems with saned

The content of this topic has been archived on 13 Apr 2018. There are no obvious gaps in this topic, but there may still be some posts missing at the end.

Hi,

I want to enhance my ASUS WL-500gP (running very fine with Kamikaze 7.07) to a network scanning server with sane(d).
After installing sane-libs and sane-backends (and all packages needed for them), I added 192.168.23.0/24 to /etc/sane.d/saned.conf and connected the usb scanner (cannonScan Lide 25) to the usbport (yes, I also installed the usb-packages, the devices is listed by lsusb).
By the way: my Network is 192.168.23.0/24, the name of my Asus-WL500 is "wundertuete" and it runs behind a firewall (IPCOP).

I also added
sane-port       6566/tcp
to /etc/services


As a next step, I want to see, that everything is running before I prepair xinted.
So I started saned:
saned -d128
OUTPUT:
[saned] main: starting debug mode (level 128)
[saned] main: trying to get port for service `sane' (getservbyname)
[saned] main: port is 6566
[saned] main: socket ()
[saned] main: setsockopt ()
[saned] main: bind ()
[saned] main: listen ()
[saned] main: waiting for control connection
                       
So far so good.
If I make a telnet connection from an other console to this port (localhost connection), I got the following output:

[saned] saned from sane-backends 1.0.17 ready
[saned] check_host: access by remote host: 127.0.0.1
[saned] check_host: remote host is IN_LOOPBACK: access accepted
[saned] init: access granted
[saned] init: bad status=0 or procnum=1952805748
[saned] quit: exiting

seems fine. But if I make a connection from an other host, I got the following error:

[saned] saned from sane-backends 1.0.17 ready
[saned] check_host: access by remote host: 192.168.23.123
[saned] check_host: remote host is not IN_LOOPBACK
[saned] check_host: local hostname: wundertuete
[saned] check_host: gethostbyname failed: Success
[saned] init: access by host 192.168.23.123 denied
[saned] quit: exiting

The strange thing is the line:
[saned] check_host: gethostbyname failed: Success.
192.168.23.123 is my client, and it is included in 192.168.23.0/24.
A normal and reverse lookup of his name is also possible. I tryed hours for hours to solve the problem, but I got no single step ahead. I also wrote 192.168.23.123 to /etc/sane.d/saned.conf.

I tryed to link the saned.conf to a different place (e.g. /usr/local/etc/sane.d/saned.conf), but no difference. I looks like the sane daemon does not look to the config file, because after deleting the file, I canĀ“t see any difference.

So any ideas?

Robert

I had the exact same problem -- SANE worked under Kamikaze 7.06, but under 7.09 it was broken. After letting it kick my butt for about 4 hours, I came across your post. It lead me to some troubleshooting steps. (My troubleshooting was aided by the fact that I have 2 Kamikaze devices - one running 7.06 the other 7.09.)

On the 7.06 device, Saned was detecting the hostname properly:
root@nas:/etc# saned -d128
[saned] main: starting debug mode (level 128)
[saned] main: trying to get port for service `sane' (getservbyname)
[saned] main: port is 6566
[saned] main: socket ()
[saned] main: setsockopt ()
[saned] main: bind ()
[saned] main: listen ()
[saned] main: waiting for control connection
[saned] saned from sane-backends 1.0.17 ready
[saned] check_host: access by remote host: 10.240.5.254
[saned] check_host: remote host is not IN_LOOPBACK
[saned] check_host: local hostname: nas

However, on the 7.09 device, it kept detecting the hostname was "OpenWrt," but in fact it was set as "server" in my hosts file. I figured there must be a bug with the way Sane is detecting the hostname, so I changed /etc/hosts from:
127.0.0.1 localhost.
10.240.5.1 server

to:
127.0.0.1 localhost.
10.240.5.1 server OpenWrt

I couldn't believe it when that worked! Basically, I just added the hostname OpenWrt and everything worked!

Hope that helps.

Best regards,
Russel

Okay, instead of my poorly implemented workaround, it's better to just edit /etc/config/system and change:

config system
        option hostname OpenWrt

to
config system
        option hostname YourHostName

Anyway, it works for me.
--Russel

The discussion might have continued from here.