How to Access a Windows Shared Printer from Puppy 4

How to do things, solutions, recipes, tutorials
Message
Author
User avatar
rcrsn51
Posts: 13096
Joined: Tue 05 Sep 2006, 13:50
Location: Stratford, Ontario

#61 Post by rcrsn51 »

Read here for info on installing CUPS 1.3.10 into Puppy 4.2. Even if you don't need HPIJS drivers, you must install the second PET. It contains an important post-install operation.

User avatar
steve_s
Posts: 1595
Joined: Mon 26 May 2008, 13:29
Location: Austin, TX, USA
Contact:

#62 Post by steve_s »

Ok, maybe this will give some information...

I tried using smbspool directly, but I may have my command wrong...I used the computer/printer combo that worked in 4.0...

Code: Select all

smbspool smb://computer/printer 0 root 0 0 0 /mnt/home/documents/document.abw
..and I got as the last errors

Code: Select all

ERROR: No ticket cache found for userid=0
ERROR: Can not get the ticket cache for root

User avatar
steve_s
Posts: 1595
Joined: Mon 26 May 2008, 13:29
Location: Austin, TX, USA
Contact:

#63 Post by steve_s »

rcrsn51 wrote:Read here for info on installing CUPS 1.3.10 into Puppy 4.2. Even if you don't need HPIJS drivers, you must install the second PET. It contains an important post-install operation.
Great instructions, pet installed great, nice settup.

Still doesn't work. Checked the links, mounted the "print" part on the windows computer, etc. No dice.

Very frustrating.

Under device I got "Unkknown network device (smb)" so I picked that even though it wasn't exactly the "Windows Printer..." that I would have hoped for. Please check the attached picture for the error.
Attachments
cups-problem2.jpg
(134.94 KiB) Downloaded 455 times

User avatar
steve_s
Posts: 1595
Joined: Mon 26 May 2008, 13:29
Location: Austin, TX, USA
Contact:

#64 Post by steve_s »

Wow...this is fascinating and frustrating.

We are getting crazy now...it turns out it is cups 1.1.23 that is working for me on the 4.0 livecd...works every time after changing the sym link for the backend, etc.

Fine. On the 4.2 frugal, backed up the save file. Then removed the cups that was on there (1.3 at this point, I think), then installed 1.1.23, then tried to add the printer. No luck.

Ok, rebooted with the 4.0 cd, copied the entire /etc/cups/ folder after reinstalling the printer successfully again. Then booted back into the 4.2 frugal install, replaced everything in /etc/cups with the stuff from 4.0.

No go on the printer. Deleted it, restarted cups, reinstalled, still doesn't see the "Windows Printer via SAMBA" but has "Unknown SMB..." blah, blah, blah, as before.

What the crap?!!

User avatar
rcrsn51
Posts: 13096
Joined: Tue 05 Sep 2006, 13:50
Location: Stratford, Ontario

#65 Post by rcrsn51 »

Whatever kept you from seeing the "Windows Printer via SAMBA" in CUPS 1.4b2 is apparently doing the same thing in 1.3.10. How much memory does this laptop have?

User avatar
steve_s
Posts: 1595
Joined: Mon 26 May 2008, 13:29
Location: Austin, TX, USA
Contact:

#66 Post by steve_s »

rcrsn51 wrote:Whatever kept you from seeing the "Windows Printer via SAMBA" in CUPS 1.4b2 is apparently doing the same thing in 1.3.10. How much memory does this laptop have?
Not much: 256MB. Out of curiosity, how is that significant? And yes, your conclusion makes sense, but just can't figure out what that "thing" is...

**Edit: observations up to this point:
1. it is not working in 4.2, regardless of whether I am using a livecd, frugal install or what version of cups I am using.
2. it works in 4.0 (well, pupfluxlite, which 4.0 based) via livecd every time.

User avatar
Patriot
Posts: 733
Joined: Thu 15 Jan 2009, 19:04

#67 Post by Patriot »

Hmmm .....

I haven't had the need to send a print job to a windows printer yet but I guess I might as well join in and have some fun.

