For my epson EcoTank (wireless), I had to use all the below config.
services.printing and services.sane are quite obvious, but services.avahi could be the missing part in your config. It allows detection of device over the network in a protocol that the driver probably expects.
I guess you could use wireshark to detect the ports that are used. But it could be that the port is not always the same. It may be simpler to disable the firewall on the local network, or to allow anything from the printer IP.
it looks like iscan-network-nt + sane-epson2 should be the solution, but we only package iscan-network-nt as part of epkowa. It may be a good idea to see if we can get iscan-network-nt + sane-epson2 working
Seems like the way to go is to address the scanner directly by ip, provided that this ip remains stable thanks to your local DHCP. See how to do that in the man pages here. That would avoid the discovery issues.
I guess you will have to go with networking.firewall.extracommands and something like the following (but I am no iptable guru, so this may not be a correct iptables rule per se, and the OUTPUT rule may not be needed.)
My scanner already receives the same IP from the local DHCP server (a wireless router). But it is not possible to edit the epson2.conf configuration file because it is installed read only in the nix store, and the sane module does not offer any means of changing it. This is a weak point of the sane module that maybe should be addressed.
59fb9ae87f