<?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>raspberry pi camera - Devhour</title>
	<atom:link href="https://www.devhour.net/tag/raspberry-pi-camera/feed/" rel="self" type="application/rss+xml" />
	<link>https://www.devhour.net</link>
	<description>Taking time to write about development</description>
	<lastBuildDate>Tue, 12 Mar 2024 09:54:09 +0000</lastBuildDate>
	<language>en-US</language>
	<sy:updatePeriod>
	hourly	</sy:updatePeriod>
	<sy:updateFrequency>
	1	</sy:updateFrequency>
	<generator>https://wordpress.org/?v=6.8.1</generator>

<image>
	<url>https://www.devhour.net/wp-content/uploads/2024/03/cropped-devhourlogo-32x32.png</url>
	<title>raspberry pi camera - Devhour</title>
	<link>https://www.devhour.net</link>
	<width>32</width>
	<height>32</height>
</image> 
	<item>
		<title>Raspberry Pi and Motion (Weather App Pt 2) (Revised)</title>
		<link>https://www.devhour.net/raspberry-pi-and-motion-weather-app-pt-2-revised/?utm_source=rss&#038;utm_medium=rss&#038;utm_campaign=raspberry-pi-and-motion-weather-app-pt-2-revised</link>
					<comments>https://www.devhour.net/raspberry-pi-and-motion-weather-app-pt-2-revised/#comments</comments>
		
		<dc:creator><![CDATA[Jamie]]></dc:creator>
		<pubDate>Wed, 23 Jul 2014 12:37:00 +0000</pubDate>
				<category><![CDATA[Raspberry Pi]]></category>
		<category><![CDATA[camera]]></category>
		<category><![CDATA[Motion]]></category>
		<category><![CDATA[raspberry pi camera]]></category>
		<guid isPermaLink="false">https://www.devhour.net/?p=40</guid>

					<description><![CDATA[<p>Having written the original Raspberry Pi and Motion (Weather App Pt 2) and promptly put it on the back burner (read: got lazy and didn’t finish it) I’ve come back to finish it off. Firstly, I’m going to can the webcam in favour of the Raspberry Pi Camera Module. This is mainly due to the fact that a [&#8230;]</p>
<p>The post <a href="https://www.devhour.net/raspberry-pi-and-motion-weather-app-pt-2-revised/">Raspberry Pi and Motion (Weather App Pt 2) (Revised)</a> first appeared on <a href="https://www.devhour.net">Devhour</a>.</p>]]></description>
										<content:encoded><![CDATA[<p>Having written the original <a href="https://www.devhour.net/raspberry-pi-and-motion-pt-2/">Raspberry Pi and Motion (Weather App Pt 2)</a> and promptly put it on the back burner (read: got lazy and didn’t finish it) I’ve come back to finish it off.</p>



<p>Firstly, I’m going to can the webcam in favour of the <a href="https://www.raspberrypi.org/help/camera-module-setup/" target="_blank" rel="noreferrer noopener">Raspberry Pi Camera Module</a>. This is mainly due to the fact that a lot of webcams either;</p>



<ol class="wp-block-list">
<li>Don’t work due to lack of driver support</li>



<li>Can’t perform at their optimal resolutions again because of shoddy drivers</li>



<li>Require an external USB hub in order to have enough power to work</li>
</ol>



<p>So after jumping on <a href="https://www.amazon.com/Raspberry-5MP-Camera-Board-Module/dp/B00E1GGE40" target="_blank" rel="noreferrer noopener">Amazon</a> and purchasing the module I got to work setting it up on the Raspberry Pi. There isn’t much to it as it just plugs into small slot behind the ethernet port (pull the tabs out, slide the module in, and shut the tabs). Once you’ve got to that point you need to enable the camera. So power on the Pi and once logged in type the following;</p>



<div class="wp-block-kevinbatdorf-code-block-pro padding-bottom-disabled cbp-has-line-numbers" data-code-block-pro-font-family="Code-Pro-JetBrains-Mono" style="font-size:.875rem;font-family:Code-Pro-JetBrains-Mono,ui-monospace,SFMono-Regular,Menlo,Monaco,Consolas,monospace;--cbp-line-number-color:#575279;--cbp-line-number-width:calc(1 * 0.6 * .875rem);line-height:1.25rem;--cbp-tab-width:2;tab-size:var(--cbp-tab-width, 2)"><span style="display:block;padding:16px 0 0 16px;margin-bottom:-1px;width:100%;text-align:left;background-color:#faf4ed"><svg xmlns="http://www.w3.org/2000/svg" width="54" height="14" viewBox="0 0 54 14"><g fill="none" fill-rule="evenodd" transform="translate(1 1)"><circle cx="6" cy="6" r="6" fill="#FF5F56" stroke="#E0443E" stroke-width=".5"></circle><circle cx="26" cy="6" r="6" fill="#FFBD2E" stroke="#DEA123" stroke-width=".5"></circle><circle cx="46" cy="6" r="6" fill="#27C93F" stroke="#1AAB29" stroke-width=".5"></circle></g></svg></span><span role="button" tabindex="0" data-code="sudo raspi-config" style="color:#575279;display:none" aria-label="Copy" class="code-block-pro-copy-button"><svg xmlns="http://www.w3.org/2000/svg" style="width:24px;height:24px" fill="none" viewBox="0 0 24 24" stroke="currentColor" stroke-width="2"><path class="with-check" stroke-linecap="round" stroke-linejoin="round" d="M4.5 12.75l6 6 9-13.5"></path><path class="without-check" stroke-linecap="round" stroke-linejoin="round" d="M16.5 8.25V6a2.25 2.25 0 00-2.25-2.25H6A2.25 2.25 0 003.75 6v8.25A2.25 2.25 0 006 16.5h2.25m8.25-8.25H18a2.25 2.25 0 012.25 2.25V18A2.25 2.25 0 0118 20.25h-7.5A2.25 2.25 0 018.25 18v-1.5m8.25-8.25h-6a2.25 2.25 0 00-2.25 2.25v6"></path></svg></span><pre class="shiki rose-pine-dawn" style="background-color: #faf4ed" tabindex="0"><code><span class="line"><span style="color: #D7827E">sudo</span><span style="color: #575279"> </span><span style="color: #EA9D34">raspi-config</span></span></code></pre><span style="display:flex;align-items:flex-end;padding:10px;width:100%;justify-content:flex-end;background-color:#faf4ed;color:#625c88;font-size:12px;line-height:1;position:relative">Bash</span></div>



<p>Mid-way down the list of options you’ll see the option to Enable the camera. Do so, and then reboot the device. NB: If you can’t see that option then you need to run update/upgrade on the device first.<a href="https://web.archive.org/web/20170714234055/https://www.devhour.net/wp-content/uploads/2014/07/rpisetup.jpg"></a></p>



<figure class="wp-block-image size-full"><img fetchpriority="high" decoding="async" width="499" height="322" src="https://www.devhour.net/wp-content/uploads/2024/03/RaspberryPiTempSensorPt2-Camera.jpeg" alt="Enable Camera in Raspberry Pi Config" class="wp-image-54" srcset="https://www.devhour.net/wp-content/uploads/2024/03/RaspberryPiTempSensorPt2-Camera.jpeg 499w, https://www.devhour.net/wp-content/uploads/2024/03/RaspberryPiTempSensorPt2-Camera-300x194.jpeg 300w" sizes="(max-width: 499px) 100vw, 499px" /><figcaption class="wp-element-caption">Enable Camera in Raspberry Pi Config</figcaption></figure>



<p>In order to test out the camera simply run the following command after logging in;</p>



<div class="wp-block-kevinbatdorf-code-block-pro padding-bottom-disabled cbp-has-line-numbers" data-code-block-pro-font-family="Code-Pro-JetBrains-Mono" style="font-size:.875rem;font-family:Code-Pro-JetBrains-Mono,ui-monospace,SFMono-Regular,Menlo,Monaco,Consolas,monospace;--cbp-line-number-color:#575279;--cbp-line-number-width:calc(1 * 0.6 * .875rem);line-height:1.25rem;--cbp-tab-width:2;tab-size:var(--cbp-tab-width, 2)"><span style="display:block;padding:16px 0 0 16px;margin-bottom:-1px;width:100%;text-align:left;background-color:#faf4ed"><svg xmlns="http://www.w3.org/2000/svg" width="54" height="14" viewBox="0 0 54 14"><g fill="none" fill-rule="evenodd" transform="translate(1 1)"><circle cx="6" cy="6" r="6" fill="#FF5F56" stroke="#E0443E" stroke-width=".5"></circle><circle cx="26" cy="6" r="6" fill="#FFBD2E" stroke="#DEA123" stroke-width=".5"></circle><circle cx="46" cy="6" r="6" fill="#27C93F" stroke="#1AAB29" stroke-width=".5"></circle></g></svg></span><span role="button" tabindex="0" data-code="raspistill -o image.jpg" style="color:#575279;display:none" aria-label="Copy" class="code-block-pro-copy-button"><svg xmlns="http://www.w3.org/2000/svg" style="width:24px;height:24px" fill="none" viewBox="0 0 24 24" stroke="currentColor" stroke-width="2"><path class="with-check" stroke-linecap="round" stroke-linejoin="round" d="M9 5H7a2 2 0 00-2 2v12a2 2 0 002 2h10a2 2 0 002-2V7a2 2 0 00-2-2h-2M9 5a2 2 0 002 2h2a2 2 0 002-2M9 5a2 2 0 012-2h2a2 2 0 012 2m-6 9l2 2 4-4"></path><path class="without-check" stroke-linecap="round" stroke-linejoin="round" d="M9 5H7a2 2 0 00-2 2v12a2 2 0 002 2h10a2 2 0 002-2V7a2 2 0 00-2-2h-2M9 5a2 2 0 002 2h2a2 2 0 002-2M9 5a2 2 0 012-2h2a2 2 0 012 2"></path></svg></span><pre class="shiki rose-pine-dawn" style="background-color: #faf4ed" tabindex="0"><code><span class="line"><span style="color: #D7827E">raspistill</span><span style="color: #575279"> </span><span style="color: #286983">-o</span><span style="color: #575279"> </span><span style="color: #EA9D34">image.jpg</span></span></code></pre><span style="display:flex;align-items:flex-end;padding:10px;width:100%;justify-content:flex-end;background-color:#faf4ed;color:#625c88;font-size:12px;line-height:1;position:relative">Bash</span></div>



<p>You should see an image of the camera pop up on screen for a few seconds and then you’ll find a lovely file called image.jpg.</p>



<p>Now natively motion doesn’t work nicely with the camera module but some nice folks have created a port called <a href="https://github.com/dozencrows/motion/tree/mmal-test" target="_blank" rel="noreferrer noopener">motion-mmal</a> that does.</p>



<p>To install it we just run the following;</p>



<div class="wp-block-kevinbatdorf-code-block-pro padding-bottom-disabled cbp-has-line-numbers" data-code-block-pro-font-family="Code-Pro-JetBrains-Mono" style="font-size:.875rem;font-family:Code-Pro-JetBrains-Mono,ui-monospace,SFMono-Regular,Menlo,Monaco,Consolas,monospace;--cbp-line-number-color:#575279;--cbp-line-number-width:calc(1 * 0.6 * .875rem);line-height:1.25rem;--cbp-tab-width:2;tab-size:var(--cbp-tab-width, 2)"><span style="display:block;padding:16px 0 0 16px;margin-bottom:-1px;width:100%;text-align:left;background-color:#faf4ed"><svg xmlns="http://www.w3.org/2000/svg" width="54" height="14" viewBox="0 0 54 14"><g fill="none" fill-rule="evenodd" transform="translate(1 1)"><circle cx="6" cy="6" r="6" fill="#FF5F56" stroke="#E0443E" stroke-width=".5"></circle><circle cx="26" cy="6" r="6" fill="#FFBD2E" stroke="#DEA123" stroke-width=".5"></circle><circle cx="46" cy="6" r="6" fill="#27C93F" stroke="#1AAB29" stroke-width=".5"></circle></g></svg></span><span role="button" tabindex="0" data-code="wget https://www.dropbox.com/s/0gzxtkxhvwgfocs/motion-mmal.tar.gztar zxvf motion-mmal.tar.gzsudo ./motion -c motion-mmalcam.conf" style="color:#575279;display:none" aria-label="Copy" class="code-block-pro-copy-button"><svg xmlns="http://www.w3.org/2000/svg" style="width:24px;height:24px" fill="none" viewBox="0 0 24 24" stroke="currentColor" stroke-width="2"><path class="with-check" stroke-linecap="round" stroke-linejoin="round" d="M9 5H7a2 2 0 00-2 2v12a2 2 0 002 2h10a2 2 0 002-2V7a2 2 0 00-2-2h-2M9 5a2 2 0 002 2h2a2 2 0 002-2M9 5a2 2 0 012-2h2a2 2 0 012 2m-6 9l2 2 4-4"></path><path class="without-check" stroke-linecap="round" stroke-linejoin="round" d="M9 5H7a2 2 0 00-2 2v12a2 2 0 002 2h10a2 2 0 002-2V7a2 2 0 00-2-2h-2M9 5a2 2 0 002 2h2a2 2 0 002-2M9 5a2 2 0 012-2h2a2 2 0 012 2"></path></svg></span><pre class="shiki rose-pine-dawn" style="background-color: #faf4ed" tabindex="0"><code><span class="line"><span style="color: #D7827E">wget</span><span style="color: #575279"> </span><span style="color: #EA9D34">https://www.dropbox.com/s/0gzxtkxhvwgfocs/motion-mmal.tar.gztar</span><span style="color: #575279"> </span><span style="color: #EA9D34">zxvf</span><span style="color: #575279"> </span><span style="color: #EA9D34">motion-mmal.tar.gzsudo</span><span style="color: #575279"> </span><span style="color: #EA9D34">./motion</span><span style="color: #575279"> </span><span style="color: #286983">-c</span><span style="color: #575279"> </span><span style="color: #EA9D34">motion-mmalcam.conf</span></span></code></pre><span style="display:flex;align-items:flex-end;padding:10px;width:100%;justify-content:flex-end;background-color:#faf4ed;color:#625c88;font-size:12px;line-height:1;position:relative">Bash</span></div>



<p>As you can see the new config file is called motion-mmalcam.conf and can (and should be) edited as required. I won’t go through that here as we already covered that in the previous post.</p>



<p>I promise this time that I’m going to continue on with this series and as I said last time I’m going to write a python script that will grab the weather temperature when motion takes a snapshot. From there I’ll be showing you 2 things. The first will be to set up a web page which shows an image + temperature. The second, sending the time/temperature to a 20×4 LCD screen <img src="https://s.w.org/images/core/emoji/15.1.0/72x72/1f642.png" alt="🙂" class="wp-smiley" style="height: 1em; max-height: 1em;" /></p>



<p>So stay tuned and as always you can follow me on twitter <a href="https://twitter.com/JAGracie">@JAGracie</a></p><p>The post <a href="https://www.devhour.net/raspberry-pi-and-motion-weather-app-pt-2-revised/">Raspberry Pi and Motion (Weather App Pt 2) (Revised)</a> first appeared on <a href="https://www.devhour.net">Devhour</a>.</p>]]></content:encoded>
					
					<wfw:commentRss>https://www.devhour.net/raspberry-pi-and-motion-weather-app-pt-2-revised/feed/</wfw:commentRss>
			<slash:comments>1</slash:comments>
		
		
			</item>
	</channel>
</rss>