I made similar attempts to smbspool print to a windows printer just now and received similar results. It seems that smbspool uses some sort of authentication layer (ticketing) to avoid denial-of-service attacks. Just took a brief look at the codes and haven't a clue yet what's going on (yeah, I'm lame with C, remember?).

However, printing to the windows printer from within cups web interface works for me (cups 1.3.10 + samba 3.0.34). There's another way to print to a windows printer from command line, by using smbclient. Like this :

# smbclient -U guest -N //WORKGROUP/PC/PRINTER
Domain=[Domain] OS=[Windows Server] Server=[Windows Server]
smb: \> print /tmp/xerrs.log
bla ... bla ... bla ...
smb: \> quit
#

or do it in a single line :

# smbclient -U guest -N -c "print /tmp/xerrs.log" //WORKGROUP/PC/PRINTER

The above was something that I found (but didn't thought much about it at the time) many moons ago at http://willem.engen.nl/projects/cupssmb/
A script to perform the above can also be found over there.

Rgds

User avatar
rcrsn51
Posts: 13096
Joined: Tue 05 Sep 2006, 13:50
Location: Stratford, Ontario

#68 Post by rcrsn51 »

Apparently, the phrase "Unknown network device (smb)" was actually used by earlier versions of CUPS instead of "Windows Printer via SAMBA".

If I were you, I would download another copy of Puppy and try again.

User avatar
rcrsn51
Posts: 13096
Joined: Tue 05 Sep 2006, 13:50
Location: Stratford, Ontario

#69 Post by rcrsn51 »

[Update] "Unknown network device (smb)" is a message from CUPS when it cannot access a backend device properly.

Have you always been running Pnethood before you run CUPS? If so, don't.

User avatar
steve_s
Posts: 1595
Joined: Mon 26 May 2008, 13:29
Location: Austin, TX, USA
Contact:

#70 Post by steve_s »

rcrsn51 wrote:[Update] "Unknown network device (smb)" is a message from CUPS when it cannot access a backend device properly.

Have you always been running Pnethood before you run CUPS? If so, don't.
I cannot swear that I have not always done that with the 4.2 frugal; I will try without it. I will also try patriot's suggestion...your efforts are very appreciated, both of you. I would very much love to get this going... 8)

User avatar
steve_s
Posts: 1595
Joined: Mon 26 May 2008, 13:29
Location: Austin, TX, USA
Contact:

#71 Post by steve_s »

Ahhh...good times.

CUPS, didn't pnethood, no dice, still same effect.

smbspool worked! But only if it is a text file, otherwise a one page document of anything but text prints 85 pages (give or take) of giberish, like it is doing right now...unplugging it didn't kill the queue, by the way, can't get it to stop... :? such fun... :roll: wife's gonna kill me...how do I get it stop?! Obviously I need to figure some things out...

Ok, does this new info help us at all get this figured out?

**Edit: ok, it quit printing..y'all can quit laughing now... :D I still need to figure out what to do with this new info, though...

User avatar
rcrsn51
Posts: 13096
Joined: Tue 05 Sep 2006, 13:50
Location: Stratford, Ontario

#72 Post by rcrsn51 »

I was able to generate the "Unknown network device (smb)" message by replacing /opt/samba/bin/smbspool with a garbage version. I have attached the good copy for you to compare.

Sending a file directly to a printer with a command like smbclient without first processing it through the appropriate printer driver will most definitely produce a lot of waste paper.

User avatar
steve_s
Posts: 1595
Joined: Mon 26 May 2008, 13:29
Location: Austin, TX, USA
Contact:

#73 Post by steve_s »

rcrsn51 wrote:I was able to generate the "Unknown network device (smb)" message by replacing /opt/samba/bin/smbspool with a garbage version. I have attached the good copy for you to compare.

Sending a file directly to a printer with a command like smbclient without first processing it through the appropriate printer driver will most definitely produce a lot of waste paper.
And there it is! rcrsn51, you the man! That fixed it exactly! Downloaded it, fixed the sym link again, restarted cups, Windows printer on Samba was there like it should be, all systems go...can print just fine now whenever I want! Awesome! Nicely done... 8)

User avatar
rcrsn51
Posts: 13096
Joined: Tue 05 Sep 2006, 13:50
Location: Stratford, Ontario

#74 Post by rcrsn51 »

Glad to help. But I don't understand how just one file in the ISO was bad, especially since you ran smbspool as separate command and it apparently did something.

By any chance is "smb" symlinked to the wrong file in /opt/samba/bin? You could boot off the Live CD and have a look.

User avatar
steve_s
Posts: 1595
Joined: Mon 26 May 2008, 13:29
Location: Austin, TX, USA
Contact:

#75 Post by steve_s »

rcrsn51 wrote:Glad to help. But I don't understand how just one file in the ISO was bad, especially since you ran smbspool as separate command and it apparently did something.

By any chance is "smb" symlinked to the wrong file in /opt/samba/bin? You could boot off the Live CD and have a look.
No, smbspool kicked back the same error either via command or within the cups format we tried...I will reboot in 4.2 livecd and try it again, but it looks like exactly that file was bad...I'll post back.

User avatar
steve_s
Posts: 1595
Joined: Mon 26 May 2008, 13:29
Location: Austin, TX, USA
Contact:

#76 Post by steve_s »

Well, it wasn't the first time, and certainly won't be the last: it was me, not 4.2. I must have used the wrong sym link or something, but it was me.

Just now I booted in 4.2, set up the internet connection, made sure the link was there (it was) and looked for the picture that you submitted, rcrsn51, as that was a little different than the initial instructions and, of course, it was exactly like you showed.

So, in this case, it was user error. Nice catch and nice job and, above all else in this case, thank you for your patience. 8)

