{"id":2782,"date":"2017-11-16T13:59:40","date_gmt":"2017-11-16T05:59:40","guid":{"rendered":"http:\/\/tzlee.com\/blog\/?p=2782"},"modified":"2017-11-16T14:09:28","modified_gmt":"2017-11-16T06:09:28","slug":"raspberry-pi-print-server-with-no-server-side-driver","status":"publish","type":"post","link":"https:\/\/tzlee.com\/blog\/2017\/11\/raspberry-pi-print-server-with-no-server-side-driver\/","title":{"rendered":"Raspberry Pi print server with no server-side driver"},"content":{"rendered":"<p>There are numerous articles which step through how to configure CUPS to turn an RPi into a print server but I bumped into a problem because there are no drivers available for my Brother MFC-7340 printer for ARM (only available for i386) and I was not keen work on the source code\/compile\/etc.<\/p>\n<p>The quick fix is to turn it into a RAW (a.k.a. HP JetDirect) print server.<\/p>\n<h3>Install CUPS<\/h3>\n<pre>sudo apt-get install cups<\/pre>\n<h3>Configure CUPS<\/h3>\n<p>Edit <strong>\/etc\/cups\/cupsd.conf<\/strong>.<\/p>\n<p>Scroll down until you see the <strong>Listen<\/strong> configuration directive. Comment it out. This will make CUPS available over the network.<\/p>\n<pre># Only listen for connections from the local machine\r\n# Listen localhost:631\r\nPort 631<\/pre>\n<p>Look for the <strong>&lt;Location \/&gt;<\/strong> directive, and add <strong>Allow all<\/strong> (or a specific list of IPs, if your local network is not secure) to allow access.<\/p>\n<pre>&lt;Location \/&gt;\r\n  # Allow remote access...\r\n  Order allow,deny\r\n  Allow all\r\n&lt;\/Location&gt;\r\n<\/pre>\n<p>Save the file and restart CUPS.<\/p>\n<pre>sudo \/etc\/init.d\/cups restart<\/pre>\n<h3>Configure Printer<\/h3>\n<p>Now connect your printer to the USB port on the RPi.<\/p>\n<p>Now you should be able to use a browser and go to <span style=\"text-decoration: underline;\"><strong>https:\/\/<em>&lt;ip.address.of.rpi&gt;<\/em>:631\/admin<\/strong><\/span> to reach the CUPS web UI.<\/p>\n<ol>\n<li>Under <em>Printers<\/em>, click <strong>Add Printer<\/strong>.<\/li>\n<li>You should see your printer appear under <em>Local Printers<\/em>. Select it and click <strong>Continue<\/strong>.<\/li>\n<li>You can accept the default names on the next screen and click <strong>Continue<\/strong>.\n<ul>\n<li>You do <span style=\"text-decoration: underline;\"><em>not<\/em><\/span> need to enable <em>Share This Printer<\/em>.<\/li>\n<li>Make a note of the printer <em>Name<\/em>. You will need this later.<\/li>\n<\/ul>\n<\/li>\n<li>In the next screen, click on <strong>Select Another Make\/Manufacturer<\/strong>.\n<ul>\n<li>Select\u00a0<em>Raw<\/em> and click <strong>Continue<\/strong>.<\/li>\n<li>Select\u00a0<em>Raw Queue (en)<\/em> and click <strong>Add Printer<\/strong>.<\/li>\n<\/ul>\n<\/li>\n<\/ol>\n<h3>Install xinetd<\/h3>\n<pre>sudo apt-get install xinetd<\/pre>\n<h3>Configure xinetd<\/h3>\n<p>Edit <strong>\/etc\/services<\/strong> and scroll to the end. Add the following line:<\/p>\n<pre>jetdirect 9100\/tcp<\/pre>\n<p>Create a new file <strong>\/etc\/xinetd.d\/jetdirect<\/strong> and add the following, replacing <em>Brother_MFC-7340<\/em> with your printer name configured in CUPS above.<\/p>\n<pre>service jetdirect\r\n{\r\nsocket_type = stream\r\nprotocol = tcp\r\nwait = no\r\nuser = root\r\nserver = \/usr\/bin\/lp\r\nserver_args = -d Brother_MFC-7340 -o raw\r\ngroups = yes\r\ndisable = no\r\n}<\/pre>\n<p>Save the file and restart xinetd.<\/p>\n<pre style=\"padding-left: 30px;\">sudo \/etc\/init.d\/xinetd restart<\/pre>\n<h3>Connect your computer<\/h3>\n<p>Now, go to your computer and connect to the printer. These are steps for Macs.<\/p>\n<ul>\n<li>Go to <strong>System Preferences<\/strong> &gt;\u00a0<strong>Printers and Scanners<\/strong>.<\/li>\n<li>Click on <strong>[+]<\/strong> to add a new printer.<\/li>\n<li>Select <strong>IP<\/strong>\n<ul>\n<li>Address: &lt;ip.address.of.rpi&gt;<\/li>\n<li>Protocol: HP JetDirect<\/li>\n<li>Queue: &lt;Blank&gt;<\/li>\n<li>Name: Enter a name of your choice here, e.g. <em>Office Printer<\/em>.<\/li>\n<li>Use: Click <strong>Select Software<\/strong> and use the correct driver for your printer here.<\/li>\n<\/ul>\n<\/li>\n<\/ul>\n<p>You should now be able to print to the new printer on your Mac.<\/p>\n<p><em>P.S. Sometimes you may need to connect your printer via USB to your Mac so that it installs the correct drivers first, then you can unplug the USB and select the drivers when configuring IP printers.<\/em><\/p>\n","protected":false},"excerpt":{"rendered":"<p>There are numerous articles which step through how to configure CUPS to turn an RPi into a print server but I bumped into a problem because there are no drivers available for my Brother MFC-7340 printer for ARM (only available&#8230; <a class=\"more-link\" href=\"https:\/\/tzlee.com\/blog\/2017\/11\/raspberry-pi-print-server-with-no-server-side-driver\/\">Continue Reading &rarr;<\/a><\/p>\n","protected":false},"author":2,"featured_media":2790,"comment_status":"closed","ping_status":"closed","sticky":false,"template":"","format":"standard","meta":{"_jetpack_memberships_contains_paid_content":false,"footnotes":""},"categories":[8],"tags":[563,568,565,564,562,561,566,560,567],"class_list":["post-2782","post","type-post","status-publish","format-standard","has-post-thumbnail","hentry","category-tech","tag-brother","tag-cups","tag-jetdirect","tag-mfc","tag-printer","tag-raspberry-pi","tag-raw","tag-rpi","tag-socket"],"jetpack_featured_media_url":"https:\/\/tzlee.com\/blog\/wp-content\/uploads\/2017\/11\/IMG_1749-e1510812548701.jpg","jetpack_sharing_enabled":true,"_links":{"self":[{"href":"https:\/\/tzlee.com\/blog\/wp-json\/wp\/v2\/posts\/2782","targetHints":{"allow":["GET"]}}],"collection":[{"href":"https:\/\/tzlee.com\/blog\/wp-json\/wp\/v2\/posts"}],"about":[{"href":"https:\/\/tzlee.com\/blog\/wp-json\/wp\/v2\/types\/post"}],"author":[{"embeddable":true,"href":"https:\/\/tzlee.com\/blog\/wp-json\/wp\/v2\/users\/2"}],"replies":[{"embeddable":true,"href":"https:\/\/tzlee.com\/blog\/wp-json\/wp\/v2\/comments?post=2782"}],"version-history":[{"count":7,"href":"https:\/\/tzlee.com\/blog\/wp-json\/wp\/v2\/posts\/2782\/revisions"}],"predecessor-version":[{"id":2789,"href":"https:\/\/tzlee.com\/blog\/wp-json\/wp\/v2\/posts\/2782\/revisions\/2789"}],"wp:featuredmedia":[{"embeddable":true,"href":"https:\/\/tzlee.com\/blog\/wp-json\/wp\/v2\/media\/2790"}],"wp:attachment":[{"href":"https:\/\/tzlee.com\/blog\/wp-json\/wp\/v2\/media?parent=2782"}],"wp:term":[{"taxonomy":"category","embeddable":true,"href":"https:\/\/tzlee.com\/blog\/wp-json\/wp\/v2\/categories?post=2782"},{"taxonomy":"post_tag","embeddable":true,"href":"https:\/\/tzlee.com\/blog\/wp-json\/wp\/v2\/tags?post=2782"}],"curies":[{"name":"wp","href":"https:\/\/api.w.org\/{rel}","templated":true}]}}