{"id":2338,"date":"2017-07-05T17:22:44","date_gmt":"2017-07-05T17:22:44","guid":{"rendered":"http:\/\/blog.paranoidprofessor.com\/?p=2338"},"modified":"2017-07-05T17:23:01","modified_gmt":"2017-07-05T17:23:01","slug":"reuse-a-pi-air-printing","status":"publish","type":"post","link":"https:\/\/blog.paranoidprofessor.com\/index.php\/2017\/07\/05\/reuse-a-pi-air-printing\/","title":{"rendered":"Reuse a Pi &#8211; Air printing"},"content":{"rendered":"<p>When the Raspberry Pi came out I went a but nuts and ended up getting a few of them. \u00a0I did give some away and did create some projects but unfortunately not all of my RasPi devices were a complete hit with the family.<\/p>\n<p>Eventually they got unplugged and ended up in a small box, and yesterday that small box fell over. \u00a0I don&#8217;t have enough people interested in ancient Rasberry Pi computers &#8211; they are simple model A and B pi&#8217;s.<\/p>\n<p>The raspberry pi has been out long enough that there should be a few new projects that these devices could be put into. The first project seemed to be a no-brainer. \u00a0My wife wanted to print to the printer from her iPad but was unable to. \u00a0It is possible to make this happen by using the common UNIX printing system or CUPS allows a server to act as a print server.<\/p>\n<p><a href=\"https:\/\/en.wikipedia.org\/wiki\/CUPS\" target=\"_blank\">CUPS\u00a0<\/a>uses the internet printing protocol (IPP) for managing print jobs and printer queues. \u00a0Despite the how obvious this solution seems it was actually created in 1997.<\/p>\n<h2>Step 1 &#8211; Install operating system<\/h2>\n<p>The only thing that was not immediately clear was if he old pi&#8217;s needed an old raspbian distribution or if a new distribution image could be used.<\/p>\n<p>There are two different ways to determine this. \u00a0The first is to download the latest distribution and give it a try. \u00a0However, apparently my SD cards have a &#8220;use by date&#8221;. \u00a0I suspect that this is the casee as my old sdcard worked for a short time and then had some odd behaviors.<\/p>\n<p>Everything did work just fine on a new SD card. \u00a0This information is also available from the Raspberry Pi <a href=\"https:\/\/www.raspberrypi.org\/forums\/viewtopic.php?f=66&amp;t=182813\" target=\"_blank\">forums <\/a>as well.<\/p>\n<p>The process of actually installing the operating system to a SD card is pretty well defined. \u00a0This is especially true for raspberry pi organization. \u00a0For more information on installing the operating system check out their <a href=\"https:\/\/www.raspberrypi.org\/documentation\/installation\/installing-images\/\" target=\"_blank\">guide<\/a>.<\/p>\n<p>I used the most current Raspbian that was available from April 10th 2017.<\/p>\n<h2>Step 2 &#8211; Install and configure Cups<\/h2>\n<p>Note: It would be a good idea to ensure that your <a href=\"https:\/\/www.openprinting.org\/printers\" target=\"_blank\">printer is supported<\/a> before trying to setup this solution. \u00a0In my case, the color laserjet CM1312nfi MFP was not in the list. \u00a0I did feel lucky with this printer as I have installed cups before on LinuxMint and I did not have any problems.<\/p>\n<p>Always a good idea to ensure that your repository is up to date before starting.<\/p>\n<pre><code>sudo apt-get update\r\nsudo apt-get upgrade<\/code><\/pre>\n<p><strong>Install the cups software<\/strong><\/p>\n<pre>sudo apt-get install cups<\/pre>\n<p><strong>Configure cups<\/strong><\/p>\n<p>The first command is to add the pi user to the printing group (lpadmin) so we do not need to use sudo. \u00a0The next command is to make cups available to the other computers on our network.<\/p>\n<pre>sudo usermod -a -G lpadmin pi\r\nsudo cupsctl --remote-any\r\nsudo \/etc\/init.d\/cups restart\r\n<\/pre>\n<p>Once we do these commands we must restart the service so the changes to the configuration file are used.<\/p>\n<p>Note: The cupsctl command simply modifies the\u00a0\/etc\/cups\/cupsd.conf configuration file. The changes are actually quite small, but just to make sure nothing is lost I would recommend that you use the cupsctl command. \u00a0The changes are highlighted at the end of this post.<\/p>\n<p><strong>Test Cups installation<\/strong><\/p>\n<p>This is just a matter of pointing your browser to the Raspberry pi that has cups installed. \u00a0Specifically both the machine and port. \u00a0When you do that, you should see a screen that looks similar to the following.<\/p>\n<p><a href=\"http:\/\/blog.paranoidprofessor.com\/wp-content\/uploads\/2017\/05\/cups-server-check-page.png\"><img decoding=\"async\" loading=\"lazy\" class=\"alignnone size-full wp-image-2383\" src=\"http:\/\/blog.paranoidprofessor.com\/wp-content\/uploads\/2017\/05\/cups-server-check-page.png\" alt=\"\" width=\"919\" height=\"751\" srcset=\"https:\/\/blog.paranoidprofessor.com\/wp-content\/uploads\/2017\/05\/cups-server-check-page.png 919w, https:\/\/blog.paranoidprofessor.com\/wp-content\/uploads\/2017\/05\/cups-server-check-page-300x245.png 300w, https:\/\/blog.paranoidprofessor.com\/wp-content\/uploads\/2017\/05\/cups-server-check-page-768x628.png 768w\" sizes=\"(max-width: 919px) 100vw, 919px\" \/><\/a><\/p>\n<p><strong>Setup a CUPS printer<\/strong><\/p>\n<p>The entire process from this point is really quite easy. Simply click on the link for Adding Printers and Classes.<\/p>\n<p><a href=\"http:\/\/blog.paranoidprofessor.com\/wp-content\/uploads\/2017\/05\/cups-add-printer0.png\"><img decoding=\"async\" loading=\"lazy\" class=\"alignnone size-full wp-image-2385\" src=\"http:\/\/blog.paranoidprofessor.com\/wp-content\/uploads\/2017\/05\/cups-add-printer0.png\" alt=\"\" width=\"923\" height=\"755\" srcset=\"https:\/\/blog.paranoidprofessor.com\/wp-content\/uploads\/2017\/05\/cups-add-printer0.png 923w, https:\/\/blog.paranoidprofessor.com\/wp-content\/uploads\/2017\/05\/cups-add-printer0-300x245.png 300w, https:\/\/blog.paranoidprofessor.com\/wp-content\/uploads\/2017\/05\/cups-add-printer0-768x628.png 768w\" sizes=\"(max-width: 923px) 100vw, 923px\" \/><\/a><\/p>\n<p>At the beginning I checked to see if my printer was supported (<a href=\"https:\/\/www.openprinting.org\/printers\" target=\"_blank\">https:\/\/www.openprinting.org\/printers<\/a>) and my exact printer was not in the list. However, I have had a lot of luck with HP printers so I went ahead anyway.<\/p>\n<p>I tried the &#8220;Find New Printers&#8221; option but it did not find my network printer so I simply tried to add a new printer. \u00a0CUPS did manage to see more printer information relevant to my printer.<\/p>\n<p><a href=\"http:\/\/blog.paranoidprofessor.com\/wp-content\/uploads\/2017\/05\/cups-add-printer1.png\"><img decoding=\"async\" loading=\"lazy\" class=\"alignnone size-full wp-image-2384\" src=\"http:\/\/blog.paranoidprofessor.com\/wp-content\/uploads\/2017\/05\/cups-add-printer1.png\" alt=\"\" width=\"920\" height=\"754\" srcset=\"https:\/\/blog.paranoidprofessor.com\/wp-content\/uploads\/2017\/05\/cups-add-printer1.png 920w, https:\/\/blog.paranoidprofessor.com\/wp-content\/uploads\/2017\/05\/cups-add-printer1-300x246.png 300w, https:\/\/blog.paranoidprofessor.com\/wp-content\/uploads\/2017\/05\/cups-add-printer1-768x629.png 768w\" sizes=\"(max-width: 920px) 100vw, 920px\" \/><\/a><\/p>\n<p style=\"text-align: center;\">Step 1<\/p>\n<p>&nbsp;<\/p>\n<p><a href=\"http:\/\/blog.paranoidprofessor.com\/wp-content\/uploads\/2017\/05\/cups-add-printer2.png\"><img decoding=\"async\" loading=\"lazy\" class=\"alignnone size-medium wp-image-2378\" src=\"http:\/\/blog.paranoidprofessor.com\/wp-content\/uploads\/2017\/05\/cups-add-printer2-300x245.png\" alt=\"\" width=\"300\" height=\"245\" srcset=\"https:\/\/blog.paranoidprofessor.com\/wp-content\/uploads\/2017\/05\/cups-add-printer2-300x245.png 300w, https:\/\/blog.paranoidprofessor.com\/wp-content\/uploads\/2017\/05\/cups-add-printer2-768x627.png 768w, https:\/\/blog.paranoidprofessor.com\/wp-content\/uploads\/2017\/05\/cups-add-printer2.png 921w\" sizes=\"(max-width: 300px) 100vw, 300px\" \/><\/a>\u00a0 \u00a0 \u00a0 \u00a0 \u00a0\u00a0<a href=\"http:\/\/blog.paranoidprofessor.com\/wp-content\/uploads\/2017\/05\/cups-add-printer3.png\"><img decoding=\"async\" loading=\"lazy\" class=\"alignnone size-medium wp-image-2379\" src=\"http:\/\/blog.paranoidprofessor.com\/wp-content\/uploads\/2017\/05\/cups-add-printer3-300x244.png\" alt=\"\" width=\"300\" height=\"244\" srcset=\"https:\/\/blog.paranoidprofessor.com\/wp-content\/uploads\/2017\/05\/cups-add-printer3-300x244.png 300w, https:\/\/blog.paranoidprofessor.com\/wp-content\/uploads\/2017\/05\/cups-add-printer3-768x625.png 768w, https:\/\/blog.paranoidprofessor.com\/wp-content\/uploads\/2017\/05\/cups-add-printer3.png 923w\" sizes=\"(max-width: 300px) 100vw, 300px\" \/><\/a><\/p>\n<p style=\"text-align: center;\">Step 2 \u00a0 \u00a0 \u00a0 \u00a0 \u00a0 \u00a0 \u00a0 \u00a0 \u00a0 \u00a0 \u00a0 \u00a0 \u00a0 \u00a0 \u00a0 \u00a0 \u00a0 \u00a0 \u00a0 \u00a0 \u00a0 \u00a0 \u00a0 \u00a0 \u00a0 \u00a0 \u00a0 \u00a0 \u00a0 \u00a0 \u00a0 \u00a0 \u00a0 \u00a0 \u00a0 \u00a0 \u00a0 \u00a0 \u00a0 \u00a0 \u00a0 \u00a0 \u00a0 \u00a0Step 3<\/p>\n<p>&nbsp;<\/p>\n<p style=\"text-align: center;\"><a href=\"http:\/\/blog.paranoidprofessor.com\/wp-content\/uploads\/2017\/05\/cups-add-printer4.png\"><img decoding=\"async\" loading=\"lazy\" class=\"alignnone size-medium wp-image-2380\" src=\"http:\/\/blog.paranoidprofessor.com\/wp-content\/uploads\/2017\/05\/cups-add-printer4-300x246.png\" alt=\"\" width=\"300\" height=\"246\" srcset=\"https:\/\/blog.paranoidprofessor.com\/wp-content\/uploads\/2017\/05\/cups-add-printer4-300x246.png 300w, https:\/\/blog.paranoidprofessor.com\/wp-content\/uploads\/2017\/05\/cups-add-printer4-768x630.png 768w, https:\/\/blog.paranoidprofessor.com\/wp-content\/uploads\/2017\/05\/cups-add-printer4.png 917w\" sizes=\"(max-width: 300px) 100vw, 300px\" \/><\/a><\/p>\n<p style=\"text-align: center;\">\u00a0Step 4<\/p>\n<p style=\"text-align: center;\"><a href=\"http:\/\/blog.paranoidprofessor.com\/wp-content\/uploads\/2017\/05\/cups-add-printer5.png\"><img decoding=\"async\" loading=\"lazy\" class=\"alignnone size-full wp-image-2381\" src=\"http:\/\/blog.paranoidprofessor.com\/wp-content\/uploads\/2017\/05\/cups-add-printer5.png\" alt=\"\" width=\"920\" height=\"750\" srcset=\"https:\/\/blog.paranoidprofessor.com\/wp-content\/uploads\/2017\/05\/cups-add-printer5.png 920w, https:\/\/blog.paranoidprofessor.com\/wp-content\/uploads\/2017\/05\/cups-add-printer5-300x245.png 300w, https:\/\/blog.paranoidprofessor.com\/wp-content\/uploads\/2017\/05\/cups-add-printer5-768x626.png 768w\" sizes=\"(max-width: 920px) 100vw, 920px\" \/><\/a><\/p>\n<p style=\"text-align: center;\">Step 5<\/p>\n<p style=\"text-align: left;\">In step 3, as my exact printer model was not in the list I selected &#8220;HP Color LaserJet Series PCL 6 CUPS(en)&#8221; as my model and continued. \u00a0The printer appears to have been installed for CUPS.<\/p>\n<p style=\"text-align: left;\">In order to give this better test, select &#8220;Print Test Page&#8221; from the Maintenance drop down to generate a test page.<\/p>\n<p>&nbsp;<\/p>\n<h2>Step 3 &#8211; Using the newly setup printer<\/h2>\n<p>Well, there is really not much to say here. \u00a0In my experiment after setting everything up printing was super easy. \u00a0I just picked up the tablet and from an application, safari in my case, I pressed the print symbol and saw that my printer was an available option.<\/p>\n<p>&nbsp;<\/p>\n<p><strong>Printing from Apple Phone, IPad or IPad Touch<\/strong><br \/>\n<a href=\"https:\/\/support.apple.com\/en-au\/HT201387\">https:\/\/support.apple.com\/en-au\/HT201387<\/a><\/p>\n<p>When reading up on this there were a couple of things that other people said might be necessary. \u00a0In order to publish the printer name I might need to install avahi.<\/p>\n<blockquote><p>sudo apt-get install avahi-daemon<\/p><\/blockquote>\n<p>I did not have to install avahi in my case.<\/p>\n<p>It was also mentioned that after setting everything up you might need to wait about 5 minutes for the printer name to be disseminated across the network.\u00a0I suppose I did wait for a while but I cannot say how long.<\/p>\n<p>Also, apple does provide pretty good possibilities for windows computers as well. \u00a0The protocol that they use to disseminate the printer information is bonjour. \u00a0They even make available a client for your windows program so you can take advantage of this as well.<\/p>\n<blockquote><p><a href=\"https:\/\/support.apple.com\/kb\/DL999?locale=en_US\">https:\/\/support.apple.com\/kb\/DL999?locale=en_US<\/a><\/p><\/blockquote>\n<p>&nbsp;<\/p>\n<p><strong>Original cupsd.conf<\/strong><\/p>\n<pre>#\r\n# Sample configuration file for the CUPS scheduler. See \"man cupsd.conf\" for a\r\n# complete description of this file.\r\n#\r\n\r\n# Log general information in error_log - change \"warn\" to \"debug\"\r\n# for troubleshooting...\r\nLogLevel warn\r\n\r\n# Deactivate CUPS' internal logrotating, as we provide a better one, especially\r\n# LogLevel debug2 gets usable now\r\nMaxLogSize 0\r\n\r\n<span style=\"color: #0000ff;\"># Only listen for connections from the local machine.<\/span>\r\n<span style=\"color: #0000ff;\">Listen localhost:631<\/span>\r\n<span style=\"color: #0000ff;\">Listen \/var\/run\/cups\/cups.sock<\/span>\r\n\r\n# Show shared printers on the local network.\r\nBrowsing On\r\nBrowseLocalProtocols dnssd\r\n\r\n# Default authentication type, when authentication is required...\r\nDefaultAuthType Basic\r\n\r\n# Web interface setting...\r\nWebInterface Yes\r\n\r\n<span style=\"color: #ff0000;\"># Restrict access to the server...<\/span>\r\n<span style=\"color: #ff0000;\">&lt;Location \/&gt;<\/span>\r\n<span style=\"color: #ff0000;\"> Order allow,deny<\/span>\r\n<span style=\"color: #ff0000;\">&lt;\/Location&gt;<\/span>\r\n\r\n<span style=\"color: #339966;\"># Restrict access to the admin pages...<\/span>\r\n<span style=\"color: #339966;\">&lt;Location \/admin&gt;<\/span>\r\n<span style=\"color: #339966;\"> Order allow,deny<\/span>\r\n<span style=\"color: #339966;\">&lt;\/Location&gt;\r\n<\/span>\r\n<span style=\"color: #cc99ff;\"># Restrict access to configuration files...<\/span>\r\n<span style=\"color: #cc99ff;\">&lt;Location \/admin\/conf&gt;<\/span>\r\n<span style=\"color: #cc99ff;\"> AuthType Default<\/span>\r\n<span style=\"color: #cc99ff;\"> Require user @SYSTEM<\/span>\r\n<span style=\"color: #cc99ff;\"> Order allow,deny<\/span>\r\n<span style=\"color: #cc99ff;\">&lt;\/Location&gt;<\/span>\r\n\r\n... rest of file follows ...<\/pre>\n<p><strong>Changed cupds.conf\u00a0<\/strong><\/p>\n<pre>LogLevel warn\r\nMaxLogSize 0\r\n<span style=\"color: #0000ff;\"># Allow remote access<\/span>\r\n<span style=\"color: #0000ff;\">Port 631<\/span>\r\n<span style=\"color: #0000ff;\">Listen \/var\/run\/cups\/cups.sock<\/span>\r\nBrowsing On\r\nBrowseLocalProtocols dnssd\r\nDefaultAuthType Basic\r\nWebInterface Yes\r\n<span style=\"color: #ff0000;\">&lt;Location \/&gt;<\/span>\r\n<span style=\"color: #ff0000;\"> # Allow remote access...<\/span>\r\n<span style=\"color: #ff0000;\"> Order allow,deny<\/span>\r\n<span style=\"color: #ff0000;\"> Allow all<\/span>\r\n<span style=\"color: #ff0000;\">&lt;\/Location&gt;<\/span>\r\n<span style=\"color: #339966;\">&lt;Location \/admin&gt;<\/span>\r\n&lt;\/Location&gt;\r\n<span style=\"color: #cc99ff;\">&lt;Location \/admin\/conf&gt;\r\n AuthType Default\r\n Require user @SYSTEM\r\n&lt;\/Location&gt;<\/span>\r\n\r\n... rest of file follows ...<\/pre>\n","protected":false},"excerpt":{"rendered":"<p>When the Raspberry Pi came out I went a but nuts and ended up getting a few of them. \u00a0I did give some away and did create some projects but unfortunately not all of my RasPi devices were a complete &hellip; <a href=\"https:\/\/blog.paranoidprofessor.com\/index.php\/2017\/07\/05\/reuse-a-pi-air-printing\/\">Continue reading <span class=\"meta-nav\">&rarr;<\/span><\/a><\/p>\n","protected":false},"author":1,"featured_media":0,"comment_status":"open","ping_status":"open","sticky":false,"template":"","format":"standard","meta":[],"categories":[20],"tags":[],"_links":{"self":[{"href":"https:\/\/blog.paranoidprofessor.com\/index.php\/wp-json\/wp\/v2\/posts\/2338"}],"collection":[{"href":"https:\/\/blog.paranoidprofessor.com\/index.php\/wp-json\/wp\/v2\/posts"}],"about":[{"href":"https:\/\/blog.paranoidprofessor.com\/index.php\/wp-json\/wp\/v2\/types\/post"}],"author":[{"embeddable":true,"href":"https:\/\/blog.paranoidprofessor.com\/index.php\/wp-json\/wp\/v2\/users\/1"}],"replies":[{"embeddable":true,"href":"https:\/\/blog.paranoidprofessor.com\/index.php\/wp-json\/wp\/v2\/comments?post=2338"}],"version-history":[{"count":12,"href":"https:\/\/blog.paranoidprofessor.com\/index.php\/wp-json\/wp\/v2\/posts\/2338\/revisions"}],"predecessor-version":[{"id":2499,"href":"https:\/\/blog.paranoidprofessor.com\/index.php\/wp-json\/wp\/v2\/posts\/2338\/revisions\/2499"}],"wp:attachment":[{"href":"https:\/\/blog.paranoidprofessor.com\/index.php\/wp-json\/wp\/v2\/media?parent=2338"}],"wp:term":[{"taxonomy":"category","embeddable":true,"href":"https:\/\/blog.paranoidprofessor.com\/index.php\/wp-json\/wp\/v2\/categories?post=2338"},{"taxonomy":"post_tag","embeddable":true,"href":"https:\/\/blog.paranoidprofessor.com\/index.php\/wp-json\/wp\/v2\/tags?post=2338"}],"curies":[{"name":"wp","href":"https:\/\/api.w.org\/{rel}","templated":true}]}}