LinuxQuestions.org

LinuxQuestions.org (/questions/)
-   Linux - Software (https://www.linuxquestions.org/questions/linux-software-2/)
-   -   CUPS unable to discover an HP 1022n Network Printer (https://www.linuxquestions.org/questions/linux-software-2/cups-unable-to-discover-an-hp-1022n-network-printer-710492/)

xasanchez 03-10-2009 09:18 AM

CUPS unable to discover an HP 1022n Network Printer
 
The situation is quite simple. I have a network-attached HP Lasejet 1022n printer. Everything what I have read about, suggests it's a piece of cake for CUPS finding a network printer by itself.

The printer gets its IP address via a DHCP router providing that service, so in theory, sometimes it could change dynamically.

Why does CUPS not find the printer?

Thanks in advance.
Xavier.

farslayer 03-10-2009 11:26 AM

I would assign a Static IP to the Printer, or at the very least create a reservation for it on the DHCP server. Having printer IP addresses changing all the time would be a nightmare to mange imho.

Once the IP is fixed, no matter which method you used, it's simple to add it in cups by entering the IP address for the printer in the printer configuration wizard.

Auto-discovery for devices and services on the network is over rated imho.

xasanchez 03-10-2009 05:58 PM

Ok, good. It is common sense. Suppose just for testing, with the ready-given IP address during the day, are you saying CUPS wouldn't either find it?

I mean, CUPS is NOT for discovering networked printers anyway? You HAVE to configure it manually?

xasanchez 03-10-2009 08:13 PM

Finished
 
For those who want to get through with this kind of need:

1. Configure the printer with its own facility, getting into its web page: http://the-actual-ip-address.
2. There, assign a static IP address of your choice.
3. You would have to (recommended) restart the printer with the new assigned static IP.
4. Configure manually the printer within CUPS.
5. Follow instructions up to the point where you are asked to specify the URI. There, write
socket://the-new-ip-address
6. Specify it is an HPLIP printer, and when prompted to specify the type of printer, scroll down and find the "HP LaserJet 1022n Foomatic/hpijs, hpijs 2.8.10.33" (for example, version is actually the one shown in my system, could be some other).
7. Choose Add Printer.
8. Print a Test Page and...
9. Voila...!!

Very comfortable getting through, huh?

Have fun!

farslayer 03-10-2009 11:44 PM

Glad to see you got it all sorted out :)

CrashedAgain 03-11-2009 01:53 PM

I have a similar setup (network connected HP C6380) on a DHCP router. Although it may be theoretically possible for the router to assign new IP addresses, it never seems to happen...the printer is always 192.168.2.146, the laptop is always 192.168.2.120, etc. (everything on the LAN is 192.168.2.something.) So it's probably safe to skip the "assign static IP" step.

Usually I can just install the printer using the Control Center wizard but you must know the IP address...the Control Center "scan" never seems to find it.

farslayer 03-11-2009 02:15 PM

In your small relatively fixed network that may be true, but it would be a poor habit to get into.

If you look at the way DHCP works there is an exchange between the Client and the Server.

Client Printer says "Hey is there anyone out there that can give me an IP ?"
Server Responds. "Sure I can, what IP do you want ? "
Client Printer responds with the Last IP address it had on this network and says "is this address still available ?"
Server responds "Sure it is you may lease it again"

(A good exercise here to better understand how DHCP operates, would be to use Wireshark to capture the discussion between a client machine and a DHCP server)

Trouble comes in if the printer using that address is off the network, and a new Laptop shows up. the new laptop could possibly get the address that was assigned to the Printer, so the next time the printer asks for an address it will be denied it's old IP and instead offered the next available address in the DHCP scope.

So for the sake of best practice your Printer, as I stated above, should either be Statically assigned, or DHCP reservations made that are tied to the MAC address of the printer.

Assuming the device will always get the same IP could cause you trouble down the road, while learning and implementing best practices will server you better in the long run.

CrashedAgain 03-11-2009 02:25 PM

I stand (or sit) corrected then.

farslayer 03-11-2009 02:34 PM

Now if you want some real fun, have someone on your network start running a second DHCP server that ISN"T supposed to be there, then try to figure out why NO-ONE can get an IP address.. now THAT makes for an interesting wireshark capture..

I wanted to strangle that guy, once I tracked him down.. he was running a web proxy on His PC, to allow users that were blocked from Internet access to go through his machine to get to the web. his web proxy had a built in DHCP server, that kept denying legitimate requests to the proper DHCP server. User ended up with no address at all..


I guess what I'm trying to say is, that the reason we are all here. To learn from each others experiences and knowledge. I know I certainly have learned a lot from other people around here.

Cheers !!

xasanchez 03-12-2009 09:38 AM

Reinforcing
 
Supporting further farslayer's very-nicely exposed explanations, notice that, also, many DHCP-servicing routers keep track of the MAC addresses of the leased IP'S they grant to requesting clients in a table.

So, not only the client can ask for the former granted IP, but also, according to the status of the table, whether that MAC is already assigned to another client or not, it makes a best-effort decision to give again the same IP or not. And it usually works just about the same every time.

In a small, domestic, network, the scenario presented by farslayer is perfectly clear.

When I first came up with my question, it only shows that I am like new to Linux and that kind of small obstacles that someone may have already solved, but the general matter is something that I manage more or less modestly well.:)


All times are GMT -5. The time now is 09:03 AM.