Enable Air Print to print via iphone on Unraid Server


Recommended Posts

Thanks for the write up.  I will see what I can do later on about getting this up and running via an unMenu package.  As it seems to require avahi I will probably be forces to make the package 5.0bX only.

 

The only thing that is going to be a pain in the arse is that there looks to be some printer specific driver related stuff (like for your Samsung).  I will have to look into that more as I don't know how "wide spread" that type of thing is.  I have my old HP LaserJet 5P set up via p910nd and then via CUPS on my Mac.  It works a treat for that but I have had the one room mate already ask if it was possible to print from her iPhone to the LaserJet.

Link to comment
  • Replies 54
  • Created
  • Last Reply

Top Posters In This Topic

Sorry if this seems a little bit of a hijack but since you're both looking at printing.............

 

What are the chances of getting Google Cloud Print on unraid using this bit of python? https://github.com/armooo/cloudprint

 

I've got some days off soon to have a play myself but thought you might be able to steer me in the right direction.

Doesn't look hard at all if you've got a proper CUPS setup. Just get everything installed and skip the avahi configuration and start the cloud print python script instead.

 

Edit: fixed formatting

Link to comment
  • 4 weeks later...

  • Download the cupsd.conf from my post above and copy it to /boot/config/cups
     

unfortunately I get a 404 following that link.

 

  • Generate your PPD file (this is Samsung printer specific) for foomatic from this page and save it to /boot/config/cups/ppd

Looks like only Samsung printers with an "ML" model number are supported.  Are there any solutions for other samsung printers?  Mine is a Samsung scx-4623fw

 

 

Link to comment

unfortunately I get a 404 following that link.

It's a forum attachment, I can't fix that...

 

Looks like only Samsung printers with an "ML" model number are supported.  Are there any solutions for other samsung printers?  Mine is a Samsung scx-4623fw

A quick google says that there's a unified driver that should work. I'm only providing instructions for mine (and similar) printers because it's hours and hours of work to get the configuration right.

 

You can hope someone who knows what they're doing has the same printer as you and will provide the instructions :)

Link to comment

YES! I got AirPrint working to my Samsung SCX-4623FW - printing straight to my printer (via unraid) from my iPhone and iPad

mikezs - thanks for pointing me in the right place.

 

Here's what I needed to get my printer working, but the changes are likely the same for all the other printer models that are supported in Samsung's Unified Linux Drivers: CLP*, CLX*, MFP*, ML*, SCX*, SF531P - I've posted a full list here: http://pastebin.com/7jQmEpLA

 

The main differences to what's already been posted above are:

[*]uses drivers found in Samsung's unified drivers so no need to use foomatic or to build your own PPD

[*]you'll need some different libraries, mentioned below.

 

You can download the Unified Linux Drivers from Samsung's website, and then extract it using: tar -zxvf UnifiedLinuxDriver_0.95.tar.gz

