# Network Printer

## GianGian2387

Hello, I'm trying to configure my stamoante smasung ml (attached to the raspberry and configure, via cups as a network printer). I then installed cups and avahi (and set zeroconf as use flag) then I installed system-config-printer, the printer is seen by the system but I can't print anything ... do you have any ideas?

----------

## figueroa

I've never heard of anybody installing app-admin/system-config-printer. There is a GUI in your browser at localhost:631.

Does the printer work? How do you know? Maybe tell us the model of the printer. How is it connected to the Pi?

Are you trying to print from the Raspberry Pi or from another computer? If from another computer, does it print from the Pi? Is the Pi set up as a CUPS server?

----------

## GianGian2387

the printer (samsung ml1660) is connected to the raspberry via usb port, on the server I have installed and configured cups and it works from the raspberry and it works from any other pc in the house, it does not work only from the machine on which I am running gentoo (on gentoo i also installed cups)

as I said, on gentoo I see it but if I send any document to print it does not print anything (cups is installed on gentoo but I have not configured anything since the printer is not physically connected to the pc in question).

If I select the printer (therefore not the one installed via system-config-printer) I get the warning: "Cannot start the printer. Check its configuration".

----------

## GianGian2387

I followed this guide: https://wiki.gentoo.org/wiki/Printing

 I set up printing group for my user and I moved the /etc/cups/cupsd.conf file with my IP address (that of the server running cups and to which the printer is connected) once I have saved the file and restarted the daemon, the network printer is gone, I can't detect it anymore ....

----------

## figueroa

I don't think copying configuration files from the Pi will get you a working solution.

Two choices. Set up the printer manually as a network printer on your Gentoo machine to print to the printer through the Pi host.

The drivers for your printer are part of the net-print/splix package. I have them on my Gentoo system at:

/usr/share/cups/model/samsung/ml1660.ppd.gz

Install splix and then go through the printer setup in CUPS: localhost:631

You should also install net-print/cups-filters and if you activate /etc/init.d/cups-browsed (/etc/init.d/cups-browsed start) it's likely to find the printer for you.

Or, if this is the only printer you want to print to, make the Gentoo box a slave to print to the default Pi printer using /etc/cups/client.conf:

```
$ cat /etc/cups/client.conf

#ServerName localhost:631

#ServerName jerusalem:631

ServerName 192.168.1.103:631

#ServerName /run/cups/cups.sock
```

Change the IP address 192.168.1.103 to the IP address of the Pi.

----------

## GianGian2387

but I have not copied the file from the pi, I configured the file following the guide I posted but inserting the ip of the pi, however I install the packages you said and you say

----------

## figueroa

Very well. Perhaps you should reverse the moving of the cupsd.conf file, since doing that is what made the printer disappear. Ordinarily, the user doesn't need to manually edit the cupsd.conf. Perahps copy a cupsd.conf from one of the working computers.

----------

## GianGian2387

ok, it finally works! Thanks for your help  :Smile: 

----------

## figueroa

Well done. What was your solution?

----------

## GianGian2387

I used the second solution you wrote

----------

## GianGian2387

