<?xml version="1.0" encoding="UTF-8"?>
<rss version="2.0"
	xmlns:content="http://purl.org/rss/1.0/modules/content/"
	xmlns:wfw="http://wellformedweb.org/CommentAPI/"
	xmlns:dc="http://purl.org/dc/elements/1.1/"
	xmlns:atom="http://www.w3.org/2005/Atom"
	xmlns:sy="http://purl.org/rss/1.0/modules/syndication/"
	xmlns:slash="http://purl.org/rss/1.0/modules/slash/"
	>

<channel>
	<title>The Menhennitt family web site</title>
	<atom:link href="http://menhennitt.com.au/wordpress/feed" rel="self" type="application/rss+xml" />
	<link>http://menhennitt.com.au/wordpress</link>
	<description></description>
	<lastBuildDate>Wed, 22 Jun 2011 11:52:47 +0000</lastBuildDate>
	<language>en</language>
	<sy:updatePeriod>hourly</sy:updatePeriod>
	<sy:updateFrequency>1</sy:updateFrequency>
	<generator>http://wordpress.org/?v=3.3</generator>
		<item>
		<title>Printing to an HP Laserjet 1020 from FreeBSD 8 using CUPS and foo2zjs</title>
		<link>http://menhennitt.com.au/wordpress/2009/09/27/printing-to-an-hp-laserjet-1020-from-freebsd-8-using-cups-and-foo2zjs</link>
		<comments>http://menhennitt.com.au/wordpress/2009/09/27/printing-to-an-hp-laserjet-1020-from-freebsd-8-using-cups-and-foo2zjs#comments</comments>
		<pubDate>Sun, 27 Sep 2009 01:16:04 +0000</pubDate>
		<dc:creator>gfm</dc:creator>
				<category><![CDATA[Computing]]></category>
		<category><![CDATA[CUPS]]></category>
		<category><![CDATA[foo2zjs]]></category>
		<category><![CDATA[FreeBSD]]></category>
		<category><![CDATA[Laserjet 1020]]></category>
		<category><![CDATA[print]]></category>

		<guid isPermaLink="false">http://menhennitt.com.au/wordpress/?p=74</guid>
		<description><![CDATA[This is an update to my post for FreeBSD 7. I&#8217;ve now upgraded to FreeBSD 8 and things are done a bit differently. Custom Kernel There&#8217;s no need to build a custom kernel any more since FreeBSD uses the ulpt device (as it always should have!). That device is built in to the GENERIC kernel [...]]]></description>
			<content:encoded><![CDATA[<p>This is an update to <a href="http://menhennitt.com.au/wordpress/2009/07/22/printing-to-an-hp-laserjet-1020-from-freebsd-using-cups-and-foo2zjs">my post</a> for FreeBSD 7. I&#8217;ve now upgraded to FreeBSD 8 and things are done a bit differently.<br />
<span id="more-74"></span></p>
<h2>Custom Kernel</h2>
<p>There&#8217;s no need to build a custom kernel any more since FreeBSD uses the ulpt device (as it always should have!). That device is built in to the GENERIC kernel and the device is correctly recognised at boot time. The remainder of this post is about changing to the new device name.</p>
<h2>Build and install ports</h2>
<p>This is the same as previously.</p>
<h2>Set device permissions</h2>
<p>The devfs.rules entry needs to use the new device name. It also needs to set the permission of some extra devices, otherwise CUPS won&#8217;t find the printer. Look in the output of <em>dmesg</em> for the USB entry that corresponds to the printer. Mine looks like:</p>
<p style="padding-left: 30px;"><code>ugen5.5: &lt;Hewlett-Packard&gt; at usbus5<br />
ulpt0: &lt;Hewlett-Packard HP LaserJet 1020, class 0/0, rev 2.00/1.00, addr 5&gt; on usbus5</code></p>
<p>So the new devfs.rules entry is:</p>
<p style="padding-left: 30px;"><code>[printers=10]<br />
add path 'ulpt0' mode 0660 group cups<br />
add path 'ugen5.5' mode 0660 group cups<br />
add path 'usb/5.5.0' mode 0660 group cups</code></p>
<p>The rc.conf entry is the same as before.</p>
<h2>Install firmware</h2>
<p>The firmware needs to be sent to the new device name:</p>
<p style="padding-left: 30px;"><code>cat /usr/local/share/foo2zjs/firmware/sihp1020.dl &gt; /dev/ulpt0</code></p>
<p>Likewise, /etc/devd.conf is changed to:</p>
<p style="padding-left: 30px;"><code># Firmware download HP Laserjet 1020 printer<br />
attach 100 {<br />
match "vendor"  "0x03f0";<br />
match "product" "0x2b17";<br />
action "cat /usr/local/share/foo2zjs/firmware/sihp1020.dl &gt; /dev/$device-name";<br />
};</code></p>
<h2>Configure CUPS to use the printer</h2>
<p>This is the same as before except the device URI is now &#8220;usb:/dev/ulpt0&#8243;.</p>
]]></content:encoded>
			<wfw:commentRss>http://menhennitt.com.au/wordpress/2009/09/27/printing-to-an-hp-laserjet-1020-from-freebsd-8-using-cups-and-foo2zjs/feed</wfw:commentRss>
		<slash:comments>4</slash:comments>
		</item>
		<item>
		<title>Printing to an HP Laserjet 1020 from FreeBSD using CUPS and foo2zjs</title>
		<link>http://menhennitt.com.au/wordpress/2009/07/22/printing-to-an-hp-laserjet-1020-from-freebsd-using-cups-and-foo2zjs</link>
		<comments>http://menhennitt.com.au/wordpress/2009/07/22/printing-to-an-hp-laserjet-1020-from-freebsd-using-cups-and-foo2zjs#comments</comments>
		<pubDate>Wed, 22 Jul 2009 10:21:24 +0000</pubDate>
		<dc:creator>gfm</dc:creator>
				<category><![CDATA[Computing]]></category>
		<category><![CDATA[CUPS]]></category>
		<category><![CDATA[foo2zjs]]></category>
		<category><![CDATA[FreeBSD]]></category>
		<category><![CDATA[Laserjet 1020]]></category>
		<category><![CDATA[print]]></category>

		<guid isPermaLink="false">http://menhennitt.com.au/wordpress/?p=36</guid>
		<description><![CDATA[I&#8217;m setting up my Soekris box as a printer server. The printer is a Hewlett Packard Laserjet 1020. I&#8217;m running FreeBSD 7-Stable as the operating system and I want to use CUPS as the print manager. There are a few guides around that show parts of how to do this, but I didn&#8217;t find one [...]]]></description>
			<content:encoded><![CDATA[<p>I&#8217;m setting up my <a href="http://menhennitt.com.au/wordpress/2009/07/05/installing-freebsd-on-a-soekris-net5501-using-pxe-and-dnsmasq">Soekris box</a> as a printer server. The printer is a Hewlett Packard Laserjet 1020. I&#8217;m running <a href="http://freebsd.org">FreeBSD</a> 7-Stable as the operating system and I want to use <a href="http://cups.org/">CUPS</a> as the print manager.</p>
<p>There are a few guides around that show parts of how to do this, but I didn&#8217;t find one that had it all in one place. Hence this post.</p>
<p><span id="more-36"></span></p>
<h2>Custom Kernel</h2>
<p>Firstly, you need to build a custom kernel. I&#8217;m building one anyway, since it&#8217;s customised for the Soekris box. The important thing is that it does <strong>not</strong> have &#8220;device ulpt&#8221; in it. If you have that, the printer gets recognised as /dev/ulpt0 which doesn&#8217;t work. Instead we have &#8220;device ugen&#8221; and it gets recognised as /dev/ugen0 which works correctly. There may be a better way of doing this, but I don&#8217;t know. So build, install, and reboot the new kernel. You should see the printer mentioned in the boot messages and in the output of &#8220;dmesg&#8221;.</p>
<h2>Build and install ports</h2>
<p>Then install the CUPS and foo2zjs ports using the standard &#8220;make install&#8221;. Make sure you select the LIBUSB option in the cups-base port to be able to print to USB printers. The foo2zjs one tells you to do some extra stuff: &#8220;getweb&#8221; and &#8220;make install-hotplug&#8221;. Skip the hotplug bit as that doesn&#8217;t seem to work on FreeBSD. The printer needs to have firmware downloaded to it and that&#8217;s what the hotplug business is for. On FreeBSD, we do that in a different way that we&#8217;ll see below.</p>
<h2>Set device permissions</h2>
<p>When the printer is plugged in or switched on, two devices will be created: /dev/ugenX and /dev/ugenX.1 where X is an integer. In my case X is 0. It&#8217;s the latter of these two that we need to use: in my case /dev/ugen0.1. These devices need to be owned by the same owner as the CUPS program. By defaults that&#8217;s &#8220;cups&#8221;. To set the ownership, edit /etc/devfs.rules. This file may not already exist, in which case you can create a new one. It should contain:</p>
<p style="padding-left: 30px;"><code>[printers=10]<br />
add path 'ugen0.1' mode 0660 group cups</code></p>
<p>Substitute your correct device name in there. Now, that entry needs to be activated by adding a line:
</p>
<p style="padding-left: 30px;"><code>devfs_system_ruleset="printers"</code></p>
<p>to /etc/rc.conf. You then need to restart the devfs daemon.</p>
<h2>Install firmware</h2>
<p>You do need to download the firmware: cd to the foo2zjs port&#8217;s work/foo2zjs* directory and do &#8220;./getweb 1020&#8243;. If you have a different but similar printer, there are lots of things that you can &#8220;getweb&#8221; &#8211; they&#8217;ll probably work the same as the 1020. Anyway, the &#8220;getweb&#8221; command downloads a file: sihp1020.img. Then run &#8220;arm2hpdl &lt; sihp1020.img &gt; sihp1020.dl&#8221;. This converts the firmware image into a file suitable for downloading to the printer. The output file sihp1020.dl needs to be be put somewhere it can be downloaded from: I put it in /usr/local/share/foo2zjs/firmware. To download it to the printer, it&#8217;s as simple as:</p>
<p style="padding-left: 30px;"><code>cat /usr/local/share/foo2zjs/firmware/sihp1020.dl &gt; /dev/ugen0.1</code></p>
<p>During the download, the LEDs on the printer should flash. At the end, the printer will make a few noises. It&#8217;s then ready to print.</p>
<p>The firmware needs to be downloaded every time the printer is powered on. To automate this, add a section to /etc/devd.conf:</p>
<p style="padding-left: 30px;"><code># Firmware download HP Laserjet 1020 printer<br />
attach 100 {<br />
device-name "ugen[0-9]+";<br />
match "vendor"  "0x03f0";<br />
match "product" "0x2b17";<br />
action "cat /usr/local/share/foo2zjs/firmware/sihp1020.dl &gt; /dev/$device-name.1";<br />
};</code></p>
<p>This tells it to execute the download command whenever a device is attached that matches the correct USB vendor and device identifiers. Note the &#8220;.1&#8243; at the end of the command so that the correct device name is used. I&#8217;m sure that there&#8217;s a better way of doing this, but I can&#8217;t find it.</p>
<h2>Configure CUPS to use the printer</h2>
<p>Finally, add the printer in CUPS. When it asks for the device URI, enter &#8220;usb:/dev/ugen0.1&#8243;. Then try printing a test page. If it&#8217;s all worked, you should hear the printer fire up and see your page printed!</p>
<p>&#8212;&#8212;&#8212;&#8212;&#8212;&#8212;&#8212;&#8212;&#8212;-<br />
Update: I&#8217;ve updated this for FreeBSD 8 <a href="http://menhennitt.com.au/wordpress/2009/09/27/printing-to-an-hp-laserjet-1020-from-freebsd-8-using-cups-and-foo2zjs">here</a>.</p>
]]></content:encoded>
			<wfw:commentRss>http://menhennitt.com.au/wordpress/2009/07/22/printing-to-an-hp-laserjet-1020-from-freebsd-using-cups-and-foo2zjs/feed</wfw:commentRss>
		<slash:comments>1</slash:comments>
		</item>
		<item>
		<title>Installing FreeBSD on a Soekris net5501 using PXE and dnsmasq</title>
		<link>http://menhennitt.com.au/wordpress/2009/07/05/installing-freebsd-on-a-soekris-net5501-using-pxe-and-dnsmasq</link>
		<comments>http://menhennitt.com.au/wordpress/2009/07/05/installing-freebsd-on-a-soekris-net5501-using-pxe-and-dnsmasq#comments</comments>
		<pubDate>Sun, 05 Jul 2009 03:43:51 +0000</pubDate>
		<dc:creator>gfm</dc:creator>
				<category><![CDATA[Computing]]></category>
		<category><![CDATA[dnsmasq]]></category>
		<category><![CDATA[FreeBSD]]></category>
		<category><![CDATA[install]]></category>
		<category><![CDATA[net5501]]></category>
		<category><![CDATA[PXE]]></category>
		<category><![CDATA[Soekris]]></category>

		<guid isPermaLink="false">http://menhennitt.com.au/wordpress/?p=14</guid>
		<description><![CDATA[I&#8217;m the proud owner of a new Soekris net5501. This is a low power SBC (Single Board Computer) that I intend to use as a: router, firewall, name server, wireless access point, VPN end-point, PBX, SMTP server, IMAP server, NTP server, file server (both NFS and SMB), UPS monitor, print server, database server, and source [...]]]></description>
			<content:encoded><![CDATA[<p>I&#8217;m the proud owner of a new <a href="http://soekris.com">Soekris</a> <a href="http://soekris.com/net5501.htm">net5501</a>. This is a low power SBC (Single Board Computer) that I intend to use as a:</p>
<ul>
<li>router,</li>
<li>firewall,</li>
<li>name server,</li>
<li>wireless access point,</li>
<li>VPN end-point,</li>
<li>PBX,</li>
<li>SMTP server,</li>
<li>IMAP server,</li>
<li>NTP server,</li>
<li>file server (both NFS and SMB),</li>
<li>UPS monitor,</li>
<li>print server,</li>
<li>database server, and</li>
<li>source control server</li>
</ul>
<p>for my home network. My preferred operating system is <a href="http://freebsd.org">FreeBSD</a> and I&#8217;m installing the most recent stable release &#8211; 7.2.</p>
<p><span id="more-14"></span></p>
<p>Installation on a Soekris box is a bit different to installing on a normal PC since it has no video card (it&#8217;s headless), and mine doesn&#8217;t have a CDROM or DVD drive. There are several ways of doing the installation. One is via a Compact Flash card, another is putting a disk drive into another PC, installing the OS, and then moving the disk to the Soekris box. The way I&#8217;m going to do it is by network booting using PXE. There are number of guides to doing this around if you search for &#8220;PXE install FreeBSD&#8221;. I&#8217;m doing it a bit differently since I&#8217;m going to use <a href="http://www.thekelleys.org.uk/dnsmasq/doc.html">dnsmasq</a> for the BOOTP and TFTP server. The reason I&#8217;m doing it this way is that I already have a FreeBSD server running dnsmasq and it&#8217;s capable of doing the job without having to install ISC DHCP3 server or a dedicated TFTP server.</p>
<p>Basically, I follow the instructions from <a href="http://jdc.parodius.com/freebsd/pxeboot_serial_install.html">this guide</a> with the following differences.</p>
<ul>
<li>I didn&#8217;t bother building pxeboot in Step 5. Instead, I changed baud rate in my terminal emulator (picocom) to 9600 at the point where pxeboot is running. You get a few garbage characters but it doesn&#8217;t really matter.</li>
<li>Since I&#8217;m using dnsmasq from the BOOTP and TFTP server, I replaced Steps 1, 2, &amp; 3 with adding:<br />
<code>enable-tftp<br />
tftp-root=/mnt/pxeroot<br />
dhcp-boot=pxeboot<br />
dhcp-option=17,203.2.73.2:/mnt/pxeroot</code><br />
to the bottom of dnsmasq.conf. Note that you should replace &#8220;/mnt/pxeroot&#8221; with the name of the directory where you&#8217;ve installed pxeboot and the FreeBSD install image (&#8220;/usr/local/freebsd7&#8243; in the guide above).</li>
<li>I used 19200 baud instead of 115200. That&#8217;s the default baud rate of the Soekris boot loader. For the amount of time spent on the console, it&#8217;s not really worth worrying about the higher speed.</li>
<li>Finally, I had something go wrong when it was booting the FreeBSD kernel. It may have been the same problem noted in Step 7 of the guide, I don&#8217;t know. Anyway, my solution was to replace the standard FreeBSD kernel with a custom one. I&#8217;m building a custom one for the Soekris box anyway, so I just used that. Its config file can be found <a href="http://menhennitt.com.au/maxwell.conf">here</a>. I had to disable the IPFIREWALL options for the installation because it defaults to &#8220;deny all&#8221; which prevented me using NFS to do the installation!</li>
</ul>
<p>Anyway, it&#8217;s all working beautifully now. I hope this helps somebody else who&#8217;s trying to do that same thing. It will also help me remember how to do it for next time!</p>
<p><b>Update: October 19, 2010 for FreeBSD 8.1: </b>My kernel config file for FreeBSD 8.1 is <a href="http://menhennitt.com.au/maxwell_8.conf">here</a>.</p>
]]></content:encoded>
			<wfw:commentRss>http://menhennitt.com.au/wordpress/2009/07/05/installing-freebsd-on-a-soekris-net5501-using-pxe-and-dnsmasq/feed</wfw:commentRss>
		<slash:comments>3</slash:comments>
		</item>
		<item>
		<title>Birth of Thomas</title>
		<link>http://menhennitt.com.au/wordpress/2009/01/13/birth-of-thomas</link>
		<comments>http://menhennitt.com.au/wordpress/2009/01/13/birth-of-thomas#comments</comments>
		<pubDate>Tue, 13 Jan 2009 11:31:22 +0000</pubDate>
		<dc:creator>gfm</dc:creator>
				<category><![CDATA[Family]]></category>
		<category><![CDATA[Photos]]></category>
		<category><![CDATA[birth]]></category>
		<category><![CDATA[Thomas]]></category>

		<guid isPermaLink="false">http://menhennitt.com.au/wordpress/?p=7</guid>
		<description><![CDATA[Thomas Anthony was born today. Photos are here. Baby Thomas Proud Uncle Liam]]></description>
			<content:encoded><![CDATA[<p>Thomas Anthony was born today. Photos are <a href="http://menhennitt.com.au/wordpress/wpg2?g2_itemId=19367">here</a>.</p>
<div class="wpg2tag-image"><a href="http://menhennitt.com.au/wordpress/wpg2?g2_itemId=19410" title="Baby Thomas"><img src="http://menhennitt.com.au/gallery2/main.php?g2_view=core.DownloadItem&amp;g2_itemId=19411&amp;g2_serialNumber=2" width="150" height="100" id="IFid3" class="ImageFrame_none" alt="Baby Thomas"/></a><br />
<h4 class="giDescription">Baby Thomas</h4>
</div>
<div class="wpg2tag-image"><a href="http://menhennitt.com.au/wordpress/wpg2?g2_itemId=19428" title="Proud Uncle Liam"><img src="http://menhennitt.com.au/gallery2/main.php?g2_view=core.DownloadItem&amp;g2_itemId=19429&amp;g2_serialNumber=2" width="150" height="100" id="IFid4" class="ImageFrame_none" alt="Proud Uncle Liam"/></a><br />
<h4 class="giDescription">Proud Uncle Liam</h4>
</div>
]]></content:encoded>
			<wfw:commentRss>http://menhennitt.com.au/wordpress/2009/01/13/birth-of-thomas/feed</wfw:commentRss>
		<slash:comments>0</slash:comments>
		</item>
	</channel>
</rss>