The files you'll need in UnifiedLinuxDriver_0.95.tar.gz are your printer's ppd driver file (mine's called scx4623fw.ppd) and the filters.  Place all the filters from the extracted Samsung's Unified Printer Drivers (/cdroot/Linux/x86_64/at_root/usr/lib64/cups/filter/) in /boot/config/cups/filter/

Also, place your PPD printer driver (scx4623fw.ppd in my case) in /boot/config/cups/ppd - you'll find the drivers in Samsung's Unified Printer Drivers mentioned above:

 

Place the cupsd.conf file (downloadable from one of the posts above) in /boot/config/cups/

Note: in cupsd.conf you'll probably need to add this one line below just under "Port 631" to print from an iDevice, otherwise you'll get an error.  If you make changes to this .conf file whilst CUPS is running, use "/etc/rc.d/rc.cups restart" for the changes to take effect.



ServerAlias *

 

Now for the 1st time installation:



cd /boot/packages
wget http://slackware.cs.utah.edu/pub/slackware/slackware-13.1/slackware/l/libtiff-3.9.2-i486-1.txz
wget http://slackware.cs.utah.edu/pub/slackware/slackware-13.1/slackware/l/libpng-1.4.2-i486-1.txz
wget http://slackware.cs.utah.edu/pub/slackware/slackware-13.1/slackware/l/libjpeg-v8a-i486-1.txz
wget http://slackware.cs.utah.edu/pub/slackware/slackware-13.0/slackware/l/libjpeg-6b-i486-5.txz
wget http://slackware.cs.utah.edu/pub/slackware/slackware-13.1/slackware/x/fontconfig-2.8.0-i486-1.txz
wget http://slackware.cs.utah.edu/pub/slackware/slackware-13.1/slackware/l/freetype-2.3.12-i486-1.txz
wget http://slackware.cs.utah.edu/pub/slackware/slackware-13.1/slackware/a/cups-1.4.3-i486-3.txz
wget http://slackware.cs.utah.edu/pub/slackware/slackware-13.1/slackware/l/poppler-0.12.4-i486-1.txz #need this to get pdftops and pstops working
wget http://slackware.cs.utah.edu/pub/slackware/slackware-13.1/slackware/l/lcms-1.19-i486-1.txz
wget http://slackware.cs.utah.edu/pub/slackware/slackware-13.1/slackware/ap/ghostscript-8.71-i486-2.txz
wget http://slackware.cs.utah.edu/pub/slackware/slackware-13.1/slackware/l/pycups-1.9.48-i486-1.txz

installpkg libtiff-3.9.2-i486-1.txz
installpkg libpng-1.4.2-i486-1.txz
installpkg libjpeg-v8a-i486-1.txz
installpkg libjpeg-6b-i486-5.txz
installpkg fontconfig-2.8.0-i486-1.txz
installpkg freetype-2.3.12-i486-1.txz
installpkg poppler-0.12.4-i486-1.txz
installpkg lcms-1.19-i486-1.txz
installpkg ghostscript-8.71-i486-2.txz
installpkg cups-1.4.3-i486-3.txz
# Install pycups - Only needed this one time for airprint-generate.py
installpkg pycups-1.9.48-i486-1.txz

[ ! -d "/etc/cups" ] && mkdir /etc/cups
[ ! -d "/etc/cups/ppd" ] && mkdir /etc/cups/ppd
[ ! -d "/usr/lib/cups/filter" ] && mkdir /usr/lib/cups/filter
[ ! -d "/usr/share/cups/model/samsung" ] && mkdir /usr/share/cups/model/samsung

cp /boot/config/cups/ppd/* /usr/share/cups/model/samsung/ #not strictly necessary
#I needed to call it 'Samsung_SCX-4623FW' because I named it as that in CUPS's webUI admin, and hence it's defined as this in printers.conf as 'Samsung_SCX-4623FW'
cp /boot/config/cups/ppd/scx4623fw.ppd /etc/cups/ppd/Samsung_SCX-4623FW.ppd
rm /etc/cups/cupsd.conf
ln -sf /boot/config/cups/cupsd.conf /etc/cups/cupsd.conf
cp /boot/config/cups/filter/* /usr/lib/cups/filter/
chmod +x /etc/rc.d/rc.cups
/etc/rc.d/rc.cups start

 

go to http://tower:631/admin in the browser to see if CUPS is now working, and add & configure your printer via the webUI admin, then...



#create a backup copy of the printer config for next time...
cp /etc/cups/printers.conf /boot/config/cups/

 

Generate the avahi service scripts for your printer that points to the CUPS printer. See mikezs's post above regarding the airprint-generate.py python script that does this automatically.  You'll need to install python via unmenu just to run this script the one time - you don't need python or airprint-generate.py after it's generated the .service file in /boot/config/cups/service/



cp /boot/config/cups/service/*.service /etc/avahi/services/

 

Now it should all be working.

Make sure you get the "Test Print" function in CUPS's admin console working (http://tower.local:631) before trying to print from your iDevice.

If the test print doesn't work, use "cat /var/log/cups/error_log" to check for detailed errors.

 

Finally, if it's all working & printing from your iPhone, for persistance on the next reboot place the following in the Go script...



#######################
# Printer START
#######################
cd /boot/packages
installpkg libtiff-3.9.2-i486-1.txz
installpkg libpng-1.4.2-i486-1.txz
installpkg libjpeg-v8a-i486-1.txz
installpkg libjpeg-6b-i486-5.txz
installpkg fontconfig-2.8.0-i486-1.txz
installpkg freetype-2.3.12-i486-1.txz
installpkg poppler-0.12.4-i486-1.txz
installpkg lcms-1.19-i486-1.txz
installpkg ghostscript-8.71-i486-2.txz
installpkg cups-1.4.3-i486-3.txz

[ ! -d "/etc/cups" ] && mkdir /etc/cups
[ ! -d "/etc/cups/ppd" ] && mkdir /etc/cups/ppd
[ ! -d "/usr/lib/cups/filter" ] && mkdir /usr/lib/cups/filter
[ ! -d "/usr/share/cups/model/samsung" ] && mkdir /usr/share/cups/model/samsung
cp /boot/config/cups/ppd/* /usr/share/cups/model/samsung/ #not strictly necessary
#need to call it 'Samsung_SCX-4623FW' because it's defined in printers.conf as 'Samsung_SCX-4623FW'
cp /boot/config/cups/ppd/scx4623fw.ppd /etc/cups/ppd/Samsung_SCX-4623FW.ppd
rm /etc/cups/cupsd.conf
ln -sf /boot/config/cups/cupsd.conf /etc/cups/cupsd.conf
rm /etc/cups/printers.conf
ln -sf /boot/config/cups/printers.conf /etc/cups/printers.conf
cp /boot/config/cups/filter/* /usr/lib/cups/filter/
chmod +x /etc/rc.d/rc.cups
/etc/rc.d/rc.cups start
cp /boot/config/cups/service/*.service /etc/avahi/services/

#######################
# Printer END
#######################

Link to comment
  • 2 weeks later...

mikezs and capler thank you! 

 

You inspired me to get my Canon PIXMA MP610 working from UnRAID & CUPS with particular emphasis on having AirPrint available.  Thanks to you both, I've been successful. 

 

After a painful day of compiling Canon binaries from source, finding PPD files and getting my head around CUPS, I was all set to give up about an hour ago having managed to make the printer accessible from Windows PC's and even from iPhone/iPad, but the latter would print and nothing came out!  Not a thing in the logs even after turning up the debug level.  I figured out it was giving up somewhere in the ghostscript phase but the damn thing was even creating spool jobs!

 

Then I came across an application called 'gutenprint' (formally Gimp-Print).  Installed the package, created a new printer - this time with the actual make/model showing up in CUPS and that got me a lot closer much quicker.

 

The main hassle I had was getting hold of the PPD for my printer and also the filter file.  In the end I compiled the filter from source on a slackware system.  I'm not sure how specific the filter file is, but I get the impression its pretty generic across at least the PIXMA range and maybe more.  The PPD can be extracted from the Linux source file available from Canon.  It's just the filter that's a pain.

 

Here's a link to the Canon file I used;

http://support-asia.canon-asia.com/contents/ASIA/EN/0100084103.html

 

The same file is also available on my DropBox + a zip of the compiled binaries.

http://db.tt/BdpU0trI

Extract the file "pstocanonij" from the rar and put in "/usr/lib/cups/filter".  You can ignore the other two, I don't think they're needed as CUPS already has equivalents.

 

I wanted to keep things minimal so at first I installed only ghostscript, cups and gutenprint, but the printer model wasn't showing up in CUPS.  So I went for the scatter-gun approach and loaded all the other packages capler mentions in his installation.  That seemed to do the trick.  I might go back and see what I can strip out, but then again probably not.

 

Gutenprint supports a quite a few makes and models, so might be worth baring in mind for others like myself.

 

I won't repeat all the steps again, suffice to say I followed what's already been documented but added;

 

wget http://slackware.cs.utah.edu/pub/slackware/slackware-13.1/slackware/ap/gutenprint-5.2.4-i486-2.txz

&

installpkg gutenprint-5.2.4-i486-2.txz

 

Also on my Dropbox is a copy of the script I use to install and - minus the wgets - as a script to install upon reboot.

 

Work was done on v5.0b12a UnRAID. 

 

 

Regards,

RJ

Link to comment
  • 3 weeks later...

I've attached my cupsd.conf which everyone should be able to use. (put it in your flash drive in the config/cups folder, or mkdir /boot/config/cups and stick it in there)

 

Here's what's currently in my go script

 

#######################
# Printer
#######################
installpkg jbigkit-2.0-i486-3sl.txz
installpkg splix-2.0.0-i486-2cd.txz
installpkg cups-1.4.3-i486-3.txz
rm /etc/cups/cupsd.conf
ln -s /boot/config/cups/cupsd.conf /etc/cups/cupsd.conf
chmod +x /etc/rc.d/rc.cups
/etc/rc.d/rc.cups start

 

The config file still needs authentication with a password, so you need to set a root password that isn't blank if you only have that user.

 

Sorry but I'm struggling to set this up.

 

Any chance of some "simpler" instructions for a newbie to follow?

 

I have a Samsung ML 1915.

Link to comment

  • Generate your PPD file (this is Samsung printer specific) for foomatic from this page and save it to /boot/config/cups/ppd

 

 

My Samsung ML 1915 isn't listed on this page. I think this is where I'm stuck.

 

The instructions posted by overbyrn above to use the universal samsung printer driver seem easier for a beginner than what I did (but does not have step by step instructions). He posted the PPD's and binaries that he built.

Link to comment

  • Generate your PPD file (this is Samsung printer specific) for foomatic from this page and save it to /boot/config/cups/ppd

 

 

My Samsung ML 1915 isn't listed on this page. I think this is where I'm stuck.

 

The instructions posted by overbyrn above to use the universal samsung printer driver seem easier for a beginner than what I did (but does not have step by step instructions). He posted the PPD's and binaries that he built.

 

I prefer your instructions as they're step by step. I'm just stuck on the bit where it says "Generate your PPD file". If someone could tell me how to get the PPD file for Samsung 1915.

Link to comment
  • 3 weeks later...

LOL.

 

OK. Please post when you get a chance.

 

Much appreciated.

 

If mike doesn't beat me to it over the next few days, I'll have a go at repeating the process I went through to get cups with gutenprint working and document an easier set of steps to follow. Thing is, I was configuring a Canon not Samsung so can probably only go so far before a step or two goes into theory.  That said, I did a bit of searching and others seem to have done similar for a Samsung 1915, albeit on different Linux distros.  Figure it's worth a try eh.

 

Link to comment
  • 2 months later...
  • 3 weeks later...

Right, got everything setup and configured now, so here's the full set of instructions to get my printer (and most Samsung printers) up and running:

 

Downloads:

  • Download the cupsd.conf from my post above and copy it to /boot/config/cups
     
  • Download the python airprint service creator from here and put the airprint-generate.py in /boot/config/cups/service
  • Generate your PPD file (this is Samsung printer specific) for foomatic from this page and save it to /boot/config/cups/ppd
  • After you've got those files, go back to unraid terminal and do:

cd /boot/packages
wget http://repository.slacky.eu/slackware-13.1/libraries/jbigkit/2.0/jbigkit-2.0-i486-3sl.txz
wget http://slackware.cs.utah.edu/pub/slackware/slackware-13.1/slackware/ap/ghostscript-8.71-i486-2.txz
wget http://slackware.cs.utah.edu/pub/slackware/slackware-13.1/slackware/ap/foomatic-filters-4.0.4-i486-1.txz
wget http://slackware.org.uk/salix/i486/13.1/salix/l/splix-2.0.0-i486-2cd.txz
wget http://slackware.cs.utah.edu/pub/slackware/slackware-13.1/slackware/a/cups-1.4.3-i486-3.txz
wget http://slackware.cs.utah.edu/pub/slackware/slackware-13.1/slackware/l/pycups-1.9.48-i486-1.txz

 

First time cups installation:

cd /boot/packages
# Install pycups for airprint-generate.py
installpkg pycups-1.9.48-i486-1.txz
# Required for Splix:
installpkg jbigkit-2.0-i486-3sl.txz
# Required for CUPS
installpkg ghostscript-8.71-i486-2.txz
# Foomatic filters for CUPS
installpkg foomatic-filters-4.0.4-i486-1.txz
# Copy our PPD (that we generated above) into the foomatic filters folder:
cp /boot/config/cups/ppd/* /usr/share/cups/model/samsung/ 
# Install SpliX for Samsung printers
installpkg splix-2.0.0-i486-2cd.txz
# Install the main CUPS package
installpkg cups-1.4.3-i486-3.txz
# Create a symbolic link to the cupsd.conf that you downloaded above:
ln -sf /boot/config/cups/cupsd.conf /etc/cups/cupsd.conf
# Make cups executable and run it:
chmod +x /etc/rc.d/rc.cups
/etc/rc.d/rc.cups start

 

CUPS first time configuration:

  • Fire up http://tower:631/admin. You should be greeted with the CUPS main page.
  • Click "Add printer"
  • Select your printer. Mine was usb://Samsung/ML-2010 under Local Printers:. Press continue.
  • Stick in the printer name, location and tick share this printer. Click continue.
  • Next screen is driver choice. Mine was Samsung, then Samsung ML-2010 Foomatic/gdi. It's important you choose the Foomatic/gdi one if you have a Samsung printer and generated the PPD file from the page above.
  • Click create printer and you should get a message saying it's been added successfully.

We now have a printer added and configured, so we want to create a copy of the configuration.

 

Back into the terminal:

cp /etc/cups/printers.conf /boot/config/cups/

 

Now we can generate the Avahi service for our shared printer to make it visible to our iDevice:

cd /boot/config/cups/service
python airprint-generate.py
cp *.service /etc/avahi/services/

 

That should be it! Try this command to see if your printer is listed as an internet printer:

avahi-browse -a -t | grep AirPrint

 

Mine shows as:

+   eth0 IPv4 AirPrint Samsung_ML-2010 @ Tower              Internet Printer     local

 

Adding persistance

All of this configuration will disappear when we reboot, so add this to your go script to make it all come back when you restart:

#######################
# Printer
#######################
installpkg jbigkit-2.0-i486-3sl.txz
installpkg ghostscript-8.71-i486-2.txz
installpkg foomatic-filters-4.0.4-i486-1.txz
cp /boot/config/cups/ppd/* /usr/share/cups/model/samsung/  
installpkg splix-2.0.0-i486-2cd.txz
installpkg cups-1.4.3-i486-3.txz
ln -sf /boot/config/cups/cupsd.conf /etc/cups/cupsd.conf
ln -sf /boot/config/cups/printers.conf /etc/cups/printers.conf
chmod +x /etc/rc.d/rc.cups
/etc/rc.d/rc.cups start
cp *.service /etc/avahi/services/

 

Most of that will look familiar from the commands we've used above.

 

Things to note:

  • The CUPS configuration is hard work! This is samsung printer specific at the moment, but should be applicable to other printers if you have the correct google skills.
  • printers.conf (that we took a copy of) will be overwritten if you add or modify a printer, so just be aware that you will have to re-copy if you do this (and you want the changes to persist over a reboot).
  • These instructions are for unRaid 5.0b14 or later (what I'm running)
  • I already have python installed and configured from SabNzbD+, you may have to install yourself to get airprint-generate.py to work

 

I'm installing this as per your guide.

 

I'm stuck at this point:

 

# Copy our PPD (that we generated above) into the foomatic filters folder:

cp /boot/config/cups/ppd/* /usr/share/cups/model/samsung/

 

When I do this I get the following error:

 

cp: cannot create regular file `/usr/share/cups/model/samsung/': Is a directory

root@Tower:/boot/packages#

 

Any help appreciated.

 

To try and get round the above I created a user share on the tower called share (not sure this was right but thought I'd try it nonetheless). I know get:

 

 

root@Tower:/boot/packages# # Make cups executable and run it:

root@Tower:/boot/packages# chmod +x /etc/rc.d/rc.cups

root@Tower:/boot/packages# /etc/rc.d/rc.cups start

/usr/sbin/cupsd: error while loading shared libraries: libldap-2.4.so.2: cannot open shared object file: No such file or directory

cups: unable to start scheduler.

root@Tower:/boot/packages#

 

Also I'm on UNRAID 4.7. Would this be related to my problem?

Link to comment
  • 2 weeks later...

baggies, did you ever get past the place you were stuck during copying PPD file? 

 

I was just revisiting this thread to get some general information as I'm trying to put together a cups plugin, although I stress for the moment the plugin is only useful for me or anyone using a Canon MP610.

 

Saw you'd asked for assistance and thought I'd see if you were still stuck and perhaps try to help if I can.

 

Link to comment

The write-up by mikezs is pretty comprehensive, although he uses different packages to that which I was able to use for the Canon I have. 

 

For the PPD file, did you successfully generate and download an appropriate PPD file from the openprinting.org web link he provided?  Assuming you had a Samsung 2010, you'd probably end up with a file called something like "Samsung-ML-2010-gdi.ppd" which would need to be saved to persistent storage.  Mike opted for /boot/config/cups/ppd as it'll reside on the flash drive.  Make the directory if it's not already present.  eg.

mkdir -p /boot/config/cups/ppd

 

Copy the Samsung-ML-2010-gdi.ppd file to this location and then a copy needs to go to /usr/share/cups/model/samsung/ which is a directory location created as part of installing cups package and this is accomplished from Mikes guide with

cp /boot/config/cups/ppd/* /usr/share/cups/model/samsung/ 

Probably wise to check the target directory path exists also.  Not sure if you need to create "samsung" underneath /usr/share/cups/model.  Looking at my setup, I don't have any sub-dirs created under /usr/share/cups/model and my canon ppd file lives at /usr/share/cups/model.  But perhaps for the Samsung and the way Mike works his config, CUPS needs the PPD file inside a subdir for the make of the printer. 

 

Not sure what else to advise until you can confirm what you've tried, how far you've got and whether any of the above is useful.

 

 

 

 

Link to comment

Join the conversation

You can post now and register later. If you have an account, sign in now to post with your account.
Note: Your post will require moderator approval before it will be visible.

Guest
Reply to this topic...

×   Pasted as rich text.   Restore formatting

  Only 75 emoji are allowed.

×   Your link has been automatically embedded.   Display as a link instead

×   Your previous content has been restored.   Clear editor

×   You cannot paste images directly. Upload or insert images from URL.