AirSane icon indicating copy to clipboard operation
AirSane copied to clipboard

Scanner not automatically detected by airsaned.service on on-off-on cycle

Open SerJoG opened this issue 1 year ago • 4 comments

Hello @SimulPiscator, my Samsung SCX-3400 is not automatically detected by airsaned.service (systemctl) when I turn it off and then on. scanimage can detect it normally (sometimes after few seconds), but I have to restart at least one time airsaned service to make it work.

SerJoG avatar Apr 19 '24 09:04 SerJoG

Hi, airsaned uses the same SANE library function to enumerate scanners as scanimage does. It is thus difficult for me to understand how this difference in behavior arises.

You can do the following to see some debug output from airsaned when enumerating scanners: sudo systemctl stop airsaned sudo -u saned airsaned --debug=true

Otherwise, in /etc/systemd/system/airsaned.service there is a line ExecStartPre=/bin/sleep 15 You could try setting the sleep argument to 25 or 30 and see whether that helps.

SimulPiscator avatar Apr 19 '24 21:04 SimulPiscator

Hi @SimulPiscator, it doesn't help but I noticed that the avahi-daemon seems weird 'cause it says there's no service file in /etc/avahi/services (folder is empty) and appears 'Failed to parse address 'inet6%wlan0', ignoring'. I think this prevent the scanner to be served on airsane. I also tries to disable mdns on airsane service and allow_ipv6 on avahi service.

SerJoG avatar Apr 20 '24 08:04 SerJoG

there's no service file in /etc/avahi/services (folder is empty).

This is just an avahi warning that indicates that no static services are defined.

Failed to parse address 'inet6%wlan0', ignoring'

That looks like an avahi configuration error but it's relatively unspecific. Did you enable ipv6 on your system?

To check whether airsaned is detecting your scanner, you can look at the HTML page at http://localhost:8090. As you probably know, if you disable mdns for airsaned you will disable publishing of detected scanners to client programs.

SimulPiscator avatar Apr 20 '24 10:04 SimulPiscator

I don't know if ipv6 is enabled by default, if not I didn't turn it on. Well as I said it seems that then I connect the scanner scanimage is able to detect it but airsaned executed by systemctl not. So I have to restart airsaned multiple times to make it work and this broke the usefulness of this service. Trying to analyze it a bit I thought that avahi is the problem, but it turns out it's not. My analysis is not deep, when I have time I'll try something more accurate. Thank you.

SerJoG avatar Apr 21 '24 07:04 SerJoG