Solved FreeBSD 14.0 wifi scanner issue


Hi there,

Xsane is not recognizing the WiFi scanner, this is the first time I have issues with the scanner. I tried to reinstall everything, including sane-airscan but nothing is happening.

If I use a software called epsonscan2 and I provide the IP of the wifi printer it can find it:

scanner.png


But when it is time to create a connection, it fails:

scanner2.png


Using this software made the scanner discoverable by xsane but yet unreachable...

scanner3.png


Airscane that used to work, it can't find the scanner as well:

Code:
airscan-discover -d
MDNS: AVAHI_CLIENT_S_RUNNING
WSDD: netif addresses update:
WSDD:  + 10.0.0.108
WSDD: 10.0.0.108: started discovery, UDP port=35284
zeroconf: zeroconf_device_list_get: requested
zeroconf: device_list wait: requested
zeroconf: device_list wait: DNS-SD not finished...
MDNS: browse-ipv6("_ipp._tcp"): AVAHI_BROWSER_CACHE_EXHAUSTED
MDNS: browse-ipv6("_ipps._tcp"): AVAHI_BROWSER_CACHE_EXHAUSTED
MDNS: browse-ipv6("_uscan._tcp"): AVAHI_BROWSER_CACHE_EXHAUSTED
MDNS: browse-ipv6("_uscans._tcp"): AVAHI_BROWSER_CACHE_EXHAUSTED
MDNS: browse-ipv6("_scanner._tcp"): AVAHI_BROWSER_CACHE_EXHAUSTED
MDNS: browse-ipv6("_ipp._tcp"): AVAHI_BROWSER_ALL_FOR_NOW
MDNS: browse-ipv6("_ipps._tcp"): AVAHI_BROWSER_ALL_FOR_NOW
MDNS: browse-ipv6("_uscan._tcp"): AVAHI_BROWSER_ALL_FOR_NOW
zeroconf: ZEROCONF_USCAN_TCP: initial scan finished
MDNS: browse-ipv6("_uscans._tcp"): AVAHI_BROWSER_ALL_FOR_NOW
zeroconf: ZEROCONF_USCANS_TCP: initial scan finished
MDNS: browse-ipv6("_scanner._tcp"): AVAHI_BROWSER_ALL_FOR_NOW
zeroconf: ZEROCONF_MDNS_HINT: initial scan finished
zeroconf: device_list wait: WSDD not finished...
WSDD: 10.0.0.108: done discovery
zeroconf: ZEROCONF_WSD: initial scan finished
zeroconf: device_list wait: OK
zeroconf: zeroconf_device_list_get: building list of devices
zeroconf: zeroconf_device_list_get: resulting list:
[devices]

It used to work, but today I received a lot of updates and perhaps something broke the communication between the scanner and the sane backend, all the services that sane needs to work are enabled:
Code:
dbus_enable="YES"
kld_list="nvidia nvidia-modeset fusefs"
lightdm_enable="YES"
cupsd_enable="YES"
devfs_system_ruleset="system"
avahi_daemon_enable="YES"
dsbmd_enable="YES"
saned_enable="YES"

Removing epsonscan2 makes the scanner invisible again:
Code:
doas sane-find-scanner -v
This is sane-find-scanner from sane-backends 1.2.1

  # sane-find-scanner will now attempt to detect your scanner. If the
  # result is different from what you expected, first make sure your
  # scanner is powered up and properly connected to your computer.

searching for SCSI scanners:
checking /dev/scanner... failed to open (Invalid argument)
checking /dev/scanner0... failed to open (Invalid argument)
checking /dev/scanner1... failed to open (Invalid argument)
checking /dev/pass0... open ok
inquiry for device /dev/pass0 failed (Error during device I/O)
checking /dev/pass1... open ok
inquiry for device /dev/pass1 failed (Error during device I/O)
checking /dev/pass2... open ok
inquiry for device /dev/pass2 failed (Error during device I/O)
checking /dev/pass3... open ok
inquiry for device /dev/pass3 failed (Error during device I/O)
checking /dev/pass4... failed to open (Invalid argument)
checking /dev/pass5... failed to open (Invalid argument)
checking /dev/pass6... failed to open (Invalid argument)
checking /dev/pass7... failed to open (Invalid argument)
  # No SCSI scanners found. If you expected something different, make sure that
  # you have loaded a kernel SCSI driver for your SCSI adapter.