User avatar
steve_s
Posts: 1595
Joined: Mon 26 May 2008, 13:29
Location: Austin, TX, USA
Contact:

#77 Post by steve_s »

Well, I've probably overstayed my welcome here on this thread and rcrsn51 probably hates me by now, but I have to at least ask.

I upgraded to 4.2.1. It killed my connection.

don't know why. When I use 4.2.1 by itself I have no problem setting up the connection.

If I use rcrsn51's smbspool download I don't have any luck; if I use the smbspool with 4.2.1 I don't have any luck...just can't get it to go. And by that I mean that the Windows shared SMB Printer is not on the list, only the "Unknown SMB printer" is on the list. I've changed the smbspool a couple of times, redid the link, rechecked that a couple of times, then restarted cups, can't get it to go.

But unless there is some special item in 4.2.1 then i can't imagine what it would be...I had to at least ask if anyone knew...thanks.

User avatar
steve_s
Posts: 1595
Joined: Mon 26 May 2008, 13:29
Location: Austin, TX, USA
Contact:

#78 Post by steve_s »

Well, can't tell you why it worked, but I followed this murga link and it killed the smbspool link. So, redid the link, everything works.

:wink:

Don't know why. Something about how it over wrote the current cups kicked it, perhaps? Not sure. Even though I had installed other ways and other cups and redid the link and the smbspool multiple times, this was the one that had done it.

User avatar
growler
Posts: 209
Joined: Mon 24 Mar 2008, 04:42
Location: Kapiti - New Zealand

Experience with 4.2.1

#79 Post by growler »

I had all sorts of problems getting this to work - I have a HP Deskjet 840C on a windows XP SP2 machine which is shared on that machine as HPDesk
I had given it a static IP address of 192.168.0.3

I had an existing link in /usr/lib/cups/backend/smb that linked happily to /opt/samba/bin/smbspool

I tried another version of smbspool that I got off another forum thread - it was actually the identical size in bytes to the one I had so I don't think this was an issue.

I tried several versions of CUPS - the version that came in 4.2.1 of course, then I tried cups-1.4b2-patched-i386.pet and finally cups-1.3.10-i486.pet both from the ibiblio unleashed packages for 4 at:

ftp://ibiblio.org/pub/linux/distributio ... ackages-4/

I am not sure these were the issue.

I had set up cups with the DEVICE_URI of

smb://Administrator@192.168.0.3/HPDesk

but consistently got the error:

Code: Select all

/usr/lib/cups/backend/smb failed
The workgroup is CUDGELCONE (don't ask - it's my son's PC!!)
so I tried setting up the printers with:

smb://Adminstrator@CUDGELCONE/192.168.0.3/HPDesk
smb://CUDGELCONE/192.168.0.3/HPDesk
smb://192.168.0.3/HPDesk

for the device URI - none worked :-(

I could print from rxvt using a little test.txt file I made up with:

Code: Select all

#smbspool smb://192.168.0.3/HPDesk 111 root "test" 1 '' test.txt
The key was that although when adding a new printer I never got the "Windows Printer Via Samba" option.

I did get an smb option and used this to enter the DEVICE_URI manually. From the command line the command:

Code: Select all

# lpinfo -v
network socket
network beh
network http
network ipp
network lpd
direct parallel:/dev/lp0
file pdf-writer:/dev/null
direct scsi
serial serial:/dev/ttyS0?baud=115200
network smb
showed network smb option available ok?

However, if you don't get a device option of "Windows Printer Via Samba" then there is some error with the link from /usr/lib/cups/backend/smb to /opt/samba/bin/smbspool

As suggested by steve_s post above (thanks Steve!!) I just deleted the existing link - which looked fine?? - and recreated it from ROX - you could equally use:

Code: Select all

#rm /usr/lib/cups/backend/smb
#ln -s /opt/samba/bin/smbspool /usr/lib/cups/backend/smb
The simplest DeviceURI

smb://192.168.0.3/HPDesk

did the trick

Hope this saves someone else!

User avatar
rcrsn51
Posts: 13096
Joined: Tue 05 Sep 2006, 13:50
Location: Stratford, Ontario

#80 Post by rcrsn51 »

It's strange how this symlink is corrupted on some people's installs. Did you do a fresh install of 4.2.1 or did you upgrade a pup_save from a previous version?

Post Reply