Another small problem, I also have a scanner (epson) that I cannot configure in any way, I installed the drivers but the system does not see it, I tried to type from the browser localhost: 631 but it does not open the page (I assume by way of the fact that it doesn't have https) what can I do?

----------

## figueroa

Be sure that the specific backend for the scanner is included (preferably near the top) of /etc/sane.d/dll.conf

```
net

# Add support for the HP-specific backend.  Needs net-print/hplip installed.

hpaio

# Add support for the Epson-specific backend.  Needs media-gfx/iscan installed.

epkowa
```

Also, for remote scanning, you need to run saned on the host computer. You also need to edit /etc/sane.d/net.conf

```
localhost

192.168.0.204

#jeremiah
```

The IP address is my networked HP LaserJet 3055. localhost covers my USB connected Epson Perfection V500 Photo.

Also, you won't find your scanner at port 631.

----------

## GianGian2387

the printer is attached directly to the pc via USB cable

----------

## figueroa

The URL http://localhost:631 (note: NO space) should bring up the CUPS management interface. This is not related to the scanner nor saned.

The host needs to give the client permission to use the scanner (saned). Be sure to add that to saned.conf. In my case, I give permission to my entire LAN with the following:

```
#scan-client.somedomain.firm

192.168.0.0/24
```

or you can give permission to just a single client's IP address.

----------

## GianGian2387

the problem is that typing the localhost:631 does not make me connect to the page, I tried to enable ssl but the thing remains the same

I am referring to the ip of the patch on which gentoo is running and on which I have previously installed cups

----------

## figueroa

I don't understand the term "the patch" but to connect a browser to localhost:631, cupsd must be running.

```
/etc/init.d/cupsd start
```

In order to make cupsd run at startup:

```
rc-update add cupsd default
```

----------

## GianGian2387

this is my /etc/sane.d/dll.conf: 

 *Quote:*   

> # dll.conf - Configuration file for the SANE dynamic backend loader
> 
> #
> 
> # Backends can also be enabled by configuration snippets under the dll.d/
> ...

 

this is my /etc/sane.d/net.conf: 

```
# This is the net backend config file.

## net backend options

# Timeout for the initial connection to saned. This will prevent the backend

# from blocking for several minutes trying to connect to an unresponsive

# saned host (network outage, host down, ...). Value in seconds.

# connect_timeout = 60

## saned hosts

# Each line names a host to attach to.

# If you list "localhost" then your backends can be accessed either

# directly or through the net backend.  Going through the net backend

# may be necessary to access devices that need special privileges.

# localhost

localhost

192.168.1.2

#jean
```

my saned.conf:

 *Quote:*   

> #scan-client.somedomain.firm

 

cups is active at system startup

the printer in question (epson stylus sx400) is directly connected to the pc where gentoo is running, and not to the raspberry pi as for the samsung, that's why I thought of configuring it directly from cups by opening it on the browser, but unfortunately it doesn't open it, so I do not know how to do

----------

## figueroa

Just restating that printing and scanning are unrelated. Consider it two separate devices.

CUPS is unrelated to SANE and cupsd is unrelated to saned.

Since the cups web interface should work by default, is cupsd really running?

```
$ ps ax |grep cupsd

 4546 ?        Ss     0:08 /usr/sbin/cupsd -f -c /etc/cups/cupsd.conf -s /etc/cups/cups-files.conf
```

What is the output of /etc/init.d/cupsd status?

What's the output of nmap -A localhost?

Is there a firewall on the host possibly blocking port 631? (printing)

I would consider purging cups:

```
emerge -c net-print/cups
```

Then manually remove any residual related files, i.e. /etc/cups especially, then start over.

A newly installed cups, with cupsd running, with default cups configuration should give you a clean web interface.

----------

## figueroa

Regarding your scanner(s), could there be a firewall issue?

What backend(s) does your scanner use?

What's the output of sane-find-scanner and/or scanimage -L?

----------

## GianGian2387

the output:

 *Quote:*   

> jean@gentoo ~ $ ps ax |grep cupsd 
> 
>  2442 ?        Ss     0:00 /usr/sbin/cupsd -f -c /etc/cups/cupsd.conf -s /etc/cups/cups-files.conf
> 
>  3325 pts/0    S+     0:00 grep --colour=auto cupsd
> ...

 

As for uninstalling cups and reinstalling it as soon as I have 5 minutes I try

----------

## figueroa

Install nmap. It's an invaluable network took. Then retry the command "nmap -A localhost"

----------

## GianGian2387

 *Quote:*   

> gentoo /home/jean # nmap -A localhost
> 
> Starting Nmap 7.92 ( https://nmap.org ) at 2021-10-19 21:47 CEST
> 
> Nmap scan report for localhost (127.0.0.1)
> ...

 

once i uninstall cups, how do i know which files or folders are left installed?

----------

## figueroa

I was primarily thinking of /etc/cups

Probably best to just rename, i.e. 'mv /etc/cups /etc/cups.backup'

----------

## GianGian2387

I entered the following line in my make.conf: SANE_BACKENDS = "epson2" (I had previously checked the list and it is the correct one) and continued with the configuration of sane:

 *Quote:*   

> jean@gentoo ~ $ emerge -pv sane-backends
> 
> These are the packages that would be merged, in order:
> 
> Calculating dependencies... done!
> ...

 

created the scanner group

 *Quote:*   

> jean@gentoo ~ $ scanimage -L
> 
> No scanners were identified. If you were expecting something different,
> 
> check that the scanner is plugged in, turned on and detected by the
> ...

 

Opening simplie scan does not detect the scanner anyway ...

----------

## figueroa

Is this where you found the supporting backend?

http://www.sane-project.org/sane-backends.html

Do you find anything about the scanner in dmesg?  How about lsusb? If yes, share output.

Do you have your printer working now?

----------

## GianGian2387

yes, I used the link you posted, these are the commands:

 *Quote:*   

> jean@gentoo ~ $ lsusb
> 
> Bus 001 Device 004: ID 0dda:2026 Integrated Circuit Solution, Inc. USB2.0 Card Reader
> 
> Bus 001 Device 001: ID 1d6b:0002 Linux Foundation 2.0 root hub
> ...

 

----------

## figueroa

I don't see any Epson or scanner. If you scanner isn't detected by your hardware, there is no way forward.

----------

## GianGian2387

I tried to unplug and reattach the printer / scanner cable, now it is recognized thanks for your help and patience

----------