searching for USB scanners:
checking /dev/uscanner... failed to open (Invalid argument)
checking /dev/uscanner0... failed to open (Invalid argument)
checking /dev/uscanner1... failed to open (Invalid argument)
checking /dev/uscanner2... failed to open (Invalid argument)
checking /dev/uscanner3... failed to open (Invalid argument)
checking /dev/uscanner4... failed to open (Invalid argument)
checking /dev/uscanner5... failed to open (Invalid argument)
checking /dev/uscanner6... failed to open (Invalid argument)
checking /dev/uscanner7... failed to open (Invalid argument)
checking /dev/uscanner8... failed to open (Invalid argument)
checking /dev/uscanner9... failed to open (Invalid argument)
checking /dev/uscanner10... failed to open (Invalid argument)
checking /dev/uscanner11... failed to open (Invalid argument)
checking /dev/uscanner12... failed to open (Invalid argument)
checking /dev/uscanner13... failed to open (Invalid argument)
checking /dev/uscanner14... failed to open (Invalid argument)
checking /dev/uscanner15... failed to open (Invalid argument)
found possible USB scanner (vendor=0x1c7a [EgisTec], product=0x0603 [EgisTec_ES603]) at libusb:000:003
  # Your USB scanner was (probably) detected. It may or may not be supported by
  # SANE. Try scanimage -L and read the backend's manpage.

  # Not checking for parallel port scanners.

  # Most Scanners connected to the parallel port or other proprietary ports
  # can't be detected by this program.
done
I don't have any other idea on how troubleshooting it... 😖

Thanks...
 
Last edited:
Shot in the air. It has something like this in /usr/local/etc/sane.d/saned.conf?

#saned.conf
#Include the access range for the scanner
10.0.0.1/16
 
Shot in the air. It has something like this in /usr/local/etc/sane.d/saned.conf?

#saned.conf
#Include the access range for the scanner
10.0.0.1/16

Nope, I have never touched that file... Ma I am going to assign the scanner IP and see what happens...

[FAST FORWARD TIME]

Nothing happens... but I am pretty sure I did it wrong...

I am tempted to say that is a pebcak but this has always worked with very little effort, therefore I believe that is a bug... 😖
 
cat /etc/wpa_supplicant.conf Does this file look correct to you?
ping -c 3 10.0.0.56 # can you ping the wifi scanner address?
ping -c 3 10.0.0.1 # can you ping the router IP address 192.168.0.1 or 192.168.1.1
ifconfig wlan0
Test network communications from your computer to your wifi enabled scanner. Go to scanner and see what network settings it displays. Maybe its broken wifi connection or it changed to some default wifi setup different than your 10.0.0.56 static IP address.
 
wb7odyfred

Thank you for helping me out... 🙏

I am not connected directly to the multifunction printer, this is available on the network with DHCP, and I could ping and see the printer through cups and, as I wrote in another post, with a "never-heard" epson scanner driver that could recognize it on the network but not speaking with.

I am concerned that is a huge bug that nobody noticed because very few use FreeBSD as desktop daily driver... ☹️
 
Let debug this together. Yes the high-level blocks are NOT talking properly with each other, So break down to smaller units/pieces and test those low-level blocks. Printer was working Just fine last time I used it (week ago?) what changes were made since then. Look at log files, check version numbers on the software, maybe md5 checksums.
 
wb7odyfred

I found a clue about the potential issue, this happened the day before I noticed the issue:
Code:
Jan 14 21:32:45 dbsd pkg[56488]: sane-backends upgraded: 1.2.1_2 -> 1.2.1_3

Since the Handbook doesn't mention how to downgrade a package it happens that my ports definitions are pretty old and I could uninstall the current sane-backends and install the one provided by ports definitions:
Code:
less distinfo
TIMESTAMP = 1683137196
SHA256 (sane-backends-1.2.1.tar.gz) = f832395efcb90bb5ea8acd367a820c393dda7e0dd578b16f48928b8f5bdd0524
SIZE (sane-backends-1.2.1.tar.gz) = 7308040

However it doesn't sound such a smart idea, what are your recommendations instead?

Thanks! 🙏
 
I had a problem with sane-backends in the past. I had to downgrade the package in Debian and OpenSUSE. That's when I tried FreeBSD and saw that it fixed the issue in newer versions.

Here's how to downgrade:

 
Does the scanner show up in the output from
avahi-browse -a
?

I can't read this... 🤷‍♂️

