Friday, April 16, 2010

OS X 10.5 Samsung Printer Issues

OS X Printing Issues Anyone?


I have a Samsung ML-2010 Printer. I have had numerous issues printing with this thing from OS X v10.4 to 10.5 using USB and wireless connections (via the AirPort Exreme Base station v5.7, its older). I was able to remediate all my issues, and wanted to share the advice.


Issue 1: Large Margin on Every Page


Initially I was unable to get anything to print without a giant (2 in or so) margin at the top of every page; regardless of the print settings. This was cleared up by using the Open GDI print driver available from Samsung. Get the goods here:


http://www.linuxfoundation.org/collaborate/workgroups/openprinting/macosx/samsung-gdi


You need to download and install all three packages: Foomatic-RIP, Ghostrscript for Mac, and the Samsung-GDI package. There's a particular order this should be instaled in, but I don't know it; the package installers detect the dependency failures and let you know about them, so no worries. Print using this driver and the margin problem is gone (hopefully).


Issue 2: Printer Paused (after one successful print)


* These instructions should work for any printer, not just a Samsung


In OSX 10.4 printing to the Samsung ML-2010 via the AirPort Extreme Base station was flawless. After upgrading to OS X 10.5 I was only able to print one document at a time before print functionality was halted. The print queue indicated "Printer Paused" and all attempts to resume printing would result in the same error. Removing and re-adding the printer did nothing to fix the issue. The only way (I found) to restore print functionality was to reboot the AirPort Extreme Base station.


This was a huge pain. Based on some research I did trawling google results, this issue isn't limited to Samsung printers, so these instructions should work for any printer experiencing a similar problem. To get more info on the nature of the problem I opened up the System Console and took a look at the cups error_log. This revealed that after one successful print the system was "Unable to open" the printer device. Check it out below:


[Job ???] Request file type is application/pdf.

I [16/Apr/2010:12:50:06 -0700] [Job 1] Adding start banner page "none".

I [16/Apr/2010:12:50:06 -0700] [Job 1] Adding end banner page "none".

I [16/Apr/2010:12:50:06 -0700] [Job 1] File of type application/pdf queued by "asshead".

I [16/Apr/2010:12:50:06 -0700] [Job 1] Queued on "Samsung_ML_2010" by "asshead".

I [16/Apr/2010:12:50:06 -0700] [Job 1] Started filter /usr/libexec/cups/filter/cgpdftops (PID 8326)

I [16/Apr/2010:12:50:06 -0700] [Job 1] Started filter /usr/libexec/cups/filter/pstops (PID 8327)

I [16/Apr/2010:12:50:06 -0700] [Job 1] Started filter /usr/libexec/cups/filter/foomatic-rip (PID 8328)

I [16/Apr/2010:12:50:06 -0700] [Job 1] Started backend /usr/libexec/cups/backend/mdns (PID 8329)

I [16/Apr/2010:12:50:15 -0700] [Job 1] Completed successfully.

I [16/Apr/2010:12:51:52 -0700] [Job ???] Request file type is application/pdf.

I [16/Apr/2010:12:51:52 -0700] [Job 2] Adding start banner page "none".

I [16/Apr/2010:12:51:52 -0700] [Job 2] Adding end banner page "none".

I [16/Apr/2010:12:51:52 -0700] [Job 2] File of type application/pdf queued by "asshead".

I [16/Apr/2010:12:51:52 -0700] [Job 2] Queued on "Samsung_ML_2010" by "asshead".

I [16/Apr/2010:12:51:52 -0700] [Job 2] Started filter /usr/libexec/cups/filter/cgpdftops (PID 8344)

I [16/Apr/2010:12:51:52 -0700] [Job 2] Started filter /usr/libexec/cups/filter/pstops (PID 8345)

I [16/Apr/2010:12:51:52 -0700] [Job 2] Started filter /usr/libexec/cups/filter/foomatic-rip (PID 8346)

I [16/Apr/2010:12:51:52 -0700] [Job 2] Started backend /usr/libexec/cups/backend/mdns (PID 8347)

E [16/Apr/2010:12:52:22 -0700] [Job 2] Unable to open device (read failure)!

E [16/Apr/2010:12:52:22 -0700] PID 8347 (/usr/libexec/cups/backend/mdns) stopped with status 1!

I [16/Apr/2010:12:52:22 -0700] Hint: Try setting the LogLevel to "debug" to find out more.

