# [solved] Problems with Network Printer HP LaserJet

## matsu

I've been trying to add a HP LaserJet via the CUPS interface, but without success.

The printer's IP address is known from its configurarion page (printer intern), so the URI should be socket://ip-address (I've also tried several other ones, though). Necessary drivers are installed as well.

I have tried both connecting directly and via router.

lpstat -a shows two empty lines, when nothing is connected it doesn't show anything, so the output is different in some way.

(After reading this thread I'm not really motivated trying to use USB instead.)

Any ideas what I could do or what outputs would you need?

Thank you in advance.Last edited by matsu on Mon Mar 04, 2013 7:33 pm; edited 1 time in total

----------

## Quincy

First questions:

- Which specific LaserJet?

- Do you have hplip installed?

----------

## matsu

Yes, I have hplip installed. I've tried both drivers, the one from gutenprint and from hplip.

The printer is LaserJet 5000.

----------

## albright

 *Quote:*   

> The printer is LaserJet 5000.

 

do you mean 5000n

this is a network capable printer, right?

else, where does it get an ip address

----------

## matsu

You're right, it's 5000N, I accidently dropped the N, and it is network capable.

Somewhere on the net I found out that the IP address along with other data can be printed (on paper) via the printer's menu, which is what I have done. Other than that I have no idea how to get the IP address.

----------

## Quincy

I think albright means how the printer gets the IP address (static, DHCP, etc.).

Additional question on that: Can you connect to the web server of the printer by opening the IP address in your web browser?

----------

## matsu

I don't know how the printer gets the IP address. I was thinking it's static, but now that you mention it,  I don't actually know.

 *Quote:*   

> Additional question on that: Can you connect to the web server of the printer by opening the IP address in your web browser?

 

No, I can't. Hm, so this means the IP address is wrong? 

If this is the case, what can I do to get the IP? I have googled before, but have only found what I have wirtten above (this configuration print).

----------

## albright

 *Quote:*   

> If this is the case, what can I do to get the IP?

 

it may well be that the printer is getting an IP address from your

router, in which case the router's web config page should have

a list of connected devices ...

----------

## Quincy

 *matsu wrote:*   

> No, I can't. Hm, so this means the IP address is wrong? 
> 
> If this is the case, what can I do to get the IP? I have googled before, but have only found what I have wirtten above (this configuration print).

 

It could also mean that there is no such web server at all, I don't know perfectly if this printer has one, but with the official HP JetDirect module there should be one accoring to this.

To rule out the obvious: The IP address of the printer is in the same network as your PC?

----------

## lost+found

Hi, 

Did you try "hp-setup" as a terminal command yet? Also I had to enable some USE flags for the network interface of my HP printer: slp for cups and snmp for hplip.

----------

## bammbamm808

My LaserJet Pro 400 has a menu option to DISPLAY IT'S IP ADDRESS on it's little LCD display. I found it while trying to configure mine. I'd bet yours has the same feature and turning it on via the printer's own controls will save you some mucking about.

----------

## matsu

So, after a few tries I still haven't proceeded at all.

The printer is in the same network as the PC and the IP address that shows up on the display is the same that I have used all the time, so there should not be anything wrong here.

The only thing I can imagine is that the problem is related to the router as I have not yet succeeded to connect to the router's configuration page. This seems to be the what I need to work on first.

hp-setup brings up the following error (I also have change the USE flags accordingly):  

[code]

error: Network error

error: No device selected/specified or that supports this functionality

[\code]

----------

## NeddySeagoon

matsu,

What is the IP address of the printer?

What is the IP address of the system you are trying to connect from - the one running CUPS?

What is the output of route from this system ?

----------

## lost+found

The printer should respond to ping.

Normally I don't filter the connection to my printer, but if I block traffic using iptables, the logs show that hp-setup needs output udp dest. port 161 (snmp). During operation it also needs output dest. tcp ports 9100 and 9290 (jetdirect), but these 2 may be different on your model.

This short command works for me:

```
# hp-setup -i <ip address>
```

 ... after answering the questions, the printer shows up in the CUPS web interface.

Here are all the USE flags of my installation.

```
# emerge -pv cups hplip

These are the packages that would be merged, in order:

Calculating dependencies... done!

[ebuild   R    ] net-print/cups-1.5.2-r4  USE="X acl dbus jpeg ldap pam png slp ssl threads tiff usb -avahi -debug -filters -gnutls -java -kerberos -perl -python (-selinux) -static-libs -xinetd" LINGUAS="nl -da -de -es -eu -fi -fr -id -it -ja -ko -no -pl -pt -pt_BR -ru -sv -zh -zh_TW" 0 kB

[ebuild   R    ] net-print/hplip-3.12.10a  USE="X fax hpcups kde libnotify (policykit) qt4 scanner snmp -doc -hpijs -libusb0 -minimal -parport -static-ppds" 0 kB
```

----------

## matsu

The printer's IP address is 192.168.178.250.

The system's IP address is 192.168.1.2.

```
# route -n

Destination     Gateway         Genmask            Flags   Metric   Ref   Use Iface

0.0.0.0         192.168.1.1     0.0.0.0  .0        UG      202      0     eth0

127.0.0.0       127.0.0.1       255.0.0.0          UG      0        0     lo

192.168.1.0     0.0.0.0         255.255.255.0      U       202      0     eth0

```

Hm, this rather looks like the printer is not in the same network, right?

hp-setup -i <ip address> shows that the URI is invalid, I tried also ping <ip address>, the output:

```
ping 192.168.178.250 

PING 192.168.178.250 (192.168.178.250) 56(84) bytes of data

^C

--- 192.168.178.250 ping statistics ---

71 packets transmitted, 0 received, 100 % package loss, time 69999 ms

```

----------

## lost+found

Looks to me that the printer uses a self configured static ip address, perhaps after trying to get one from dhcp. A router would give one in the same subnet. If you connect directly, do you use a cross link cable? Not needed to a router...

Neddy, ....   :Smile: 

----------

## Ant P.

Easy way to check if it has a network connection: run nmap. You'll get one page of random ASCII garbage if it's working.

----------

## NeddySeagoon

matsu,

For testing, add a IP address to your PC.

As the printer is on 192.168.178.250,

```
ifconfig eth0:1 192.168.178.25/24
```

should add a route to 192.168.178.0/24 and give your PC the address 192.168.178.25 in addition to its 192.168.1.2.

As the printer IP is not in the link local range, it looks like it has previously been set statically.

The printer will have a 'reset to factory defaults' set of buttons you hold down at power up.  This will probably set it to use dhcp to get an IP address.

----------

## matsu

Thank you NeddySeagoon, this made it.

It is finally working.

Also, the printer was automatically detected by CUPS, so there was no need to manually type in some URI.

There is the possibility of resetting, however I'm just happy that the printer is finally running, so I will do try that at some later time. I guess, it doesn't hurt to let it as it is now.

----------

## NeddySeagoon

matsu,

If you want to leave it, add the IP address to your /etc/conf.d/net file, so you don't have to run ifconfig every boot.

----------

