<?xml version="1.0" encoding="UTF-8"?><rss version="2.0" xmlns:content="http://purl.org/rss/1.0/modules/content/">
  <channel>
    <title>rpi — th.oughts</title>
    <link>https://th.oughts.org/tag:rpi</link>
    <description>Living the fake American dream, 3 years at a time</description>
    <pubDate>Mon, 30 Nov 2026 02:56:14 +0000</pubDate>
    <image>
      <url>https://i.snap.as/ixKmaGoG.jpg</url>
      <title>rpi — th.oughts</title>
      <link>https://th.oughts.org/tag:rpi</link>
    </image>
    <item>
      <title>Experiences building a RPi based home security camera</title>
      <link>https://th.oughts.org/experiences-building-a-rpi-based-home-security-camera-3tk0?pk_campaign=rss-feed</link>
      <description>My Dad had a specific set of requirements from a security camera he wanted for our home back in India. When I researched between options,...</description>
      <content:encoded><![CDATA[<p>My Dad had a specific set of requirements from a security camera he wanted for our home back in India. When I researched between options, on whether to buy one or to build something, I stumbled upon many builds based on the Raspberry Pi. Most successful builds run <a href="https://motion-project.github.io">Motion</a> on top of a RPi board, or maybe, even <a href="https://motion-project.github.io">Motioneye</a> for a friendlier UI. This post summarizes the issues that I/you are likely to face and what I did about them.</p>

<h2 id="underwhelming-hardware">Underwhelming hardware</h2>

<p>I used a RPi 3 B board that has a 1.2 Ghz quadcore ARM processor. For processing a video stream and running the motion detection daemon, it&#39;s not really very capable and you would end up with stuck/unusable frames on your stream. One of the things that makes a huge difference is the incoming stream frame rate and resolution. I got the best results with sliding down the incoming frame rate to as low as 10 on the <a href="https://reolink.com/product/rlc-410/">camera</a> that I am using.</p>

<h2 id="b-vs-b">B vs B+</h2>

<p>The B+&#39;s advantage is more on the I/O side and it really doesn&#39;t make much of a difference with processing power when it comes to the video stream. On the other hand, the B is more battery friendly which was a major requirement in my setup owing to the frequent power-cuts associated with Indian summers. Overclocking, too, isn&#39;t worth it if you consider the battery drain (as high as 20% faster) compared to any noticeable performance gain.</p>

<h2 id="backup-power">Backup power</h2>

<p>As mentioned above, this was an important requirement. I used a 20000 mAH  <a href="https://www.amazon.com/gp/product/B078S6LH8L/">battery</a> that has passthrough. On the downside, when passthrough triggers, there&#39;s a momentary disconnect in power which restarts the camera and the RPi which is undesirable but the small downtime is acceptable.</p>

<h2 id="network">Network</h2>

<p>One of the requirements was failover to a backup network but jumping back to the main network once it&#39;s back up. A reverse tunnel to a public IP takes care of ssh and http access and could be easily <a href="https://bitbucket.org/bdas/motioneyescripts/src/master/scripts/wifi_switcher.sh">scripted</a> as well. HTTPS is achieved by setting up a nginx reverse proxy on the public facing system and integrating with letsencrypt.</p>

<h2 id="motion-detection">Motion detection</h2>

<p>False positives is a major challenge and I could get a good compromise with a mix of a few things:
  – Setting up a manual mask. This is easy to do with the motioneye http interface.
  – Using a despeckle filter. Take a look at this <a href="http://emit.demon.co.uk/motion/">article</a> for a nice write up by the author. After experimenting with several combinations, EedDl gave the best results (which also happens to be the recommended starting poin).
– Experimenting with thresholds. I used the threshold_maximum parameter to minimize the maximum pixel change. A <a href="https://bitbucket.org/bdas/motioneyescripts/src/master/scripts/select_motion.sh">script</a>  changes
the threshold value based on input from a LDR similar to this <a href="https://pimylifeup.com/raspberry-pi-light-sensor/">setup</a>.</p>

<h2 id="usability">Usability</h2>

<p>The system is easy to use/configure with the Motioneye http interface but to make it a little bit more interesting, I used some NFC tags to enable/disable motion detection. This can be easily done with <a href="https://play.google.com/store/apps/details?id=net.dinglisch.android.taskerm&amp;hl=en">Tasker</a> along with the NFC plugin for it. This <a href="https://bitbucket.org/bdas/motioneyescripts/src/master/scripts/update_motion_trigger.sh">script</a> takes care of syncing up the config file with the current state of motion detection.</p>

<p><a href="https://th.oughts.org/tag:thoughts" class="hashtag"><span>#</span><span class="p-category">thoughts</span></a> <a href="https://th.oughts.org/tag:tech" class="hashtag"><span>#</span><span class="p-category">tech</span></a> <a href="https://th.oughts.org/tag:diy" class="hashtag"><span>#</span><span class="p-category">diy</span></a> <a href="https://th.oughts.org/tag:rpi" class="hashtag"><span>#</span><span class="p-category">rpi</span></a> <a href="https://th.oughts.org/tag:bash" class="hashtag"><span>#</span><span class="p-category">bash</span></a></p>

<p><a href="https://remark.as/p/th.oughts.org/experiences-building-a-rpi-based-home-security-camera-3tk0">Discuss...</a></p>
]]></content:encoded>
      <guid>https://th.oughts.org/experiences-building-a-rpi-based-home-security-camera-3tk0</guid>
      <pubDate>Wed, 30 Jan 2019 05:51:23 +0000</pubDate>
    </item>
  </channel>
</rss>