I [16/Apr/2010:12:52:22 -0700] [Job 2] Backend returned status 1 (failed)


So what gives? I'd put money on a driver issue with Samsung, but who cares? This has nothing to do with the solution. On a number of forums I saw people suggesting that the printer could be setup as a HP JetDirect printer rather than a Bonjour printing device in it's default, auto-configured state. Here's the gist of it:


1. Go to System Preferences -> Printers


2. Click the '+' to add a printer.


3. Rather than using the auto-detected default, click the IP tab/button at the top.


4. Select HP Jet Direct - Socket from the Protocol pull down.


5. Enter the IP address of the base station. If you don't know your IP, open Utilities > Terminal and type the following:


$ networksetup -getinfo 'AirPort' | grep Router

Router: 10.0.1.1

IPv6 Router: none


6. Select the appropriate driver from the list. For me this was the Samsung ML-2010 Foomatic/GDI, your individual milage may vary.


7. Click Add.


For some people this process apparently works. For me, it failed. If you are in the same boat that I am, roll up your sleeves, because it's time to mess with CUPS or the common unix printing system.


Configuring an HP JetDirect printer with the AirPort Extreme Base Station fails because the HP JetDirect driver is trying to connect to the wrong port. By default, an HP JetDirect server operates on port 9100. The Apple printer setup utility is aware of this standard and blindly sends all print jobs to socket://10.0.1.1:9100 (btw don't try to put that into Safari, it doesn't speak socket). However, the AirPort Base Station doesn't conform to this standard and operates its internal HP JetDirect service on port 9101. I determined this by running a port scan against the router:


$ sudo nmap -sU -sS 10.0.1.1

Starting Nmap 4.90RC1 ( http://nmap.org ) at 2010-04-16 13:09 PDT

Interesting ports on 10.0.1.1:

Not shown: 1987 closed ports

PORT STATE SERVICE

53/tcp open domain

5009/tcp open airport-admin

9101/tcp open jetdirect

10000/tcp open snet-sensor-mgmt

53/udp open|filtered domain

67/udp open|filtered dhcps

68/udp open|filtered dhcpc

123/udp open ntp

161/udp open|filtered snmp

192/udp open|filtered osu-nms

514/udp open|filtered syslog

5351/udp open unknown

5353/udp open|filtered zeroconf

MAC Address: 00:0D:93:CB:83:B6 (Apple Computer)


You might have noticed that there is no way to define a port other than 9100 in the vanilla OS X printer setup utility. To gain access to more granular configuration details you have to use CUPS. Cups is basically a Unix printing standard, and is used by Mac OS X to fulfill all your printing dreams. Following the steps below will allow you to change the default HP JetDirect port from 9100 to 9101:


* Note that these instructions assume your AirPort Extreme is at 10.0.1.1 (this might not be the case for your router configuration - make changes where necessary). Also, this information is based on OS X 10.5. The CUPS HTTP interface in OS X 10.6 is similar, but slightly different.


1. Open up Safari.


2. Navigate to http://localhost:631


3. Select the Printers tab from the upper menu.


4. Find and click the Modify Printer button.


5. The information in the Location and Description fields should be OK, so click Continue.


6. On the Device screen ensure that 'AppSocket/HP JetDirect' is selected (it might be set to 'zeroconf registered printer' if you didn't try to add a JetDirect printer beforehand). Click Continue.


7. In the Device URI you'll either see socket:// or mdsn://, in either case change it to the following (again substitute your IP if it is different):


socket://10.0.1.1:9101


Click Continue.


8. The Make/Manufacturere option box should be set correctly (assuming you used the correct driver for you printer). In my case I selected 'Samsung'. Click Continue.


9. Finally, select the correct Printer Model (i.e. Driver). I selected 'Samsung ML-2010 Foomatic/gdi (en). Click Modify Printer.


10. Thats it. You might get some redirect error because CUPS attempts to redirect to an invalid URL. Don't worry, just go back to the initial URL:


http://localhost:631/printers


11. If the printer was stopped due to an error, restart it from here.


12. Click the Jobs tab at the top. If you have any stopped jobs, either restart them or delete them and re-print.


Thats it. You should now be able to print without any additional problems. I really hope these instructions helped someone out. I was going crazy trying to fix it.

1 comment:

Safdar Ali said...

Great post with nice details. I need a printer for printing plastic id cards for school children. Where i should get the best one?