<?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>MachineGrid &#187; Nikon D40</title>
	<atom:link href="http://www.machinegrid.com/category/nikon-d40/feed/" rel="self" type="application/rss+xml" />
	<link>http://www.machinegrid.com</link>
	<description>robots at work</description>
	<lastBuildDate>Thu, 14 Apr 2011 15:42:50 +0000</lastBuildDate>
	<language>en</language>
	<sy:updatePeriod>hourly</sy:updatePeriod>
	<sy:updateFrequency>1</sy:updateFrequency>
	<generator>http://wordpress.org/?v=3.3.1</generator>
		<item>
		<title>Controlling the Nikon D40 with gphoto2</title>
		<link>http://www.machinegrid.com/2009/05/controlling-the-nikon-d40-with-gphoto2/</link>
		<comments>http://www.machinegrid.com/2009/05/controlling-the-nikon-d40-with-gphoto2/#comments</comments>
		<pubDate>Thu, 21 May 2009 01:10:22 +0000</pubDate>
		<dc:creator>bluehash</dc:creator>
				<category><![CDATA[hacks]]></category>
		<category><![CDATA[Nikon D40]]></category>
		<category><![CDATA[DSLR]]></category>
		<category><![CDATA[gphoto2]]></category>
		<category><![CDATA[Hacking]]></category>
		<category><![CDATA[libgphoto2]]></category>
		<category><![CDATA[linux]]></category>
		<category><![CDATA[Time Lapse]]></category>
		<category><![CDATA[usb]]></category>

		<guid isPermaLink="false">http://www.machinegrid.com/?p=979</guid>
		<description><![CDATA[gphoto2 is a neat little command line interface to talk to digital cameras. The Nikon D40 DSLR is also supported. I was not able to find a good guide on interfacing the D40 to gphoto, so I wrote this down for reference. Installing gphoto2 1. I have Fedora10 installed on my laptop. Running the following [...]
No related posts.]]></description>
			<content:encoded><![CDATA[<p><!-- New window script from http://blog.ginchen.de/en/2008/12/20/links-xhtml-konform-in-neuem-fenster-oeffnen/ --><script src="http://www.machinegrid.com/machinepress/jscripts/externalLinks.js" type="text/javascript"></script>gphoto2 is a neat little command line interface to talk to digital cameras. The Nikon D40 DSLR is also supported. I was not able to find a good guide on interfacing the D40 to gphoto, so I wrote this down for reference.</p>
<p><strong>Installing gphoto2</strong><br />
1. I have Fedora10 installed on my laptop. Running the following simple command &#8220;yum install gphoto2&#8243; as root installs gphoto2.</p>
<p>2. Doing the above however does not install libghoto2 which is the core library designed to allow access to digital cameras by external programs.</p>
<ul>
<li>Goto <a rel="external" href="http://www.gphoto.org">ghoto2.org</a> and download the latest version of libgphoto2. The latest at my time of downloading was 2.4.5.</li>
<li>Extract all the contents on the Desktop in a libgphoto folder.</li>
<li>Open a terminal. As root, type &#8220;make&#8221;. If you encounter any errors, it maybe because libgphoto cannot find the packages it  needs. I had to install libusb. Doing &#8220;yum install libusb&#8221; did it. If you are unable to successfully compile it, post in the comments, I&#8217;ll try to help.</li>
<li>Once compilation is done, type &#8220;make install&#8221; as root.</li>
<li>Close the terminal. Done!</li>
</ul>
<p><strong>Running gphoto2</strong><br />
1. Gphoto2 is now installed and ready to use. Make sure the camera is in PTP mode. Goto SETUP MENU -> USB and select MTP/PTP mode. Restart your camera.</p>
<p>2. You will see the following pop up. It is very important to click &#8220;Unmount.&#8221; If you do not, further instructions will not work.<br />
<a href="http://www.machinegrid.com/machinepress/wp-content/uploads/2009/05/nikon_d40_unmount_screen.png"><img src="http://www.machinegrid.com/machinepress/wp-content/uploads/2009/05/nikon_d40_unmount_screen-300x170.png" alt="nikon_d40_unmount_screen" title="nikon_d40_unmount_screen" width="300" height="170" class="aligncenter size-medium wp-image-984" /></a></p>
<p>3. To make sure your D40 was correctly detected by your PC, type &#8221; dmesg | tail &#8221; as root. You should see your camera detected in the last two &#8211; three lines.<br />
<a href="http://www.machinegrid.com/machinepress/wp-content/uploads/2009/05/nikon_d40_gphoto2_dmesg_tail.png"><img src="http://www.machinegrid.com/machinepress/wp-content/uploads/2009/05/nikon_d40_gphoto2_dmesg_tail-300x202.png" alt="nikon_d40_gphoto2_dmesg_tail" title="nikon_d40_gphoto2_dmesg_tail" width="300" height="202" class="aligncenter size-medium wp-image-981" /></a></p>
<p>4. Open another terminal and as user type the following:<br />
<code>gphoto2 --list-ports</code><br />
You should see the mode the camera is connected which is in PTP.<br />
<a href="http://www.machinegrid.com/machinepress/wp-content/uploads/2009/05/nikon_d40_gphoto2_list_ports.png"><img src="http://www.machinegrid.com/machinepress/wp-content/uploads/2009/05/nikon_d40_gphoto2_list_ports-300x202.png" alt="nikon_d40_gphoto2_list_ports" title="nikon_d40_gphoto2_list_ports" width="300" height="202" class="aligncenter size-medium wp-image-982" /></a></p>
<p>5. To see some more information about your camera, type the following in the same terminal:<br />
<code>gphoto2 --summary</code><br />
<a href="http://www.machinegrid.com/machinepress/wp-content/uploads/2009/05/nikon_d40_gphoto2_summary.png"><img src="http://www.machinegrid.com/machinepress/wp-content/uploads/2009/05/nikon_d40_gphoto2_summary-300x187.png" alt="nikon_d40_gphoto2_summary" title="nikon_d40_gphoto2_summary" width="300" height="187" class="aligncenter size-medium wp-image-983" /></a></p>
<p>6. Now for capturing, type the following:<br />
<code>gphoto2 --capture-image-and-download</code><br />
This first saves the file &#8220;capt0000.jpg&#8221; on you camera in the &#8220;store_00010001&#8243; folder. It then copies it to the  current folder on your PC and deletes the one on the camera.</p>
<p>For taking shots at intervals, say 10 seconds in a custom folder, say &#8220;/home/D40/&#8221; try the following command.<br />
<code>gphoto2 --capture-image-and-download --folder="/home/D40" --interval 10</code><br />
<a href="http://www.machinegrid.com/machinepress/wp-content/uploads/2009/05/nikon_d40_gphoto2_capture_image.png"><img src="http://www.machinegrid.com/machinepress/wp-content/uploads/2009/05/nikon_d40_gphoto2_capture_image-300x202.png" alt="nikon_d40_gphoto2_capture_image" title="nikon_d40_gphoto2_capture_image" width="300" height="202" class="aligncenter size-medium wp-image-980" /></a></p>
<p>If this guide was helpful or if you need any help, let me know in the comments below and remember to <a rel="external" href="http://feeds2.feedburner.com/machinegrid"><strong>Subscribe</strong></a></p>
<p><script type="text/javascript"><!--
google_ad_client = "pub-1367209070807564";
/* 336x280, created 2/14/09 */
google_ad_slot = "6299204715";
google_ad_width = 336;
google_ad_height = 280;
// --></script><br />
<script src="http://pagead2.googlesyndication.com/pagead/show_ads.js" type="text/javascript"></script></p>
<p>No related posts.</p>]]></content:encoded>
			<wfw:commentRss>http://www.machinegrid.com/2009/05/controlling-the-nikon-d40-with-gphoto2/feed/</wfw:commentRss>
		<slash:comments>8</slash:comments>
		</item>
	</channel>
</rss>