Code:
avahi-browse -a
+    lo0 IPv6 dbsd                                          _ssh._tcp            local
+    lo0 IPv4 dbsd                                          _ssh._tcp            local
+    lo0 IPv6 dbsd                                          _sftp-ssh._tcp       local
+    lo0 IPv4 dbsd                                          _sftp-ssh._tcp       local
+    lo0 IPv6 saned                                         _sane-port._tcp      local
+    lo0 IPv4 saned                                         _sane-port._tcp      local
^CGot SIGINT, quitting.
 
Is dbsd the name of your machine?
hostname
will tell you, if you don't know.
Other than that,
saned(8)
the SANE daemon shows up. It doesn't look like your scanner is there. I have an Epson multifunction printer / scanner, it shows up like this
Code:
+    re0 IPv4 EPSON6A21CC (Epson Stylus Office BX525WD)     _smb._tcp            local
+    re0 IPv4 EPSON6A21CC (Epson Stylus Office BX525WD)     _http._tcp           local
FWIW, I don't think
# sane-find-scanner
will detect a network-connected scanner.
 
tingo

Yes it is, it stands for dad-bsd 😎
I have an Epson multi-function too, I have never had an issue till the infamous last update... 😩
 
If you can't even ping the scanner by ip address, something is wrong with the network setup of your scanner or your machine. Fix that first. And "see the printer in cups" isn't a definetive answer for that part; can you print from cups to your printer?

As for my Epson, I use SANE like this:
xsane epson2:net:10.1.161.8 or like this
gscan2pdf --device epson2:net:10.1.161.8. I never bothered giving it a name in mye dns.
 
If you can't even ping the scanner by ip address, something is wrong with the network setup of your scanner or your machine. Fix that first. And "see the printer in cups" isn't a definetive answer for that part; can you print from cups to your printer?

I can print with the printer is perfectly available on CUPS:

Code:
EPSON XP-410 Series
Location:2
Driver:EPSON XP-410 Serie, Epson Inkjet Printer Driver (ESC/P-R) for Linuxs (color)
Connection:lpd://10.0.0.56:515/PASSTHRU
Defaults:job-sheets=none, none media=na_letter_8.5x11in sides=one-sided
 
I've only just entered this discussion, and have very little experience in this area, but on an Epson XP-4200 series connected by USB, the command
#epsonscan2
run as root works to find the scanner, and then offers a scanning dialogue.
The same command run as user doesn't find the device.
Looks wrong to me, but it works.
However, it does produce warnings such as
libpng warning: iCCP: known incorrect sRGB profile

This happens on 13.2-RELEASE-p2 FreeBSD 13.2-RELEASE-p2 GENERIC amd64

Apologies for the poor formatting in this comment, but I hope this helps someone.

=================================================
LATER EDIT.
Even to me, there is a misconfiguration somewhere. Reading some of the advice within the library files, the application seems to need Linux emulation and is not claimed to support all scanners. It also mentions something about "non-free" which I haven't come across before.
Using the #epsonscan2 as root will result in an image owned by root - which is obviously not intended.
I will try and highlight this to the developers, but I'm already out of my comfort zone.
 
If you can't even ping the scanner by ip address, something is wrong with the network setup of your scanner or your machine. Fix that first. And "see the printer in cups" isn't a definetive answer for that part; can you print from cups to your printer?

As for my Epson, I use SANE like this:
xsane epson2:net:10.1.161.8 or like this
gscan2pdf --device epson2:net:10.1.161.8. I never bothered giving it a name in mye dns.

I went back here because quarterly did not solve this issue, then on my Linux machine I noticed that the scanner is automatically recognized as epson2:net:10.0.0.56 and just now I realized what you were talking about.

If I do what you suggested the scanner is recognized, I don't know why Xsane stopped to recognize the scanner automatically, besides modify the launcher, how can be this solved?

Are there the circumstances to open a bug report?

🤷‍♂️
 
Inside /usr/local/etc/sane.d/ there are a bunch files, including epson2.conf, I modified this part:

Code:
# Network
#
# net 192.168.1.123
#net autodiscovery (original line)
net 10.0.0.56

Then I restarted the sane service and started again Xsane; with that change the scanner is automatically loaded, so what is actually broken is the autodiscovery function... 🤔
 
You can try reading the documentation, the source, or asking on the mailing list (sane-devel) how the network autodiscovery function in the epson2 backend is supposed to work. The manual page sane-epson2(5) is extremely brief on that point.
 
Back
Top