<?xml version="1.0" encoding="utf-8"?>
<feed xmlns="http://www.w3.org/2005/Atom">
    <title>TechLife.NZ</title>
    <link href="https://techlife.nz/blog/feed.xml" rel="self" />
    <link href="https://techlife.nz/blog" />
    <updated>2020-02-09T22:52:28+13:00</updated>
    <author>
        <name>Matt</name>
    </author>
    <id>https://techlife.nz/blog</id>

    <entry>
        <title>Create a Battery Powered ESP8266 Dual Push Button </title>
        <author>
            <name>Matt</name>
        </author>
        <link href="https://techlife.nz/blog/battery-powered-esp-01-push-button/"/>
        <id>https://techlife.nz/blog/battery-powered-esp-01-push-button/</id>
            <category term="Guides"/>
            <category term="ESP8266"/>

        <updated>2020-02-09T22:52:22+13:00</updated>
            <summary>
                <![CDATA[
                        <img src="https://techlife.nz/blog/media/posts/40/2019-12-29-22.07.08-6002-1.jpg" alt="Battery Powered ESP Dual ESP-01 Push Button" />
                     So - it's been a year since I last wrote an article on my blog, and funnily enough this on the same topic as my last article- An Amazon Dash Button Clone. As I've had the Christmas break, I decided to have another go&hellip;
                ]]>
            </summary>
        <content type="html">
            <![CDATA[
                    <img src="https://techlife.nz/blog/media/posts/40/2019-12-29-22.07.08-6002-1.jpg" alt="Battery Powered ESP Dual ESP-01 Push Button" />
                <p><img class="post__image post__image--center" src="https://techlife.nz/blog/media/posts/40/button.gif" alt="button" width="600" height="338"></p>
<p>So - it's been a year since I last wrote an article on my blog, and funnily enough this on the same topic as my <a href="https://techlife.nz/blog/create-an-esp8266-push-button-amazon-dash-clone-using-espeasy/">last article</a>- An Amazon Dash Button Clone. </p>
<p>As I've had the Christmas break, I decided to have another go at the WiFi button that controls my lights and fan. However, this time making it battery powered using an 18650 battery. </p>
<p><strong>Why?</strong></p>
<p>The push button I made last year using an ESP-01 worked has worked for the most part. And thinking about it, I probably could have looked at integrating deep sleep with <a href="https://www.letscontrolit.com/wiki/index.php/ESPEasy" target="_blank" rel="noopener noreferrer">ESPEasy</a>. However, over the last year I've been trying to learn how to code better and decided this was a good opportunity to make a simple push button Arduino sketch.</p>
<h2 id="mcetoc_1e0k0emmc1">Features</h2>
<ul>
<li>Two separate buttons being used with the ESP-01, and no separate GPIO expander.
<ul>
<li>The second button in this case must be held after pushing the first button. This causes the second button pin to go "HIGH", allowed a different message/event to be triggered. Ideally the second button could be used standalone but this wasn't a big deal in my case. </li>
</ul>
</li>
<li>Reset button used with ESP-01 without having to solder any extra wires to the ESP8266 for deep sleep</li>
<li>Push Button using a power bank that still works as a power bank ;-) </li>
<li>MQTT message sent when button pushed. </li>
</ul>
<br>
<figure class="post__image post__image--center" ><img src="https://techlife.nz/blog/media/posts/40/button-fan.gif" alt="esp01 button fan" width="600" height="338">
<figcaption >I'm too lazy to get up and turn my fan on ;-)</figcaption>
</figure>
<h2 id="mcetoc_1e0klq6h77">Parts used:</h2>
<ul>
<li>1x 18650 Battery</li>
<li><a href="https://www.aliexpress.com/item/1000005676994.html?spm=a2g0s.9042311.0.0.27424c4deexuJs">Push Buttons</a></li>
<li><a href="https://www.aliexpress.com/item/32900545111.html?spm=a2g0s.9042311.0.0.27424c4deexuJs" target="_blank" rel="noopener noreferrer">18650 Power Bank Case</a> - Use only one of the battery slots. ESP in the other slot. </li>
<li><a href="https://www.aliexpress.com/item/32838852871.html?spm=a2g0s.9042311.0.0.27424c4dVgfsD7" target="_blank" rel="noopener noreferrer">ESP-01 DHT11 Temp Sensor board</a> - Later remove the temp sensor to instead use the push button. </li>
<li><a href="https://www.aliexpress.com/item/32695035976.html?spm=a2g0o.detail.1000060.2.24b92363jeINig&amp;gps-id=pcDetailBottomMoreThisSeller&amp;scm=1007.13339.146401.0&amp;scm_id=1007.13339.146401.0&amp;scm-url=1007.13339.146401.0&amp;pvid=16891a99-844d-4359-9b07-7c27ebe945a6">ESP-01, and USB Programmer</a> for it. </li>
<li>Various tools and solder. </li>
</ul>
<p>The crux of our Arduino sketch is built around booting our ESP, running our code, then going into Deep Sleep. We use the RST (Reset) pin connected to our Push Button to trigger this process again. <strong>In the case of my project here, we actually use the RST button already connected on the <a href="https://www.aliexpress.com/item/32838852871.html?spm=a2g0s.9042311.0.0.27424c4dVgfsD7" target="_blank" rel="noopener noreferrer">ESP-01 DHT11 Temp Sensor board</a> rather than having to make our own circuit or use perf board.</strong></p>
<p>This means we don't have to complete the <a href="https://www.instructables.com/id/Enable-DeepSleep-on-an-ESP8266-01/" target="_blank" rel="noopener noreferrer">painful task of soldering a reset wire on to the ESP8266 chip itself</a>.</p>
<h3 id="mcetoc_1e0kf5oh18">Why the Power Bank, and DHT11 Temp Sensor board?</h3>
<p>These are both great questions. Ultimately I wanted a quick, simple, polished solution. Some may choose to 3D print a case for something like this, but I didn't want to take the time to learn how to 3D print when I already had useful parts on hand. </p>
<p>You could make your own case, and use something like the <a href="https://www.addicore.com/TP4056-Charger-and-Protection-Module-p/ad310.htm">TP4056 charging module</a>, however the power bank case and electronics was only ~$2USD which seemed like a better solution to me. The added benefit is this project is still a usable power bank once completed! (if desired..). </p>
<p><strong>And the DHT11 Temp sensor board?</strong></p>
<p>I chose this because I had a couple of these on hand, along with a couple ESP-01s. The primary benefit of the ESP-01 compared to something like the NodeMCU or Wemos D1 Mini, is that it's ultimately less electronics. This means there's less passive components to power or have to consider with a battery powered project. What's the actual stats around this? I don't have any on hand, but I encourage you to google this if wanting to take on a similar project. If I didn't have the ESP-01, I probably would have still tried this with the Wemos D1 Mini.</p>
<p>The DHT11 sensor board means we already have a board that provides a 5V to 3.3V built in voltage regulator. It also has a RST button we can un-solder and then attach our push button to for bringing the ESP out of deep sleep. I also like the DHT board because it meant I didn't have to make a perf board with ESP header and separate power regulator; it was just all on it already. </p>
<h2 id="mcetoc_1e0kconp91">How does the code work?</h2>
<ul>
<li>First we decare which libraries we need. In this case, PubSubClient is used for the MQTT communication</li>
<li>As per most ESP projects, configure your SSID/Pass and other info such as MQTT server IP address (this guide assumes you already have as server set up).</li>
<li>Configure Static IP address. If you're running this on something like an 18650 battery, it's highly recommended to use a static IP address. This is because it saves precious "active" time when the ESP is awake which saves battery consumption. A static IP can save anywhere from a few milliseconds, to several seconds. Note: The code is correct. IP address is specified here with commas, and not dots. </li>
<li>Next we declare which pins we're interested in. The ESP-01 only has a couple usable GPIO pins (I think you can use others if you sacrifice serial debugging etc) being GPIO 0 and 2.
<ul>
<li>This became difficult because button states matter on boot up depending on whether pins are in a HIGH or LOW state can trigger things like "config mode", instead of actually running our code. </li>
</ul>
</li>
</ul>
<p><strong>For more on usable GPIO pins, especially on the ESP-01, the following Instructable is really useful:<br></strong><a href="https://www.instructables.com/id/How-to-use-the-ESP8266-01-pins/">https://www.instructables.com/id/How-to-use-the-ESP8266-01-pins/</a></p>
<ul>
<li> In the case of this project, we use The RST pin connected to our main button (blue button in the image), and connect the second auxiliary button to GPIO 2. This is because GPIO 2 can be LOW or HIGH on boot and not trigger something else like Config/Download mode.</li>
<li>If only the Blue Button is pressed, the ESP will send the following MQTT message on boot: <code>ESP-Push-Button/btn1</code></li>
<li>If the Auxiliary Button (Black button in picture) is pressed after the ESP has been reset, this will trigger MQTT message <code>ESP-Push-Button/btn2</code> being sent.</li>
<li><strong>Unfortunately the black button is not standalone. It can't send "btn2" message on its own, and needs the blue button pressed first to pull the ESP out of deep sleep. </strong>I normally just hold both buttons to trigger "btn2" message. </li>
<li>The code below also ensures the ESP will go back into Deep sleep after 5 failed attempts to either connect to the assigned SSID, or fails to send the actual MQTT message. </li>
</ul>
<h2 id="mcetoc_1e0k1fma80">The Code</h2>
<script src="https://gist.github.com/mattie47/21aa266a2f699a98d8d3117917a03b21.js"></script>
<p> If you use <a href="https://platformio.org/">platformio</a> with VS Code or Atom, you can use the above <code>platformio.ini</code> config for building the project.</p>
<h2 id="mcetoc_1e0kg6d3l9">Let's build the project!</h2>
<p>I first had to figure out whether there would be enough space inside the Power Bank's case. The next couple of pictures give you an idea around where I've put the buttons, along with getting the ESP to fit:</p>
<figure class="post__image post__image--center" ><img src="https://techlife.nz/blog/media/posts/40/2019-12-29-21.10.00-5998.jpg" alt="Figuring out whether the optimum button locations" width="4032" height="3024">
<figcaption >Figuring out the optimum button locations</figcaption>
</figure>
<p><img class="post__image post__image--center" src="https://techlife.nz/blog/media/posts/40/2019-12-29-22.08.54-6003-1.jpg" alt="ESP inside box with buttons" width="2941" height="1868"></p>
<p> As you can see, I've soldered a couple wires directly to the USB + and - for powering the ESP. </p>
<p>I've also de-soldered the DHT11 from the Temp board, since we won't be needing that. Instead we'll use the GPIO Pin the DHT11 was connected to for our second button. </p>
<p><img class="post__image post__image--center" src="https://techlife.nz/blog/media/posts/40/2019-12-29-21.18.49-6001.jpg" alt="Getting the ESP, Battery, and two buttons in" width="4032" height="3024"></p>
<p>Before soldering the buttons in, and making any final adjustments, I ensured everything would be able to fit in nicely. This meant having to remove some of the plastic in the case around the battery, and where the ESP would be sitting. </p>
<figure class="post__image post__image--center" ><img src="https://techlife.nz/blog/media/posts/40/2019-12-29-22.57.32-6004.jpg" alt="Everything soldered in and hot glued" width="4032" height="3024">
<figcaption >The final result!</figcaption>
</figure>
<p>I then connected the Blue wires (Blue Button) in the image above to the reset pin solder joints on the DHT 11 Temp board. The Black wires (for the Black Button) are connected to the solder pins originally connected to the DHT11 on the Temp board.</p>
<p>For final measure, I used some hot glue to secure the battery wiring. </p>
<h2 id="mcetoc_1e0kgrb1ta">Destroy all LEDs!!!</h2>
<p>LEDs on the ESP, Battery charger, and DHT Temp board consume a huuuuuge amount of power. For DIY, you can either try unsoldering the LEDs, or opt for the "simpler" method of getting in a fight between a screw driver and the LEDs. Once the LEDs are destroyed, power consumption (especially in deep sleep) will dramatically drop! </p>
<h2 id="mcetoc_1e0khhr6rc">Results</h2>
<p>I've used this for turning my lights and fan on once or twice every day for about 6 weeks. So far no need to recharge. I'm expecting it'll probably last about a year.</p>
<p>In terms of actual consumption, my <a href="https://www.banggood.com/ANENG-AN8008-True-RMS-Digital-Multimeter-AC-DC-Current-Voltage-Resistance-Frequency-Capacitance-Test-p-1157985.html?utm_source=google&amp;utm_medium=cpc_ods&amp;utm_campaign=arvin-led-sdsrm-view-led-content&amp;utm_content=arvin&amp;creative=346816639676&amp;gclid=CjwKCAiA-P7xBRAvEiwAow-VaU08Hdk3Fak_wprWFVQ6OHTRym30b8h5Txv6dCAy5VJT9QVAvlSIGRoCQOcQAvD_BwE&amp;cur_warehouse=CN" target="_blank" rel="noopener noreferrer">ANENG AN8008</a> multimeter is showing 0.09 µA in deep sleep, and 15.53µA when active. Somewhat insane stats, so I'm slightly skepticle, but here's a couple pics showing this:</p>
<div class="gallery"   >
<figure class="gallery__item"><a href="https://techlife.nz/blog/media/posts/40/gallery/active.PNG" ><img src="https://techlife.nz/blog/media/posts/40/gallery/active-thumbnail.PNG" alt="" width="240" height="240"></a></figure>
<figure class="gallery__item"><a href="https://techlife.nz/blog/media/posts/40/gallery/deep-sleep.PNG" ><img src="https://techlife.nz/blog/media/posts/40/gallery/deep-sleep-thumbnail.PNG" alt="" width="240" height="240"></a></figure>
</div>
<figure class="post__image post__image--center" ><img src="https://techlife.nz/blog/media/posts/40/2019-12-29-21.10.09-5999.jpg" alt="Completed project" width="4032" height="3024">
<figcaption >Final completed project!</figcaption>
</figure>
<p><strong>Now that it's built? what next?</strong></p>
<p>Ensure both buttons trigger the relevant MQTT messages.  My home server for example is using Mosquitto. I can use <code>matt@server:~$ mosquitto_sub -v -t \#</code>to verify all in-coming MQTT messages.</p>
<p>Configuration of home automation tools such as Home Assistant are outside the scope of this article. I have however touched on this with Home Assistant <a href="https://techlife.nz/blog/home-assistant-configure-binary-sensor-automations-based-off-mqtt-events/"> in my previous article.</a></p>
<p> </p>
<hr>
<p>Enjoyed this article? Made a similar project? I'd love to hear in the comments :-) </p>
            ]]>
        </content>
    </entry>
    <entry>
        <title>Home Assistant - Configure Binary Sensor Automations based off MQTT events</title>
        <author>
            <name>Matt</name>
        </author>
        <link href="https://techlife.nz/blog/home-assistant-configure-binary-sensor-automations-based-off-mqtt-events/"/>
        <id>https://techlife.nz/blog/home-assistant-configure-binary-sensor-automations-based-off-mqtt-events/</id>
            <category term="Home Assistant"/>
            <category term="ESP8266"/>

        <updated>2020-01-11T21:38:24+13:00</updated>
            <summary>
                <![CDATA[
                        <img src="https://techlife.nz/blog/media/posts/39/homeassistant-lg.png" alt="Home Assistant Logo" />
                    This guide follows on from Part 1, where we configured an ESP8266 as an Amazon Dash clone with a push button switch triggering MQTT events when pushed. Now that we have MQTT messages arriving at our MQTT server, we need to configure our Home Automation tool&hellip;
                ]]>
            </summary>
        <content type="html">
            <![CDATA[
                    <img src="https://techlife.nz/blog/media/posts/39/homeassistant-lg.png" alt="Home Assistant Logo" />
                <p><em>This guide follows on from <a href="https://techlife.nz/blog/create-an-esp8266-push-button-amazon-dash-clone-using-espeasy/" target="_blank" rel="noopener noreferrer">Part 1</a>, where we configured an ESP8266 as an Amazon Dash clone with a push button switch triggering MQTT events when pushed.</em></p>
<p>Now that we have MQTT messages arriving at our MQTT server, we need to configure our Home Automation tool to perform actions based off these events.</p>
<p>In this guide, I will be using Home Assistant as my smart home tool, and walk through examples for the required configuration. This guide assumes some level of familiarity with Home Assistant.</p>
<p><strong>In terms of my devices and what they look like in HA:</strong></p>
<p><img class="post__image post__image--center" src="https://techlife.nz/blog/media/posts/39//1-sm.png" alt="Home Assistant Group" width="439" height="341"></p>
<h4 id="mcetoc_1du9rqf9r0">Desired goal</h4>
<ol start="">
<li>When I push the ESP8266 button, it will turn both lights off or on.</li>
<li>When I push the ESP8266 button for 1 second or more, it will turn the Fan off/on</li>
</ol>
<p>From part 1, we currently have the following MQTT messages when the button is pushed:</p>
<pre class=" language-shell"><code class=" language-shell" lang="shell">home/matt/bedroom/lights 0
home/matt/bedroom/lights 1
home/matt/bedroom/fan 1
home/matt/bedroom/fan 0
</code></pre>
<p> Now let's connect the glue between this and Home Assistant!</p>
<h2 id="mcetoc_1du9rqf9r1">Home Assistant Configuration</h2>
<p>Below is my config from <code>configuration.yaml</code> for the 3 smart wifi power plugs I got from Aliexpress:</p>
<h3 id="mcetoc_1du9rqf9r2">Lights and Fan</h3>
<pre class=" language-yaml"><code class=" language-yaml" lang="yaml"><span class="token key atrule">switch</span><span class="token punctuation">:</span>
<span class="token punctuation">-</span> <span class="token key atrule">platform</span><span class="token punctuation">:</span> broadlink
<span class="token key atrule">host</span><span class="token punctuation">:</span> 192.168.1.32
<span class="token key atrule">mac</span><span class="token punctuation">:</span> <span class="token string">'XX:XX:XX:XX:XX:XX'</span>
<span class="token key atrule">friendly_name</span><span class="token punctuation">:</span> <span class="token string">"Matt's Desk Light"</span>
<span class="token key atrule">type</span><span class="token punctuation">:</span> sp3
<span class="token key atrule">update_interval</span><span class="token punctuation">:</span> <span class="token number">60</span>

<span class="token punctuation">-</span> <span class="token key atrule">platform</span><span class="token punctuation">:</span> broadlink
<span class="token key atrule">host</span><span class="token punctuation">:</span> 192.168.1.26
<span class="token key atrule">mac</span><span class="token punctuation">:</span> <span class="token string">'XX:XX:XX:XX:XX:XX'</span>
<span class="token key atrule">type</span><span class="token punctuation">:</span> sp3
<span class="token key atrule">friendly_name</span><span class="token punctuation">:</span> <span class="token string">"Matt's Bed Lamp"</span>
<span class="token key atrule">update_interval</span><span class="token punctuation">:</span> <span class="token number">60</span>

<span class="token punctuation">-</span> <span class="token key atrule">platform</span><span class="token punctuation">:</span> broadlink
<span class="token key atrule">host</span><span class="token punctuation">:</span> 192.168.1.25
<span class="token key atrule">mac</span><span class="token punctuation">:</span> <span class="token string">'XX:XX:XX:XX:XX:XX'</span>
<span class="token key atrule">type</span><span class="token punctuation">:</span> sp3
<span class="token key atrule">friendly_name</span><span class="token punctuation">:</span> "Plug<span class="token comment">#3" #The fan</span>
<span class="token key atrule">update_interval</span><span class="token punctuation">:</span> <span class="token number">60</span>
</code></pre>
<p>I then tie this configuration together in the GUI with a group:</p>
<pre class=" language-yaml"><code class=" language-yaml" lang="yaml"><span class="token key atrule">group</span><span class="token punctuation">:</span>
<span class="token key atrule">matt</span><span class="token punctuation">:</span>
<span class="token key atrule">name</span><span class="token punctuation">:</span> <span class="token string">'Matts Bedroom'</span>
<span class="token key atrule">entities</span><span class="token punctuation">:</span>
<span class="token punctuation">-</span> switch.matts_bed_lamp
<span class="token punctuation">-</span> switch.matts_desk_light
<span class="token punctuation">-</span> switch.plug3
<span class="token punctuation">-</span> sensor.matt_bedroom_temperature
<span class="token punctuation">-</span> sensor.matt_bedroom_humidity
</code></pre>
<h3 id="mcetoc_1du9rqf9r3">Creating Binary Sensors for the MQTT events</h3>
<p>First we configure our MQTT broker/server. Then we configure a binary sensor for the lights based off the 1 or 0 payload for each topic:</p>
<p>Still in <code>configuration.yaml</code></p>
<pre class=" language-yaml"><code class=" language-yaml" lang="yaml"><span class="token key atrule">mqtt</span><span class="token punctuation">:</span>
<span class="token key atrule">broker</span><span class="token punctuation">:</span> 192.168.1.xxx

<span class="token key atrule">binary_sensor</span><span class="token punctuation">:</span>
<span class="token punctuation">-</span> <span class="token key atrule">platform</span><span class="token punctuation">:</span> mqtt
<span class="token key atrule">name</span><span class="token punctuation">:</span> matt_lights
<span class="token key atrule">state_topic</span><span class="token punctuation">:</span> <span class="token string">"home/matt/bedroom/lights"</span>
<span class="token key atrule">payload_on</span><span class="token punctuation">:</span> <span class="token string">"1"</span>
<span class="token key atrule">payload_off</span><span class="token punctuation">:</span> <span class="token string">"0"</span>

binary_sensor 2<span class="token punctuation">:</span>
<span class="token punctuation">-</span> <span class="token key atrule">platform</span><span class="token punctuation">:</span> mqtt
<span class="token key atrule">name</span><span class="token punctuation">:</span> matt_fan
<span class="token key atrule">state_topic</span><span class="token punctuation">:</span> <span class="token string">"home/matt/bedroom/fan"</span>
<span class="token key atrule">payload_on</span><span class="token punctuation">:</span> <span class="token string">"1"</span>
<span class="token key atrule">payload_off</span><span class="token punctuation">:</span> <span class="token string">"0"</span></code></pre>
<p>If you reload HASS at this point, you should see two new binary sensors appear in the GUI. Try pressing the button on the ESP8266 and see if the MQTT events trigger the switch in HASS.</p>
<h3 id="mcetoc_1du9rqf9r4">Configure Home Assistant Automations</h3>
<p>The Automations bring all the variables together to perform the desired actions.</p>
<p>In <code>automations.yaml</code></p>
<pre class=" language-yaml"><code class=" language-yaml" lang="yaml">
<span class="token punctuation">-</span> <span class="token key atrule">alias</span><span class="token punctuation">:</span> <span class="token string">'ESP Button Lights'</span>
<span class="token key atrule">trigger</span><span class="token punctuation">:</span>
<span class="token punctuation">-</span> <span class="token key atrule">platform</span><span class="token punctuation">:</span> state
<span class="token key atrule">entity_id</span><span class="token punctuation">:</span> binary_sensor.matt_lights
<span class="token key atrule">to</span><span class="token punctuation">:</span> <span class="token string">'on'</span>
<span class="token punctuation">-</span> <span class="token key atrule">platform</span><span class="token punctuation">:</span> state
<span class="token key atrule">entity_id</span><span class="token punctuation">:</span> binary_sensor.matt_lights
<span class="token key atrule">to</span><span class="token punctuation">:</span> <span class="token string">'off'</span>
<span class="token key atrule">action</span><span class="token punctuation">:</span>
<span class="token key atrule">service</span><span class="token punctuation">:</span> switch.toggle
<span class="token key atrule">entity_id</span><span class="token punctuation">:</span>
<span class="token punctuation">-</span> switch.matts_bed_lamp
<span class="token punctuation">-</span> switch.matts_desk_light

<span class="token punctuation">-</span> <span class="token key atrule">alias</span><span class="token punctuation">:</span> <span class="token string">'ESP Button Fan'</span>
<span class="token key atrule">trigger</span><span class="token punctuation">:</span>
<span class="token punctuation">-</span> <span class="token key atrule">platform</span><span class="token punctuation">:</span> state
<span class="token key atrule">entity_id</span><span class="token punctuation">:</span> binary_sensor.matt_fan
<span class="token key atrule">to</span><span class="token punctuation">:</span> <span class="token string">'on'</span>
<span class="token punctuation">-</span> <span class="token key atrule">platform</span><span class="token punctuation">:</span> state
<span class="token key atrule">entity_id</span><span class="token punctuation">:</span> binary_sensor.matt_fan
<span class="token key atrule">to</span><span class="token punctuation">:</span> <span class="token string">'off'</span>
<span class="token key atrule">action</span><span class="token punctuation">:</span>
<span class="token key atrule">service</span><span class="token punctuation">:</span> switch.toggle
<span class="token key atrule">entity_id</span><span class="token punctuation">:</span> switch.plug3
</code></pre>
<h3 id="mcetoc_1du9rqf9r5">Tidying up</h3>
<p>Now that we have the automation working, let's remove these extra buttons from being visible in the Home Assistant GUI</p>
<p>In <code>customize.yaml</code></p>
<pre class=" language-yaml"><code class=" language-yaml" lang="yaml"><span class="token key atrule">switch.plug3</span><span class="token punctuation">:</span>
<span class="token key atrule">friendly_name</span><span class="token punctuation">:</span> Matt<span class="token punctuation">-</span>Fan
<span class="token key atrule">binary_sensor.matt_lights</span><span class="token punctuation">:</span>
<span class="token key atrule">hidden</span><span class="token punctuation">:</span> <span class="token boolean important">true</span>
<span class="token key atrule">binary_sensor.matt_fan</span><span class="token punctuation">:</span>
<span class="token key atrule">hidden</span><span class="token punctuation">:</span> <span class="token boolean important">true</span>
<span class="token key atrule">automation.esp_button_fan</span><span class="token punctuation">:</span>
<span class="token key atrule">hidden</span><span class="token punctuation">:</span> <span class="token boolean important">true</span>
<span class="token key atrule">automation.esp_button_lights</span><span class="token punctuation">:</span>
<span class="token key atrule">hidden</span><span class="token punctuation">:</span> <span class="token boolean important">true</span>
</code></pre>
<p>After a final restart of HA, our GUI should be looking good, and ESP button triggering the correct actions!</p>
<h2 id="mcetoc_1du9rqf9r6">Conclusion</h2>
<p>In this guide, we looked at the required configuration for binary MQTT sensors for Home Assistant. We then used HA Automations to turn specific devices off or on using our binary sensor.</p>
<p>I hope this example configuration has been useful for your own binary sensors and automations within Home Assistant :-)</p>
            ]]>
        </content>
    </entry>
    <entry>
        <title>Create an ESP8266 Push button Amazon Dash clone using ESPEasy</title>
        <author>
            <name>Matt</name>
        </author>
        <link href="https://techlife.nz/blog/create-an-esp8266-push-button-amazon-dash-clone-using-espeasy/"/>
        <id>https://techlife.nz/blog/create-an-esp8266-push-button-amazon-dash-clone-using-espeasy/</id>
            <category term="ESP8266"/>

        <updated>2020-01-11T21:55:48+13:00</updated>
            <summary>
                <![CDATA[
                        <img src="https://techlife.nz/blog/media/posts/38/esp_push_button-lg.png" alt="Create an ESP8266 Push button Amazon Dash clone using ESPEasy" />
                    I have a problem, which can only be solved with over engineered solutions... Specifically, I have two desk lamps, as well as a fan with smart WIFI power plugs I normally turn off and on using my phone. The problem is I've stopped charging my&hellip;
                ]]>
            </summary>
        <content type="html">
            <![CDATA[
                    <img src="https://techlife.nz/blog/media/posts/38/esp_push_button-lg.png" alt="Create an ESP8266 Push button Amazon Dash clone using ESPEasy" />
                <p><strong>I have a problem, which can only be solved with over engineered solutions...</strong></p>
<p>Specifically, I have two desk lamps, as well as a fan with smart WIFI power plugs I normally turn off and on using my phone. The problem is I've stopped charging my phone in my bed room to remove one more distraction before going to bed.</p>
<p>So - how do I now turn off/on the lights/fan in my room if I don't have a conveniently located switch? With an ESP8266 of course!</p>
<p>This guide differs from others on ESPEasy in that it covers actions based on both a short button press, and also a long button press triggering a different action.</p>
<p><strong>In the first part of this guide, I'm going to cover:</strong></p>
<ul>
<li>What is ESPEasy and how to compile and install it within Arduino IDE</li>
<li>Adding in the "long push button" feature plugin</li>
<li>Adding a simple push button switch to an ESP8266</li>
<li>Sending actions to an MQTT server</li>
</ul>
<p>In <a href="https://techlife.nz/blog/home-assistant-configure-binary-sensor-automations-based-of-mqtt-events/" target="_blank" rel="noopener noreferrer">part 2</a> I cover what's required to get actions from ESPEasy generated MQTT messages triggering automations within <strong>Home Assistant</strong></p>
<h2 id="mcetoc_1du9r1m100">Introduction</h2>
<p>The ESP8266 is a dirt cheap microcontroller (~ $2-3USD from Aliexpress) with WiFi and at least two usable GPIO pins (for things like switches or temperature sensors). It comes in multiple variants with Wikipedia covering a good overview of the range of options. I personally recommend either the <strong>NodeMCU</strong> or <strong>Wemos</strong> <strong>D1</strong> <strong>mini</strong> as both can simply be powered and programmed via microUSB, contain a number of usable GPIO pins, and don't require other hurdles like converting power down to 3.3V such as on the ESP-01. </p>
<p>For those new to Ardiunos and the ESP2866 who fear getting stuck in C code and other low level programming languages, there are few good options for new comers which aren't so scary. In this case, <strong>ESPEasy</strong> is a great starting point.</p>
<h2 id="mcetoc_1du9r1m101">What is ESPEasy?</h2>
<p><strong>ESPEasy</strong> is a GUI based operating system for the ESP8266 and its bigger brother the ESP32. It comes with a plethora of features and functionality, offering great versatility around working with all different sorts of sensors and relays.</p>
<p>I really like it because it means I don't have to have multiple different Ardiuno IDE projects for different IoT devices with only specific tasks around the house where I forget the detail of the code of each project. Instead I can use the browser based GUI on each ESP to perform tasks with the different types of sensors connected to each device.</p>
<h2 id="mcetoc_1du9r1m112">How to compile and install with Arduino IDE</h2>
<p><strong>Firstly why?</strong></p>
<p>My conundrum is I want <strong>one push button switch</strong> to perform multiple tasks. Specifically:</p>
<ul>
<li>Short press will trigger the two lights off/on with MQTT</li>
<li>Long press will trigger the fan off/on with MQTT</li>
</ul>
<p>If you only want one action i.e. short button press triggering an action, then the default compiled binaries of ESPEasy is more than fine for this purpose. However, if you want a second action based off a long button press, you need a plugin <a href="https://www.letscontrolit.com/forum/viewtopic.php?p=33447#p33447">detailed here</a>, which needs to be compiled into ESPEasy.</p>
<p>Regardless of either option, I recommend installing a pre-compiled version of ESPEasy first to ensure its working on your ESP8266.</p>
<h3 id="mcetoc_1du9r1m113">Compiling</h3>
<p>I referred to the ESPEasy documentation <a href="https://www.letscontrolit.com/wiki/index.php?title=Tutorial_Arduino_Firmware_Upload">here.</a></p>
<p><strong>Some thoughts after following the docs:</strong></p>
<ul>
<li>If you've already got Arduino IDE installed, don't bother re-downloading and installing it. Instead, copy your Ardiuno IDE install directory somewhere outside of "C:/Program Files" to make a portable version. This is because you can then install the required ESPEasy libraries in the new location without impacting any other Arduino IDE projects relying on similar but different version libraries.</li>
<li>When downloading the firmware from <a href="https://github.com/letscontrolit/ESPEasy/releases">https://github.com/letscontrolit/ESPEasy/releases</a>, it comes with two folders, <strong>lib</strong>, and <strong>source</strong>.
<ul>
<li>Copy the contents of <strong>lib</strong> into the <strong>libraries</strong> folder within the portable copy of Arduino IDE.</li>
<li>Inside source there is another folder called <strong>src</strong>. rename the <strong>src</strong> directory to <strong>ESPEasy</strong>. Note: The letter case matters!</li>
</ul>
</li>
<li>Open Arduino IDE from the portable version, and then load ESPEasy.ino from within it</li>
<li>Try compiling ESPEasy first before trying to upload it to the physical hardware.</li>
</ul>
Assuming you now have your own compiled version of ESPEasy working on an ESP8266, it's now time to get the plugins working.
<h4 id="mcetoc_1du9r1m114">Download long button press feature</h4>
<p>ESPEasy has a bunch of user-contributed plugins which may or may not be considered stable or tested, and can be downloaded here: <a href="https://github.com/enesbcs/ESPEasyPluginPlayground" target="_blank" class="url" rel="noopener noreferrer">https://github.com/enesbcs/ESPEasyPluginPlayground</a>. A number of stable plugins already come with ESPEasy in the previously download source files.</p>
<p>In our case, the long button press feature <a href="https://github.com/enesbcs/ESPEasyPluginPlayground/blob/master/_P159_Pushbutton.ino"><strong>_P159_Pushbutton.ino</strong></a> has not yet reached the stable state. Download it from github and add it to the "ESPEasy" directory created earlier.</p>
<h4 id="mcetoc_1du9r1m115">Making the plugin work in ESPEasy.</h4>
<p>Unfortunately the <a href="https://www.letscontrolit.com/wiki/index.php?title=Tutorial_Arduino_Firmware_Upload#Selecting_the_plugin_sets">plugin docs</a> are not entirely correct and there was a couple things I had to do to make it work.</p>
<p>In <a href="https://github.com/enesbcs/ESPEasyPluginPlayground/blob/edbdc7efce43db9250ba1c78a0da41e01be6b5d6/_P159_Pushbutton.ino#L13">line 13</a> of <strong>_P159_Pushbutton.ino</strong>, the plugin is currently in the testing phase. This means we need to enable PLUGIN_BUILD_TESTING support in <strong>ESPEasy.ino</strong>. We also need to define <code>_P159_Pushbutton</code> as part of PLUGIN_BUILD_TESTING in <strong>define_plugin_sets.h</strong></p>
<p><strong>In ESPEasy.ino</strong>:</p>
<pre class=" language-diff"><code class=" language-diff" lang="diff">// Define globals before plugin sets to allow a personal override of the selected plugins
#include "ESPEasy-Globals.h"
#include "define_plugin_sets.h"
// Plugin helper needs the defined controller sets, thus include after 'define_plugin_sets.h'
#include "_CPlugin_Helper.h"

<span class="token inserted">++//build all the normal stable plugins</span>
<span class="token inserted">++//#define PLUGIN_BUILD_NORMAL</span>
<span class="token inserted">++</span>
<span class="token inserted">++//build all plugins that are in test stadium</span>
<span class="token inserted">++#define PLUGIN_BUILD_TESTING</span>
<span class="token inserted">++</span>
<span class="token inserted">++//build all plugins that still are being developed and are broken or incomplete</span>
<span class="token inserted">++//#define PLUGIN_BUILD_DEV</span>
</code></pre>
<p>Technically all we need is <code>#define PLUGIN_BUILD_TESTING</code> however I have the others above commented out for context. We could include all 3 but depending on which ESP8266 you have, it may not have enough flash space.</p>
<p><strong>In define_plugin_sets.h</strong>:</p>
<pre class=" language-diff"><code class=" language-diff" lang="diff">// TESTING #####################################
#ifdef PLUGIN_SET_TESTING
#define USES_P045 // MPU6050
#define USES_P047 // I2C_soil_misture
#define USES_P048 // Motoshield_v2

...output omitted...

#define USES_P078 // Eastron Modbus Energy meters
#define USES_P079 // Wemos Motoshield
#define USES_P080 // iButton Sensor DS1990A
#define USES_P081 // Cron
<span class="token inserted">++ #define USES_P159 // Pushbutton</span>
#endif
</code></pre>
<p>Re-compile ESPEasy and upload it again to the ESP.</p>
<h4 id="mcetoc_1du9r1m116">Verify plugin is available</h4>
<p>Boot the ESP8266 and verify the <strong>Pushbutton</strong> plugin in available in the GUI.</p>
<p> </p>
<img class="post__image post__image--center" src="https://techlife.nz/blog/media/posts/38//1-lg.jpg" alt="ESP Easy Switch input - Push Button option" width="775" height="571">
<p>If you have a serial monitor enabled while booting the ESP8266, you also see the plugin types loaded:</p>
<p><code>309 : INFO : Plugins: 47 [Normal] [Testing] (ESP82xx Core 2_4_2, NONOS SDK 2.2.1(cfd48f3), LWIP: 2.0.3)</code></p>
<h2 id="mcetoc_1du9r1m117">Configuration</h2>
<h3 id="mcetoc_1du9r1m118">Configuring "Switch input - Pushbutton" in ESPEasy</h3>
<p>At this point our plugin is installed and available. Now its time to actually connect a switch, and make it do something.</p>
<p>As previously mentioned, I want my push button to turn my lights on/off via MQTT with a quick button press. If I press the switch for a couple of seconds, instead I want via MQTT to turn my fan off/on.</p>
<p>To do so, I've configured my Pushbutton like so:<br><br></p>
<img class="post__image post__image--center" src="https://techlife.nz/blog/media/posts/38//2-lg.jpg" alt="ESPEasy GPIO Pin Assignment" width="779" height="782">
<p><strong>Notes on above:</strong></p>
<ul>
<li>Give the device a name and obviously enable it.</li>
<li>Because I have the switch connected between the GND pin, and D6 on my ESP, I need to enable "Internal PullUp". When the switch is pressed it detects this through the pin being pulled HIGH.</li>
<li>Choose how long you want the button to be pressed for a "long press" to be detected.</li>
<li>You'll note "Send to Controller" is not selected. This is because we will do this using "rules" later on.</li>
<li>Assuming you only have two actions (short or long), configure two values with a relevant name for each. Also change decimals to 0. When we get the MQTT event, 0 will be OFF, and 1 will be ON.
<ul>
<li><strong>Note:</strong> I think there's a bug and I had to have #1 configured with <code>switch</code> as the name. Will explain more in rules section.</li>
</ul>
</li>
</ul>
<p>Are we done? Not yet! Now we need to configure "rules" to make all of the above work.</p>
<h3 id="mcetoc_1du9r1m119">Configuring Pushbutton Rules</h3>
<p>Rules provide further granularity in device configuration, and provide an extra level of "smarts".</p>
<p>You can find more info on the ESPEasy wiki <a href="https://www.letscontrolit.com/wiki/index.php/Tutorial_Rules">here.</a></p>
<p>First we need to enable Rules support. Do this by <code>Tools &gt; Advanced &gt; Rules</code>. Make sure "Old Engine" is also enabled (only required if you're running a recent daily release of ESPEasy). Click "Submit" at the bottom to save this.</p>
<p>We now have a new Rules tab. Select this to begin creating our rule.</p>
<p>If you're following the guide, and have configured things exactly as per the screenshot above, the below config will work:</p>
<pre><code>on switch#Shortpress do
event,preparedatalight
endon

on switch#Longpress do
If [switch#fan]=0
taskvalueset,2,2,1
Else
taskvalueset,2,2,0
EndIf
event,preparedatafan
EndOn

on preparedatalight do
Publish %sysname%/switch/lights,[switch#switch]
endon

on preparedatafan do
Publish %sysname%/switch/fan,[switch#fan]
endon
</code></pre>
<p><strong>So what's this doing?</strong></p>
<ul>
<li>The plugin defines two variable types of <strong>shortpress</strong> or <strong>longpress</strong>. We match on these event types and then define what to do with them in the <strong>preparedata</strong> light/fan sections.</li>
<li>My understanding is "switch" refers to the global variable of switch (the top "switch" in yellow in previous screenshot), however in practice I noticed the bottom "switch" in yellow also played an effect. If I changed the latter, the above code would not trigger, so I've simply left both as "switch"...</li>
<li><code>event</code> tells it to process the specified event</li>
<li>with <code>switch#Longpress</code> we use an <code>if</code> statement to determine whether the fan is currently off (0) and then turn it on with taskvalueset. If it is already on, we turn it off with the alternative taskvalueset.
<ul>
<li><code>taskvalueset,x,y,z</code> is used to set the value with a specified action. The short press already has off/on toggle defined within ESPEasy and doesn't require this extra logic, but we do require it for the longpress since this isn't a native feature.</li>
<li>x - This is the device number in the list of sensors from the "Devices" tab. If you only have 1 sensor, make this 1.</li>
<li>y - This is the device sub-value number. In the previous push button screenshot, "Switch" is 1, and "Fan" is 2.</li>
<li>Z - 1 = ON, 0 = OFF</li>
<li>Finally we trigger <code>event</code> preparedatafan to fire off an MQTT event with the long press result.</li>
</ul>
</li>
<li><code>preparedata</code> light/fan use <code>Publish</code> to fire off the desired MQTT event with the switch's state of 0 or 1. We will configure our MQTT server in the next section.</li>
</ul>
<h3 id="mcetoc_1du9r1m11a">MQTT Configuration</h3>
<p>Now that we've configured our rules, we need to define a server to point them at.</p>
<p>In my case I'm running <a href="https://mosquitto.org/">Mosquitto</a> on my Ubuntu Server. This is as simple as:</p>
<pre class=" language-shell"><code class=" language-shell" lang="shell"><span class="token function">sudo</span> apt update <span class="token operator">&amp;&amp;</span> <span class="token function">sudo</span> apt <span class="token function">install</span> -y mosquitto mosquitto-clients</code></pre>
<h4 id="mcetoc_1du9r1m11b">ESPEasy MQTT config</h4>
<p>Below is my configuration. ESPEasy has a number of different protocol options, and I read somewhere that "OpenHAB MQTT" is a good option for Mosquitto. Of main importance here is Controller IP address (your server's IP) and the port MQTT server is running on. Mosquitto by default uses 1883.<br><br></p>
<img class="post__image post__image--center" src="https://techlife.nz/blog/media/posts/38//3-lg.jpg" alt="ESPEasy MQTT Config" width="711" height="707">
<h4 id="mcetoc_1du9r1m11c">Verify MQTT config is working</h4>
<p>We can use <code>mosquitto_sub</code> to see all MQTT messages our server may be receiving. To do so, issue the following command:</p>
<pre class=" language-shell"><code class=" language-shell" lang="shell">matt@server:~$ mosquitto_sub -v -t <span class="token comment">#</span>
/ESP_Easy/status/LWT Connected

</code></pre>
<p><code>-v</code> enables verbose output while <code>-t #</code> subscribes to all MQTT topics.</p>
<p><strong>Finally - let's try our switch!</strong></p>
<pre class=" language-shell"><code class=" language-shell" lang="shell">matt@server:~$ mosquitto_sub -v -t <span class="token comment">#</span>
/ESP_Easy/status/LWT Connected
ESP_Easy/switch/lights 1
ESP_Easy/switch/lights 0
ESP_Easy/switch/lights 1
ESP_Easy/switch/lights 0
ESP_Easy/switch/fan 1
ESP_Easy/switch/fan 0
ESP_Easy/switch/lights 1
ESP_Easy/switch/lights 0</code></pre>
<p>Great - We now have MQTT events for OFF/ON which can be used with our desired Home Automation tool to pass the events!</p>
<h2 id="mcetoc_1du9r1m11d">Conclusion</h2>
<p>In this guide we covered ESPEasy and the flexibility it provides for ESP8266 IoT devices as a simple [over engineered!] wifi push button switch. We looked at how to compile ESPEasy from scratch and also get plugins working within it. Finally, we configured our push button to send MQTT messages based off different short/long press events.</p>
<p>In <a href="https://techlife.nz/blog/home-assistant-configure-binary-sensor-automations-based-of-mqtt-events/" target="_blank" rel="noopener noreferrer">part two</a>, I explain how to take the MQTT events and configure Automations (actually turning the lights off/on!) within <strong><a href="https://www.home-assistant.io/">Home Assistant.</a></strong></p>
<p>I hope you've enjoyed reading this, and you found this guide useful.</p>
            ]]>
        </content>
    </entry>
    <entry>
        <title>Rename photos into Dropbox YYYY-MM-DD HH.MM.SS format using &quot;Advanced Renamer&quot;</title>
        <author>
            <name>Matt</name>
        </author>
        <link href="https://techlife.nz/blog/rename-photos-into-dropbox-naming-convention-using-advanced-renamer/"/>
        <id>https://techlife.nz/blog/rename-photos-into-dropbox-naming-convention-using-advanced-renamer/</id>
            <category term="Guides"/>

        <updated>2018-12-26T14:19:50+13:00</updated>
            <summary>
                <![CDATA[
                        <img src="https://techlife.nz/blog/media/posts/37/2.png" alt="" />
                    PrefaceFor years, I have backed up photos from my smart phone using Dropbox. My primary purpose for this other than backing up my photos is because all images are backed up with the following file syntax: YYYY-MM-DD HH.MM.SSE.g. 2017-05-01 15.01.44.jpg After a couple of years&hellip;
                ]]>
            </summary>
        <content type="html">
            <![CDATA[
                    <img src="https://techlife.nz/blog/media/posts/37/2.png" alt="" />
                <h1 id="mcetoc_1cvk153ja0">Preface</h1>
<p>For years, I have backed up photos from my smart phone using Dropbox.</p>
<p>My primary purpose for this other than backing up my photos is because all images are backed up with the following file syntax:</p>
<pre><code>YYYY-MM-DD HH.MM.SS</code></pre>
<p>E.g. 2017-05-01 15.01.44.jpg</p>
<p>After a couple of years having photos backed up like this, I found it super handy for sorting all my photos, and undeniably one of the best features of the Dropbox phone app.</p>
<p>For the first few years this was great as I had about 8GB of free space, but then I hit the free storage limits..</p>
<p>Personally I find Dropbox's prices a bit ridiculous (I really don't need 1TB in the cloud), so I opted for a year of Google Drive.</p>
<p>However, I faced a new conundrum. Google Drive does not rename the phone's photos when they upload. So what am I to do?</p>
<p>Alas, for several years I've just moved my backed up photos from Dropbox to Google Drive….yep, not pretty.</p>
<p>However, after finding a similar new problem where I'm now backing up photos from my mirrorless Sony Camera, I face the same problem…What to do…</p>
<p>Some would ask, why not just use a python script or something to rename your photos, but I haven't come across anything from a quick google search, nor did I want to write my own.</p>
<p>So - this brings me to discovering <strong>Advanced Renamer.</strong> <br><br></p>
<h1 id="mcetoc_1cvk153ja1">Introduction</h1>
<p>Advanced Renamer is a pretty self-explanatory tool for renaming files in bulk.</p>
<p>It has a ton of flexibility, and I was happy to find it can do exactly what I'm after without too much effort.</p>
<h3 id="mcetoc_1cvk153ja2">Features</h3>
<ul>
<li><a href="https://www.advancedrenamer.com/user_guide/tags_image">Image renaming with EXIF support</a></li>
<li><a href="https://www.advancedrenamer.com/user_guide/tags_gps">Use GPS information from image files</a></li>
<li><a href="https://www.advancedrenamer.com/user_guide/method_newname">New name with Tags</a></li>
<li><a href="https://www.advancedrenamer.com/user_guide/tvshowimport">Use imported TV Show data when renaming</a></li>
<li>Use <a href="https://www.advancedrenamer.com/user_guide/method_replace">Regular expressions</a> and Wildcards</li>
</ul>
<p>For more specifics, you can refer to its documentation: <a href="https://www.advancedrenamer.com/user_guide/" target="_blank" class="url" rel="noopener noreferrer">https://www.advancedrenamer.com/user_guide/</a> </p>
<h2 id="mcetoc_1cvk153ja3">Renaming pairs of RAW and JPG files</h2>
<p>Folders which contain different types of files with the same name can be "paired". In the case of RAW and JPG files, <strong>Advanced Renamer</strong> can be configured to rename based on the time in the JPG source for both the JPG and RAW files.</p>
<p>Start <strong>Advanced Renamer</strong>, and select your source directory of files to convert:</p>
<p><img src="https://techlife.nz/blog/media/posts/37/1.png" alt="1" width="1066" height="692"></p>
<p>This will load your images like so:</p>
<p><img src="https://techlife.nz/blog/media/posts/37/2.png" alt="2" width="1186" height="697"></p>
<p>I then configured the following method to get my photos in the same naming format:</p>
<pre><code>&lt;Img Year&gt;-&lt;Img Month&gt;-&lt;Img Day&gt; &lt;Img Hour&gt;.&lt;Img Min&gt;.&lt;Img Sec&gt;</code></pre>
<p>To configure this, navigate to "Add Method &gt; New Name", and paste in the above like so:</p>
<p><img src="https://techlife.nz/blog/media/posts/37/3.png" alt="3" width="1236" height="702"></p>
<p>Advanced Renamer then shows a preview of the expected new file names before committing to any final change.</p>
<p>Click <strong>"Start batch"</strong> to rename all the files.</p>
<h2 id="mcetoc_1cvk153ja4">Renaming RAW photos only</h2>
<p>Directories which only have RAW images, using the &lt;img&gt; tag does not seem to work. Thankfully, <strong>Advanced Renamer</strong> has support for pulling in information from third-party tools, such as <a href="https://developer.mozilla.org/en/SpiderMonkey">SpiderMonkey</a>, <a href="http://mediainfo.sourceforge.net/en">MediaInfo</a>, <a href="http://www.sno.phy.queensu.ca/~phil/exiftool">ExifTool</a>, and <a href="https://icons8.com/">Icons8</a>.</p>
<p>In our case dealing with RAW images, we can rename our photos with Dropbox-like photo syntax by doing the following steps:</p>
<p>First import the directories of your RAW images. To get an idea on what EXIF data we can match on, select one of the images and click "ExifTool…"</p>
<p><img src="https://techlife.nz/blog/media/posts/37/4.png" alt="4" width="1052" height="700"></p>
<p>This is useful, as it provides a number of different fields we can match on:</p>
<p><img src="https://techlife.nz/blog/media/posts/37/5.png" alt="5" width="601" height="541"></p>
<p>In my case, I'm matching on "DateTimeOriginal".</p>
<p>Copy the Tag above, and close ExifTool.</p>
<p>Create a new rename method by selecting "Add Method &gt; New Name". Paste the above syntax like so:</p>
<p><img src="https://techlife.nz/blog/media/posts/37/6.png" alt="6" width="1050" height="704"></p>
<p>While this has now put the date and time in the correct order, it has used underscores through the whole file name. Gross!</p>
<p>Let's fix this with a second rename rule.</p>
<p>Thanks to some <a href="https://www.advancedrenamer.com/forum_thread?forum_id=5797">RegEx help</a>, I was able to get the formatting in just the way I wanted.</p>
<p><strong>To do so:</strong></p>
<p>Add a "Replace" method after the existing "New Name" and select "Use regular expressions".</p>
<p>Text to be replaced: <code>_(\d{2})_(\d{2} \d{2})_(\d{2})_</code><br>Replace with: <code>-\1-\2.\3.</code></p>
<p><img src="https://techlife.nz/blog/media/posts/37/7.png" alt="" width="1051" height="703"></p>
<p>Advanced Renamer also has some further useful documentation on using RegEx here:</p>
<p><a href="http://www.advancedrenamer.com/user_guide/regular_expresions">www.advancedrenamer.com/user_guide/regular_expresions</a>.</p>
<p><strong>Tip:</strong> If photos have the same name (e.g. same time stamp), you can configure a "Name collison rule". As above I have "Append number" selected.<br> </p>
<h1 id="mcetoc_1cvk153ja5">Conclusion</h1>
<p>As seen above, with relative ease Advanced Renamer can be super handy for renaming files such as images in bulk and ease. :-)</p>
            ]]>
        </content>
    </entry>
    <entry>
        <title>IPTV: How to stream all Freeview Channels on to your network</title>
        <author>
            <name>Matt</name>
        </author>
        <link href="https://techlife.nz/blog/iptv-how-to-stream-all-freeview-channels-on-to-your-network/"/>
        <id>https://techlife.nz/blog/iptv-how-to-stream-all-freeview-channels-on-to-your-network/</id>
            <category term="IPTV"/>
            <category term="Guides"/>

        <updated>2018-12-26T17:10:57+13:00</updated>
            <summary>
                <![CDATA[
                        <img src="https://techlife.nz/blog/media/posts/5/sld1.jpg" alt="" />
                     First of all I can't help but recommend you read the Angry Technician's post How to stream EVERY channel from Freeview onto your network as he's written an excellent tutorial on what I'm going to also try and explain below. I've spent some time&hellip;
                ]]>
            </summary>
        <content type="html">
            <![CDATA[
                    <img src="https://techlife.nz/blog/media/posts/5/sld1.jpg" alt="" />
                <p><a href="http://mattie47.com/wp-content/uploads/2012/08/channels2.jpg"><img class="post__image--right" src="https://techlife.nz/blog/media/posts/5/channels2-1024x800.jpg" alt="Receiving 9 multicast channels at once" width="374" height="292"></a></p>
<h1 id="mcetoc_1cvkb22gc0">Introduction</h1>
<p>First of all I can't help but recommend you read the <a href="http://angrytechnician.wordpress.com/">Angry Technician's</a> post <a href="http://angrytechnician.wordpress.com/2010/07/23/how-to-stream-every-channel-from-freeview-onto-your-network/">How to stream EVERY channel from Freeview onto your network</a> as he's written an excellent tutorial on what I'm going to also try and explain below.</p>
<p>I've spent some time fine tuning (huh, get it? cause we're tuning in...oh forget it) my setup based on his tutorial and hopefully it will provide you with some more examples and help in getting TV streaming across your network.</p>
<h2 id="mcetoc_1cvkb22gc1">What you will need</h2>
<h3 id="mcetoc_1cvkb22gc2">1. Some Linux knowledge</h3>
<p>You could say this is quite an ambitious project and <strong>you'll need to be able to do things like install Linux on a dedicated machine, install tuners, get drivers working etc</strong>. If all this is new to you, good luck, and I still recommend you give it a go. Admittedly I got it all working within a couple of hours, and at the time of first setting this up in 2012, I was quite a Linux novice. Through this project, I have acquired a lot of skills and knowledge of Linux, so for me it's been very good.</p>
<h3 id="mcetoc_1cvkb22gc3">2. Some networking knowledge</h3>
<p>Sweet so you have some Linux knowledge maybe? That's great but this could become quite an intermediate to expert project. It really depends on the network you're plugging the IPTV server into.</p>
<p><strong>I would highly recommend at minimum using a Gigabit Switch.</strong> There's quite a lot of ways you could have the traffic flow to clients, and each configuration suits different scenarios. E.G. If you have specific hosts purely for receiving TV, you could simply have a separate VLAN the TV box and clients are connected to. Traffic would then just spam out all connected ports in the VLAN, basically this would be a broadcast network. This probably isn't practical though, and what you would do instead is enable a feature called <a href="http://en.wikipedia.org/wiki/IGMP_snooping">IGMP Snooping</a>. This will probably be satisfactory enough for small networks, but if you are running the multicast over a<a href="http://en.wikipedia.org/wiki/Network_layer"> Layer 3 network</a>, you will need to have a look at PIM-DM or PIM-SM.</p>
<h3 id="mcetoc_1cvkb22gc4">3. At least 1 Terrestrial or Satellite TV tuner</h3>
<p>This really comes down to your budget and how many channels you want to be able to stream. Basically you will need at least 1 tuner per frequency for channels you want to receive. Here in Christchurch NZ, we currently have 16 TV channels and 3 Radio stations transmitted over 3 frequencies. This means I only need 3 tuners to be able to stream all channels at once. Effectively 3 tuners.</p>
<h3 id="mcetoc_1cvkb22gc5">4. Dedicated PC</h3>
<p>This could just be an old 1GHZ pc with 1gb of ram. Nothing fancy, as we're simply sending the received digital data and multicasting the traffic on to the network. A 1Gbit Network card would be recommended though. Make sure you have enough free PCI/PCI-E/USB ports for tuners too.</p>
<p>The box after inserting several NICs and the Tuners</p>
<h2 id="mcetoc_1cvkb22gc6">Post OS installation</h2>
<p>I won't go into detail with physical installation, nor installing your choice of Linux (I recommend Ubuntu) but once you do have it installed, probably the first thing I'd suggest you do is make sure your tuners are coming up correctly and working.</p>
<p>Simply open a terminal and enter:<br><code>$ ls /dev/dvb/</code></p>
<p>Depending on how many tuners you have, you should see <code>adapter0</code>, <code>adaptor1</code> etc for each tuner. If you don't see any tuners, it's probably time to start googling support for your tuner, but you can also find more log info by typing <code>dmesg</code>. I'm simply suggesting all this as the HVR2210 I have didn't work out of the box for me. If you have this card, I believe my solution was:</p>
<pre><code class="language-shell" lang="shell">cd /lib/firmware/
sudo wget http://www.steventoth.net/linux/hvr22xx/firmwares/4019072/NXP7164-2010-03-10.1.fw

Reboot the machine
</code></pre>
<p><strong>Still with me? Lets get started!</strong></p>
<h2 id="mcetoc_1cvkb22gc7">Programs to install</h2>
<ul>
<li>Ubuntu - Or your choice of OS.</li>
<li>VLC - Possibly not needed, but very helpful for diagnosis</li>
<li>Vino - VNC Server that comes with Ubuntu</li>
<li>dvb-apps - A package containing various different tools for dvb cards</li>
<li>dvblast - Made by the same people as VLC. This is what multicasts all the channels out.</li>
<li>minisapserver - For creating the channel playlist in VLC.</li>
<li>udpxy - Converts the RTP multicast streams into unicast HTTP streams. Useful for viewing the TV streams on devices not capable of receiving multicast streams.</li>
</ul>
<h3 id="mcetoc_1cvkb22gc8">Installation</h3>
<p>Open a terminal and enter the following:</p>
<pre><code class="language-shell" lang="shell"> sudo -s 
 apt update
 apt install dvb-apps minisapserver vlc
</code></pre>
<publii-non-amp><details> <summary><strong>Expand if you're new to linux</strong></summary> <strong>Apt</strong> would probably be one of my favorite things since using linux.
<p>Ubuntu/linux comes pre-loaded with a database of resources hosting apps and utilities that you can request to download from without having to manually go to the website, find the download link, wait for it to finish and then install.</p>
<p>Instead you can do above and it will download it and install it for you! There's also a gui "app store" as such called synaptic package manager, and also the ubuntu software center.</p>
</details></publii-non-amp>
<h3 id="mcetoc_1cvkb22gc9">Compiling and Installing DVBlast from source</h3>
<p>You could also simply add dvblast to the above list above, but at the time I had issues with SD channels (sound not working) which resulted in me needing the current unstable version.</p>
<p>More info is available on the commands below again on another Angry Tech <a href="http://angrytechnician.wordpress.com/2011/10/25/how-to-stream-freeview-hd-dvb-t2-over-multicast-using-dvblast-you-idiots/">post</a>:</p>
<pre><code class="language-shell" lang="shell"> 	sudo apt-get install git
 	git clone git://git.videolan.org/bitstream
 	cd bitstream
 	sudo make install
 	git clone git://git.videolan.org/dvblast
 	cd dvblast
 	sudo make install
</code></pre>
<p>DVBlast is now installed so we can now get on to the first step which is scanning your local terrestrial tower.</p>
<h2 id="mcetoc_1cvkb22gca">Configuration</h2>
<p>DVB-apps comes with some configs for different terrestrial towers, and you can see if your local one already exists by typing <code>ls /usr/share/dvb/dvb-t/</code></p>
<p>In my case, my local tower here in Christchurch New Zealand didn't exist, so I just entered "sudo gedit" into a terminal, which opens the gui text editor, and created and saved the following:</p>
<pre><code class="language-shell" lang="shell">  Sugarloaf, Christchurch NZ
 #
 # Channel allocation details for NZ can be found at
 # http://www.rsm.govt.nz/cms/policy-and-planning/current-projects/broadcasting/digital-television-2007-frequency-plan
 #
 # T freq bw fec_hi fec_lo mod transmission-mode guard-interval hierarchy

 # Multiplex DA
 T 562000000 8MHz 3/4 NONE QAM64 8k 1/16 NONE
 # Multiplex DB
 T 578000000 8MHz 3/4 NONE QAM64 8k 1/16 NONE
 # Multiplex DC 
 T 594000000 8MHz 3/4 NONE QAM64 8k 1/16 NONE
</code></pre>
<p>I had to find out the frequencies used, which wasn't too hard. Just do a google and find out what your local tower is and what frequencies are used.</p>
<p>Once you have your configuration file sorted, we use a program called <code>scan</code> which does just that. It will tell us the all important <strong>PIDs</strong> (the unique identifiers for each channel) and a lot of other helpful information.</p>
<p>Just run the following command, which will output what it finds into a file called <code>channels.txt</code></p>
<pre><code> scan /usr/share/dvb/dvb-t/nz-christchurch -u &gt; channels.txt
</code></pre>
<p>If you open <code>channels.txt</code>, you will find something similar to the following:</p>
<pre><code class="language-shell" lang="shell">TV ONE:682000000:INVERSION_AUTO:BANDWIDTH_8_MHZ:FEC_3_4:FEC_AUTO:QAM_64:TRANSMISSION_MODE_8K:GUARD_INTERVAL_1_16:HIERARCHY_NONE:280:330:1200
TV2:682000000:INVERSION_AUTO:BANDWIDTH_8_MHZ:FEC_3_4:FEC_AUTO:QAM_64:TRANSMISSION_MODE_8K:GUARD_INTERVAL_1_16:HIERARCHY_NONE:281:331:1201
U:682000000:INVERSION_AUTO:BANDWIDTH_8_MHZ:FEC_3_4:FEC_AUTO:QAM_64:TRANSMISSION_MODE_8K:GUARD_INTERVAL_1_16:HIERARCHY_NONE:282:332:1202
TVNZ 7:682000000:INVERSION_AUTO:BANDWIDTH_8_MHZ:FEC_3_4:FEC_AUTO:QAM_64:TRANSMISSION_MODE_8K:GUARD_INTERVAL_1_16:HIERARCHY_NONE:283:333:1203
TV3:698000000:INVERSION_AUTO:BANDWIDTH_8_MHZ:FEC_3_4:FEC_AUTO:QAM_64:TRANSMISSION_MODE_8K:GUARD_INTERVAL_1_16:HIERARCHY_NONE:450:400:1300
FOUR:698000000:INVERSION_AUTO:BANDWIDTH_8_MHZ:FEC_3_4:FEC_AUTO:QAM_64:TRANSMISSION_MODE_8K:GUARD_INTERVAL_1_16:HIERARCHY_NONE:451:401:1301
TV3 PLUS1:698000000:INVERSION_AUTO:BANDWIDTH_8_MHZ:FEC_3_4:FEC_AUTO:QAM_64:TRANSMISSION_MODE_8K:GUARD_INTERVAL_1_16:HIERARCHY_NONE:452:402:1302
C4:698000000:INVERSION_AUTO:BANDWIDTH_8_MHZ:FEC_3_4:FEC_AUTO:QAM_64:TRANSMISSION_MODE_8K:GUARD_INTERVAL_1_
</code></pre>
<p>The only thing we're really interested in is the <strong>Channel</strong>, the <strong>frequency</strong>, and the <strong>PID</strong>. These are the first and last values, so as an example with the first one, the channel is <strong>TV ONE</strong>, the frequency is <strong>682MHZ</strong>, and the PID is <strong>1200</strong>.</p>
<p>What you now need to do, is make a config file for each frequency which will then be used for each tuner. So if your local tower has 3 frequencies, you will need 3 config files, and 3 tuners.</p>
<p>I'd suggest making a folder in your home directory called dvb, which you store each config file in.</p>
<p><strong>Below are my 3 config files.</strong></p>
<pre><code>/home/localadmin/M1.cfg

;TV1
239.255.1.1:5004    1   1200
[ff08::1]:5004@[2001:17:17::1]	    1   1200
;TV2
239.255.1.2:5004    1   1201
[ff08::2]:5004@[2001:17:17::1]      1	1201
;TVNZU
239.255.1.6:5004    1   1202
[ff08::6]:5004@[2001:17:17::1]      1   1202
;TVONE+1
239.255.1.7:5004    1   1205
[ff08::7]:5004@[2001:17:17::1]	    1	1205
</code></pre>
<publii-non-amp> <details><summary><strong>To view the other two, click to expand</strong></summary>
<pre><code>/home/localadmin/M2.cfg

;TV3
239.255.1.3:5004    1   1300
[ff08::3]:5004@[2001:17:17::1]      1   1300
239.255.1.33:5004/mtu=2000 1 1300
;FOUR
239.255.1.4:5004    1   1301
[ff08::4]:5004@[2001:17:17::1]      1   1301
;TV3PLUS1
239.255.1.5:5004    1   1302
[ff08::5]:5004@[2001:17:17::1]      1   1302
;C4
239.255.1.8:5004    1   1303
[ff08::8]:5004@[2001:17:17::1]      1   1303
/home/localadmin/M3.cfg

;PRIME
239.255.1.9:5004     1    1404
[ff08::9]:5004@[2001:17:17::1]       1    1404
;Maori TV
239.255.1.10:5004    1    1400
[ff08::10]:5004@[2001:17:17::1]      1    1400
;Parliament TV
239.255.1.11:5004    1    1401
[ff08::11]:5004@[2001:17:17::1]      1    1401
;Trackside
239.255.1.12:5004    1    1402
[ff08::12]:5004@[2001:17:17::1]      1    1402
;ChineseTV
239.255.1.13:5004    1    1403
[ff08::13]:5004@[2001:17:17::1]      1    1403
;TV9
239.255.1.14:5004    1    1413
[ff08::14]:5004@[2001:17:17::1]      1    1413
;TV33
239.255.1.15:5004    1    1405
[ff08::15]:5004@[2001:17:17::1]      1    1405
;ChoiceTV
239.255.1.16:5004    1    1407
[ff08::16]:5004@[2001:17:17::1]      1    1407
;BaseFM
239.255.1.20:5004    1    2002
[ff08::20]:5004@[2001:17:17::1]      1    2002
;RadioNZ National
239.255.1.21:5004    1    2000
[ff08::21]:5004@[2001:17:17::1]      1    2000
;RadioNZ Concert
239.255.1.22:5004    1    2001
[ff08::22]:5004@[2001:17:17::1]      1    2001
</code></pre>
</details></publii-non-amp>
<p>What's this doing? the semicolon is just specifying a comment purely in this case just to help you identify the channel. Next line in the multicast address chosen:port chosen. 1 sets the stream to always be on, followed by the unique channel PID.</p>
<h4 id="mcetoc_1cvkb22gcb">IPv6</h4>
<p>If you looked closely you will notice I'm also doing IPv6. IPv6 addresses must be specified in brackets due to using semicolons (which would otherwise be followed by a port). As I mentioned earlier, this machine has several network cards in it. I then have the IPv6 address specified that I want the IPv6 multicast to send out of. Otherwise the stream will default to <code>eth0</code>. This is specific to where this box is used and your set up will probably be quite different.</p>
<p><strong>Note:</strong> A route in the Linux routing table could have also been used to specify the out going network interface. This is what I had set up before knowing that I could use DVBlast specifically.</p>
<p>Now that the config files are done, it's time to actually start the streams.</p>
<p>Continuing with my example, put the following 3 commands in separate terminal windows:</p>
<pre><code class="language-shell" lang="shell">For tuner 0 (TVNZ Frequency):
 $ dvblast -a 0 -c /home/localadmin/dvb/M1.cfg -f 578000000 -m qam_64 -b 8 -e
For tuner 1 PRIME/KORDIA Frequency): 
 $ dvblast -a 1 -c /home/localadmin/dvb/M3.cfg -f 594000000 -m qam_64 -b 8 -e
For tuner 2 (Mediaworks Frequency):
 $ dvblast -a 2 -c /home/localadmin/dvb/M2.cfg -f 562000000 -m qam_64 -b 8 -e
</code></pre>
<p>Here’s what each parameter does:</p>
<pre><code> -a n tells dvblast to use tuner number n for this multiplex. Obviously, you can’t use each tuner more than one at any one time. Numbering starts at 0, not 1.
 -c nameoffile.cfg tells dvblast to use the config file you just write. It doesn’t matter where you save it. 
 -f 000000000 is where you specify the frequency for this multiplex. 
 -m qam_x the  modulation type for this multiplex. And then… 
 -b n the bandwidth for this multiplex. 
 -e Finally, -e tells dvblast to also stream the EPG data.
</code></pre>
<p>If you wanted to do them all in 1 terminal, just put "&amp;" on the end of the command, enter, then the next dvblast instance.</p>
<p>Now you should be able to open VLC and type in each multicast address to view each stream (provided you have a route on your host [and the sever] to the multicast range. </p>
<h4 id="mcetoc_1cvkb22gcc">SAP configuration</h4>
<p>SAP allows you to simply pick the channels from a nice friendly list of channel names in vlc playlist. All you need to do is create a config file for it like below, and save it to <code>/home/localadmin/dvb/sap.cfg</code></p>
<p><strong>It looks like SAP announcements was implemented in one of the latest versions of DVBlast, so below is for historical reference</strong>.<br><br></p>
<publii-non-amp><details><summary><strong>EXPAND -</strong> click to expand config</summary>
<pre><code> # sap.cfg - Configuration file of the mini SAP server

 	# Global miniSAPserver options
 	[global]

 	# Number of seconds between announces. 5 is default. Internet announces better use 30.
 	sap_delay=5

 	# The network interface on which to stream.
 	#interface=eth2

 	[program]
 	type=rtp
 	name=TV1
 	user=localadmin
 	machine=tvserver
	site=mattie47.com
 	address=239.255.1.1
 	port=5004
	
	[program]
	type=rtp
	name=TV1v6
	user=localadmin
 	machine=tvserver
	site=mattie47.com
	address=ff08::1
	port=5004
</code></pre>
Then open a terminal and run: sapserver -c /etc/dvb/sap.cfg </details></publii-non-amp>
<h2 id="mcetoc_1cvkb22gcd">Conclusion</h2>
<p>So, I hope this was helpful in getting multicast IPTV streaming on your network.</p>
<p>Possibly a bit of work, but it's pretty cool to have setup. If you've gone through above, there's also another pretty good IPTV multicast program for Linux called MuMuDVB. I'd recommend also checking it out.</p>
            ]]>
        </content>
    </entry>
    <entry>
        <title>Howto: DNS host lookup without entering the full domain</title>
        <author>
            <name>Matt</name>
        </author>
        <link href="https://techlife.nz/blog/how-to-do-dns-host-lookup-without-entering-the-full-domain/"/>
        <id>https://techlife.nz/blog/how-to-do-dns-host-lookup-without-entering-the-full-domain/</id>
            <category term="Tips"/>

        <updated>2018-11-11T16:07:51+13:00</updated>
            <summary>
                <![CDATA[
                        <img src="https://techlife.nz/blog/media/posts/12/dns1.jpg" alt="" />
                    This post is for those running a Microsoft DNS Server This is a stupid thing that has been bugging me but I never really made the effort to look into it. I used to know how to do this since I actually did a Microsoft&hellip;
                ]]>
            </summary>
        <content type="html">
            <![CDATA[
                    <img src="https://techlife.nz/blog/media/posts/12/dns1.jpg" alt="" />
                <p>This post is for those running a Microsoft DNS Server</p>
<p>This is a stupid thing that has been bugging me but I never really made the effort to look into it. I used to know how to do this since I actually did a Microsoft course that covered DNS yet I just couldn't remember how to set this up properly.</p>
<p>So you're in your web browser or you want to ping a device on your network and you only want to put in the hostname, without the FQDN. Turns out it's very simple.</p>
<p>Open up DNS manager (Start &gt; Administrative Tools &gt; DNS)</p>
<p><a href="https://techlife.nz/blog/media/posts/12/dns1.jpg"><img class="aligncenter size-full wp-image-213" title="dns manager" src="https://techlife.nz/blog/media/posts/12/dns1.jpg" alt="" width="770" height="538"></a></p>
<p>What you want to do is right click Reverse Lookup Zones, and click New Zone.</p>
<p>Click Next.</p>
<p>Depending on how you have DNS set up (say you have more than one MS DNS server) you may need to configure this differently, but I imagine you'll probably be the same as me, which is selecting "Primary Zone", and "Store the Zone in Active Directory" ticked &gt; Next.</p>
<p>Again, choose the Zone Replication that suits your AD/DNS set up, Next.</p>
<p>Choose IPv4 or IPv6 reverse lookup. Hopefully a no brainer for you.</p>
<p>Now we're finally at the screen that matters. This is where you put the IP subnet where your Forward Lookup Zone resides in. As you can see above, my domain is mattie47.lan, which has devices just in the 192.168.0.0/24 subnet. I believe you will need to do a Reverse lookup zone for each subnet you want to resolve to that has devices in, so go through all these steps, finish, then start again for the next subnet (I could be wrong, but I'm pretty sure I'm right...).</p>
<p><a href="https://techlife.nz/blog/media/posts/12/dns2.jpg"><img class="aligncenter size-full wp-image-214" title="dns2" src="https://techlife.nz/blog/media/posts/12/dns2.jpg" alt="" width="505" height="388"></a></p>
<p>Click next once you've filled it in. The next screen again will be specific to your set up. Finally click finish.</p>
<p>For me, things just worked, but you may need to set up pointers (either double click each Host A record, and tick the box, or go under your new reverse lookup zone &gt; right click &gt; New Pointer.</p>
<p>Hope this helped someone!</p>
            ]]>
        </content>
    </entry>
    <entry>
        <title>FIX: Front audio jack not working on Gigabyte Motherboard</title>
        <author>
            <name>Matt</name>
        </author>
        <link href="https://techlife.nz/blog/fix-front-audio-jack-not-working-on-gigabyte-motherboard/"/>
        <id>https://techlife.nz/blog/fix-front-audio-jack-not-working-on-gigabyte-motherboard/</id>
            <category term="Tips"/>

        <updated>2018-11-11T16:13:12+13:00</updated>
            <summary>
                <![CDATA[
                        <img src="https://techlife.nz/blog/media/posts/13/motherboard.jpg" alt="motherboard" />
                    Back in May I built a new computer which included a Gigabyte GA-Z77X-D3H motherboard. All was well till I tried getting the audio drivers working correctly. At that point in time, I discovered if I wanted to use headphones say out my front audio jack,&hellip;
                ]]>
            </summary>
        <content type="html">
            <![CDATA[
                    <img src="https://techlife.nz/blog/media/posts/13/motherboard.jpg" alt="motherboard" />
                <p>Back in May I built a new computer which included a <strong>Gigabyte GA-Z77X-D3H</strong> motherboard. All was well till I tried getting the audio drivers working correctly. At that point in time, I discovered if I wanted to use headphones say out my front audio jack, I would be forced to turn my stereo off first, as sound would go out both audio jacks at the same time.</p>
<p>This was incredibly frustrating, since I was upgrading from a motherboard that I could choose between front and back audio, and I simply used an <a href="http://www.autohotkey.com/" target="_blank" rel="noopener noreferrer">AutoHotkey</a> script that would switch between the two using an assigned key on my keyboard.</p>
<p>At the time, I upgraded to the latest Via HD audio drivers, hoping that would have a fix for the situation. Unfortunately not.</p>
<p>Thankfully, I've just done a Google again on the situation and came across this <a href="http://www.sevenforums.com/sound-audio/244705-via-hd-audio-deck-front-panel-headphone-device-not-producing-sound-2.html#post2065868" target="_blank" rel="noopener noreferrer">thread</a>. Turns out the VIA drivers released some point in August fixed the issue. So If you're reading this post and you haven't updated your drivers, you can download the latest VIA version from Gigabyte <a href="http://download.gigabyte.asia/FileList/Driver/mb_driver_audio_via.exe" target="_blank" rel="noopener noreferrer">here</a>.</p>
<p>Speaking of AutoHotkey scripts, below is mine, which is basically a script to assign which audio device is the default. So to activate it, I would need to press Ctrl + Alt + A, which in itself isn't bad, but I've also got a logitech keyboard with some extra keys which I've assigned to one of them the above command sequence. Works well :)</p>
<blockquote>
<p>^!A::<br> Run, mmsys.cpl<br> WinWait,Sound<br> ControlSend,SysListView321,{Down 2}<br> ControlGet, isEnabled, Enabled,,&amp;Set Default<br> if(!isEnabled)<br> {<br> ControlSend,SysListView321,{Down 1}<br> }<br> ControlClick,&amp;Set Default<br> ControlClick,OK<br> WinWaitClose<br> SoundPlay, *-1<br> return</p>
</blockquote>
            ]]>
        </content>
    </entry>
    <entry>
        <title>Howto: Getting CUPs working on OpenWRT guide</title>
        <author>
            <name>Matt</name>
        </author>
        <link href="https://techlife.nz/blog/howto-getting-cups-working-on-openwrt-guide/"/>
        <id>https://techlife.nz/blog/howto-getting-cups-working-on-openwrt-guide/</id>
            <category term="Guides"/>

        <updated>2018-11-11T16:11:04+13:00</updated>
            <summary>
                <![CDATA[
                        <img src="https://techlife.nz/blog/media/posts/11/tplink_openwrt.jpg" alt="" />
                    IntroductionThis has been so painful. I've spent hours trying to get this working with little info on google searches for when things have gone wrong. Fortunately, I have got it working! Hopefully this guide will be of some help if you're trying to get CUPs&hellip;
                ]]>
            </summary>
        <content type="html">
            <![CDATA[
                    <img src="https://techlife.nz/blog/media/posts/11/tplink_openwrt.jpg" alt="" />
                <h2>Introduction</h2>
<p>This has been so painful.</p>
<p>I've spent hours trying to get this working with little info on google searches for when things have gone wrong.</p>
<p><strong>Fortunately, I have got it working!</strong> Hopefully this guide will be of some help if you're trying to get CUPs working on your wireless router.</p>
<p><strong>What is CUPs? printing....from your wireless router???</strong><br> <a href="http://en.wikipedia.org/wiki/CUPS" target="_blank" rel="noopener noreferrer">CUPs</a> is a linux print server. Using a wireless router, such as the TP-LINK WR1043ND, we're able to install a new open source firmware such as <a href="https://openwrt.org/" target="_blank" rel="noopener noreferrer">OpenWrt</a>. Furthermore we can install different packages, such as CUPs, allowing us to do a lot more than the manufacturer originally intended.</p>
<p><strong>Issues upon issues...</strong></p>
<p>My first attempt at this saw many different issues.  If you really want to see what I was struggling with, I have a forum post about them here: <a href="https://forum.openwrt.org/viewtopic.php?id=39990" target="_blank" rel="noopener noreferrer">https://forum.openwrt.org/viewtopic.php?id=39990</a></p>
<p><strong>A fresh start</strong></p>
<p>It was time I started again from scratch. I decided I would try out a bleeding edge build and I am now running OpenWrt Attitude Adjustment 12.09-beta, LuCI Trunk (trunk+svn9220). My reason for this is the off chance a package I had installed may have been having issues with "stable" which hasn't been updated in almost a year (<a href="http://downloads.openwrt.org/backfire/10.03.1/ar71xx/">http://downloads.openwrt.org/backfire/10.03.1/ar71xx/</a> shows Dec 2011).</p>
<h2>Equipment<br><br></h2>
<p><strong>- TP-Link WR1043ND Wireless router</strong><br> <strong>- 10 port powered USB hub</strong> (overkill but I got it cheap. The WR1043ND doesn't do a good job providing power to USB devices, so without a powered hub, you may see strange issues, especially with USB 3G modems.)<br> <strong>- 2GB USB stick</strong> (This will be used for spooling for CUPs)<br> <strong>- Brother HL5240 Laser Printer</strong><br> <strong>- Canon MX310 Multifunction Printer</strong></p>
<h2>Installation</h2>
<h3>1. Install OpenWRT on your wireless router.</h3>
<p>There are enough guides online on this, and I won't cover it here. All I'm going to say is if you're currently running OpenWRT and you want to try another version of it, login to your router via the web, then System &gt; Backup / Flash Firmware &gt; Flash new firmware image.</p>
<p>Normally you would download a sysupgrade .bin but I used a factory.bin. This is because I was going between different versions of OpenWRT and I'm not sure if a sysupgrade version may have caused issues. I also unticked "keep settings" since I wanted it back to default config.</p>
<p>Flash the firmware then re-setup any of your basic config (passwords, ip address, wireless SSID etc).</p>
<h3>2. Prepare your router for CUPs</h3>
<p>At this point, you've probably already seen the <a href="http://wiki.openwrt.org/doc/howto/cups.server">CUPs guide</a> on the OpenWRT site and are probably stuck on it. Hopefully the below steps will be of some help.</p>
<p>For me running ATTITUDE ADJUSTMENT (12.09-beta, r33312), all the required usb packages were already installed. You can check what packages are installed by entering opkg list-installed, or via web by going System &gt; Software.</p>
<p><strong>Basically before you install CUPs you need:</strong><br> kmod-usb-core<br> kmod-usb-ohci<br> libusb</p>
<p>I think you may also need kmod-usb2, and hotplug2.  I have them installed anyway.</p>
<p><strong>CUPs also needs:</strong><br> zlib, libpthread,  libpng, libjpeg, libstdcpp, and if you're using a canon printer, you may need cups-bjnp. Note, for all of the above, except cups-bjnp, they may be dependencies for CUPs and I didn't have to manually install any of them. I have a feeling they all just installed when I installed CUPs.</p>
<p><strong>To install:</strong></p>
<pre><code>opkg update<br>opkg install kmod-usb-core kmod-usb-ohci libusb kmod-usb2 hotplug2</code></pre>
<p><strong>Make sure you don't have kmod-usb-printer installed or running.</strong><br> Why? because CUPs talks directly to the printers and kmod-use-printer is another layer which is used by other apps such as p910nd to communicate with the printer. This is also the reason why you won't see lp0 under /dev.</p>
<p>Right! Prerequisites are out of the way, lets actually install CUPs!</p>
<h3>3. Installing CUPs</h3>
<p>From the command line: <code>opkg install cups</code></p>
<p>That was probably the easiest step of the lot.</p>
<p>Now that CUPs is installed, there's a bit of config you need to do before it will probably work. As detailed on a <a href="https://newren.com.au/ibbs/forum.php?mod=viewthread&amp;amp;tid=392" target="_blank" rel="noopener noreferrer">forum post</a> on <a href="http://www.newren.com.au">www.newren.com.au</a>, you need to do the following:</p>
<p>Use a text editor (e.g. vi) to open  /etc/cups/cupsd.conf, so:</p>
<p><code>root@OpenWrt:/# vi /etc/cups/cupsd.conf</code></p>
<p>change<br> <code>User Nobody</code><br><code> Group Nobody</code></p>
<p>to:<br> <code>User root</code><br><code> Group root</code></p>
<p>And change <code>AuthClass</code> to <code>AuthClass Anonymous.</code></p>
<p>Remember to change allowed network to your network,  otherwise you won’t be able to find the printer. E.G: </p>
<pre> Order Deny,Allow<br> Allow From 127.0.0.1<br> Allow From 192.168.0.0/24</pre>
<p>Change "<code>Allow From 192.168.0.0/24</code>" to the IP subnet you're using.</p>
<p>Use ":wq" to save the file and quit. Personally I prefer using the text editor nano, so I did <code>opkg install nano</code>, and then <code>nano /etc/cups/cupsd.conf</code>, edited the file, then ctrl + x, Y, enter.</p>
<p>Then, you need to change the permissions on <code>/usr/lib/cups/backend/usb</code> to 700.</p>
<p>To do this, enter: <code>chmod 700 /usr/lib/cups/backend/usb</code></p>
<p>This changes the behavior of cups, which normally tries to execute the backend through a user account other than root. This forces the backend to run as root from cups.</p>
<p>Okay! Got this far? Try entering the following command:</p>
<p><code>root@OpenWrt:/# /usr/lib/cups/backend/usb</code></p>
<p>You should hopefully see something like:</p>
<pre>DEBUG: list_devices<br> DEBUG: usb_find_busses=1<br> DEBUG: usb_find_devices=7<br> direct usb://Canon/MX310%20series?serial=406F4E&amp;interface=1 "Canon MX310 series" "Canon MX310 series" "MFG:Canon;CMD:BJL,BJRaster3,BSCCe,PLI;SOJ:TXT01;MDL:MX310series;CLS:PRINTER;DES:Canon MX310 series;VER:1.030;STA:10;HRI:EU;MSI:E3;" ""</pre>
<p>Yus! This is a good sign! This means that CUPs is talking correctly with your printers. Get an error? I originally had:</p>
<pre>root@OpenWrt:/usr/lib/cups/backend# /usr/lib/cups/backend/usb
/usr/lib/cups/backend/usb: can't load library 'libusb-0.1.so.4'</pre>
<p><strong>Fix:</strong></p>
<pre><code>root@OpenWrt:/usr/lib# opkg update</code><br><code> Downloading http://downloads.openwrt.org/backfire/10.03.1/ar71xx/packages/Packages.gz.</code><br><code>root@OpenWrt:/usr/lib# opkg install libusb</code></pre>
<h3>4. Accessing CUPs</h3>
<p>To access cups, enter <code>http://ip-address-of-your-router:631/admin</code>, so for me it's <a href="http://192.168.0.1:631/admin">http://192.168.0.1:631/admin</a></p>
<p>You may be requested to login, just use your root account, unless you've created another account.</p>
<p>Next go <code>Admin &gt; Add Printer</code>, and you should be presented with the following screen:</p>
<p><a href="https://techlife.nz/blog/media/posts/11/add-printer.jpg"><img class="aligncenter  wp-image-255" title="CUPs add printer" src="https://techlife.nz/blog/media/posts/11/add-printer.jpg" alt="CUPs add printer" width="569" height="343"></a></p>
<p>As you can see, CUPs HAS picked up both my printers correctly, and I'm able to go through each following step in setting them up. What if CUPs doesn't show anything there for you?</p>
<p>Try the following, which was posted on <a title="http://9m2tpt.blogspot.co.nz/2012/01/cups-hl-2140-usb-printer-wzr-hp-g300nh.html" href="http://9m2tpt.blogspot.co.nz/2012/01/cups-hl-2140-usb-printer-wzr-hp-g300nh.html">http://9m2tpt.blogspot.co.nz/2012/01/cups-hl-2140-usb-printer-wzr-hp-g300nh.html</a>:</p>
<p>To add the printer, just go to <a href="http://your-router-ip-address:631" target="_blank" rel="noopener noreferrer">http://your-router-ip-address:631</a>. Go to administration, add printer, select the AppSocket/HP JetDirect option. Remember the output from <code>/usr/lib/cups/backend/usb</code>? Use the URI there and paste it into the "Connection" field. Example, for my printer, the URI returned by the backend command is: <code>usb://Brother/HL-2140%20series?serial=F9J555425</code></p>
<p>Okay! So if your printers DID show up and you didn't have to do the paragraph above, select your printer and click next. There's two ways you can install your printer. You can either install it as RAW, or you can install a PPD file for your printer. Without going into detail, I believe you're better off installing using a ppd file. If my case with the Brother HL5240, I was able to get the ppd file from: <a href="http://www.openprinting.org/printer/Brother/Brother-HL-5240" target="_blank" rel="noopener noreferrer">http://www.openprinting.org/printer/Brother/Brother-HL-5240</a><a href="http://www.openprinting.org/printer/Brother/Brother-HL-5240" target="_blank" rel="noopener noreferrer"></a></p>
<p>Go through all the steps and you should have your printer sitting as idle under printers. At this point, you should be able to add your printer on a client and try printing a test page.</p>
<p><strong>Note: Due to limited functionality of CUPs on the router, you can't print a test page from within CUPs on the device. </strong></p>
<h3>5. Configuring a Windows 7 Client for the CUPs Printer</h3>
<p>1. Click Start, and type add a printer.<br> 2. Click add a network, wireless, or Bluetooth printer.<br> 3. Click "The printer  that I want isn't listed."</p>
<p>4. Select the second option, and paste the full URL to the printer. In CUPs, select Printers &gt; followed by the printer itself. The url in your address bar is what you should paste below. <a href="https://techlife.nz/blog/media/posts/11/step4.jpg"><img class="aligncenter size-full wp-image-262" title="step4" src="https://techlife.nz/blog/media/posts/11/step4.jpg" alt="" width="624" height="457"></a>Then install the correct drivers for your device. On the last screen you could click "print a test page" followed by finish.</p>
<p>At this point, hopefully a test page has printed. <strong>Wohoo!!</strong></p>
<p>I spent hours getting to this point. And it's a fantastic feeling having your wireless router act as a print server. The thing to remember is, <strong>it's not over yet....</strong></p>
<h2><strong>Configure a USB drive for spooling storage</strong></h2>
<p>One issue that we face having a wireless router act as a print server, is that this wasn't its original function, and therefore there are certain constraints that we must get around. 1 is that the router has an extremely small and limited internal memory. With CUPs, when a user sends a job to the printer, the whole file gets transferred across, and needs to be stored, or cached somewhere while the printer gets ready to start printing. Therefore, we need to set up a usb drive for spooling. You may get away with not having to do this step, but you also may have print job issues down the track if you're printing a big file. Chances are you have a spare usb flash drive lying around not being used, so why not just do the extra step.</p>
<p>For this step, there are other guides online for configuring a flash drive for OpenWrt, not to mention the<a href="http://wiki.openwrt.org/doc/howto/usb.storage"> OpenWrt usb storage page</a>. There's quite a good guide on it <a href="http://asomewhatintegratedlife.blogspot.co.nz/2010/09/usb-flash-drive-on-openwrt-1003.html" target="_blank" rel="noopener noreferrer">here</a>. For me though, I have a linux Mint laptop, so I just plugged in my spare usb drive, apt-get installed gparted, and then configured 90% of the flash drive with ext4, and the last 10% as SWAP. I also changed the permissions on the flash drive and used permissions you probably shouldn't use by doing "sudo chmod 777 /mnt/flash drive" which basically gives all users read write and execute permissions. For me I don't think there will be any issues with this.</p>
<p>Following the guides above, I did:</p>
<pre><code>opkg update</code><br><code>opkg install kmod-usb-storage kmod-fs-ext4 block-mount</code></pre>
<p>At this point there is two ways you could mount your storage, either using the CLI/SSH or via the gui web page. Personally doing it with the web page, as I find it easier.</p>
<p>If you don't have the tab "Mount Points" it's probably because you don't have all the right packages installed. It didn't appear for me till I added "block-mount".</p>
<p><a href="https://techlife.nz/blog/media/posts/11/openwrt-add-usb1.jpg"><img class="aligncenter size-full wp-image-279" title="openwrt add usb" src="https://techlife.nz/blog/media/posts/11/openwrt-add-usb1.jpg" alt="openwrt add usb" width="807" height="717"></a>Next reboot your router and make sure the usb device comes up mounted correctly on the above page. At this point it may be a good idea just to do a blank page print to your printer to ensure everything is still working fine. Okay next step!</p>
<h3><strong>Configure CUPs to use your USB device for print jobs</strong></h3>
<p>Time to re-edit your CUPs config. Either use VI or your text editor of choice and edit your cupsd.conf file:</p>
<p>nano /etc/cups/cupsd.conf</p>
<p>Change:</p>
<pre>RequestRoot /var/cups<br> TempDir /var/cups</pre>
<p>I changed both to<code> /usb/cups/</code> since as you can see in the above screen cap I mounted my usb drive as /usb</p>
<p>You probably should restart CUPs now.Do this by:<br> <code>root@OpenWrt:~# /etc/init.d/cupsd restart</code></p>
<p><strong>Also if at some point you've restarted your device and CUPs hasn't started, do either of the following:</strong></p>
<p>enter <code>/etc/init.d/cupsd enable</code> or alternatively in the gui go to<code> System &gt; Started</code>, and make sure cupsd has enabled beside it.</p>
<p><strong>Speaking of cleaning up</strong><br> Could be a good point to get rid of those default printers you're not using.</p>
<p>Firstly stop the cups service: <code>/etc/init.d/cupsd stop</code></p>
<p>I just commented out the printers doing <code>nano /etc/cups/printers.conf</code> and putting a # beside them. Syslog will throw up a couple of errors on start up but that shouldn't matter. Alternatively just delete everything for the two defaults.<br> Then do:<br> <code>/etc/init.d/cupsd start</code></p>
<p><strong>Adding the printers on a Mac Client.<br> </strong>I had issues adding the printers through the default mac config, but then suddenly remembered that Macs actually run a local version of CUPs so I just added them by going into the web browser: <a href="http://127.0.0.1:631">http://127.0.0.1:631</a> and adding the printers in there! Works great!</p>
<h2>Conclusion</h2>
<p>Hopefully you made it this far, and have a working version of CUPs on your wireless router! Congrats!</p>
<p>Got an issue that you've been stuck in for hours?  Always try doing some debug, E.g. via the web interface, go <code>Status &gt; System Log</code>, or <code>Kernel Log</code>. Both of which can be pretty helpful.</p>
<p>As a last resort, if you've really stuffed things up, a fresh install might be the way to go. Fixed things for me!</p>
<p>Got any questions? feel free to write below.</p>
<hr>
<h2><strong>Other Resources</strong></h2>
<p>Quite a good guide if you're wanting to use p910nd as your print server:</p>
<ul>
<li><a title="http://chee-yang.blogspot.co.nz/2011/11/make-host-based-usb-printer-work-with.html" href="http://chee-yang.blogspot.co.nz/2011/11/make-host-based-usb-printer-work-with.html" target="_blank" rel="noopener noreferrer">http://chee-yang.blogspot.co.nz/2011/11/make-host-based-usb-printer-work-with.html</a></li>
</ul>
<p>USB flash drive on OpenWRT 10.03 Backfire HOWTO:<br><a href="http://asomewhatintegratedlife.blogspot.co.nz/2010/09/usb-flash-drive-on-openwrt-1003.html" title="http://asomewhatintegratedlife.blogspot.co.nz/2010/09/usb-flash-drive-on-openwrt-1003.html" target="_blank" rel="noopener noreferrer"></a></p>
<ul>
<li><a href="http://asomewhatintegratedlife.blogspot.co.nz/2010/09/usb-flash-drive-on-openwrt-1003.html" title="http://asomewhatintegratedlife.blogspot.co.nz/2010/09/usb-flash-drive-on-openwrt-1003.html" target="_blank" rel="noopener noreferrer">http://asomewhatintegratedlife.blogspot.co.nz/2010/09/usb-flash-drive-on-openwrt-1003.html</a></li>
</ul>
<p>Other CUPs on OpenWrt install guides around the web:</p>
<ul>
<li><a href="http://9m2tpt.blogspot.co.nz/2012/01/cups-hl-2140-usb-printer-wzr-hp-g300nh.htmlhttp://9m2tpt.blogspot.co.nz/2012/01/cups-hl-2140-usb-printer-wzr-hp-g300nh.html" title="http://9m2tpt.blogspot.co.nz/2012/01/cups-hl-2140-usb-printer-wzr-hp-g300nh.html" target="_blank" rel="noopener noreferrer">http://9m2tpt.blogspot.co.nz/2012/01/cups-hl-2140-usb-printer-wzr-hp-g300nh.html</a></li>
<li><a href="http://www.newren.com.au/ibbs/forum.php?mod=viewthread&amp;tid=392" title="www.newren.com.au/ibbs/forum.php?mod=viewthread&amp;tid=392" target="_blank" rel="noopener noreferrer">www.newren.com.au/ibbs/forum.php?mod=viewthread&amp;tid=392</a></li>
</ul>
<p>Another all in one guide which covers pretty much everything except a print server: <a title="http://knowhow.bart.prokop.name/install/openwrt/wr1043nd" href="http://knowhow.bart.prokop.name/install/openwrt/wr1043nd" target="_blank" rel="noopener noreferrer"><br></a></p>
<ul>
<li><a title="http://knowhow.bart.prokop.name/install/openwrt/wr1043nd" href="http://knowhow.bart.prokop.name/install/openwrt/wr1043nd" target="_blank" rel="noopener noreferrer">http://knowhow.bart.prokop.name/install/openwrt/wr1043nd</a></li>
</ul>
            ]]>
        </content>
    </entry>
    <entry>
        <title>Fix: Windows 7 Blue Screen caused by ntoskrnl.exe error 0x000000f4</title>
        <author>
            <name>Matt</name>
        </author>
        <link href="https://techlife.nz/blog/fix-windows-7-blue-screen-caused-by-ntoskrnlexe-error-0x000000f4/"/>
        <id>https://techlife.nz/blog/fix-windows-7-blue-screen-caused-by-ntoskrnlexe-error-0x000000f4/</id>
            <category term="Tips"/>

        <updated>2018-11-11T16:07:37+13:00</updated>
            <summary>
                <![CDATA[
                        <img src="https://techlife.nz/blog/media/posts/9/windows-8-blue-screen-header.png" alt="bsod" />
                    For several months now I've had this error, which causes my server to randomly blue screen and restart. I don't typically notice this though, as virtual machines running on top of the server are preset to auto boot once windows has restarted (thanks to VMWare&hellip;
                ]]>
            </summary>
        <content type="html">
            <![CDATA[
                    <img src="https://techlife.nz/blog/media/posts/9/windows-8-blue-screen-header.png" alt="bsod" />
                <p>For several months now I've had this error, which causes my server to randomly blue screen and restart. I don't typically notice this though, as virtual machines running on top of the server are preset to auto boot once windows has restarted (thanks to VMWare workstation 8 shared VM feature). I've looked at this issue in the passed and presumed it must either be hardware related or a bad install of Windows server 2008 R2 (This also applies to Win 7).</p>
<p>I think I may have just gotten to the cause issue of it. If you've come across this page and you use a DLNA program called Serviio, keep reading, otherwise your issue could be unrelated (although as described below, it was a combination of serviio, java and ffmpeg).</p>
<p>I'd previously looked at the blue screen minidumps using some analyzer which didn't seem to say more than the error was f4 caused by ntoskrnl.exe which didn't leave me with much to try and figure out what really was causing it. A quick google on it will show the number of people having frustrating unexplained issues with it.</p>
<p>Something I should have done ages ago was simply to open the windows Event Viewer. Looking at logs around the time of crashes showed something quite interesting and unexpected:</p>
<blockquote>
<p>Faulting application name: ffmpeg.exe, version: 0.0.0.0, time stamp: 0x4ee7d185<br> Faulting module name: ffmpeg.exe, version: 0.0.0.0, time stamp: 0x4ee7d185<br> Exception code: 0xc0000005<br> Fault offset: 0x0071e4e3<br> Faulting process id: 0x10f0<br> Faulting application start time: 0x01cd8d892d613b00<br> Faulting application path: C:\Program Files\Serviio\lib\ffmpeg.exe<br> Faulting module path: C:\Program Files\Serviio\lib\ffmpeg.exe<br> Report Id: 6c28bf8e-f97c-11e1-8d1f-940c6d82d8ea</p>
</blockquote>
<p>A bit more googling on this, and hopefully I have a fix for the crashing. Time will tell, as the blue screen restarts are quite random (might go a day without it, or a week) and often when the server is idle and not having any major resources accessed.</p>
<h3>Hopeful fix:</h3>
<p>Installed latest Serviio (1.01)</p>
<p>Downloaded and installed offline version of Java x64 (forum suggestion) - uninstall any previous versions of Java you have installed first.</p>
<p>Manually downloaded latest ffmpeg (<a title="http://ffmpeg.zeranoe.com/builds/" href="http://ffmpeg.zeranoe.com/builds/">http://ffmpeg.zeranoe.com/builds/</a>) and put in it C:\Program Files\Serviio\lib\</p>
<p><strong>Update:</strong></p>
<p>Well it's only been a day since I wrote this post, but a bit more research into this has shown that for me at least, it is somehow Serviio related. Thanks to a brilliant forum post I found while trying to find a better BSoD dump analyser, I discovered <a title="http://www.osronline.com/page.cfm?name=analyze" href="http://www.osronline.com/page.cfm?name=analyze" target="_blank" rel="noopener noreferrer">http://www.osronline.com/page.cfm?name=analyze</a>. This website allows you to upload your BSoD minidump and will analyze it for you! Brilliant!</p>
<p>Example of one of my Minidumps <a title="here" href="http://mattie47.com/Downloads/minidump.txt" target="_blank" rel="noopener noreferrer">here</a>.</p>
<p><strong>Update #2:</strong></p>
<p>A month 1/2 now and no bluescreens! <strong>Issue for me = closed!</strong></p>
            ]]>
        </content>
    </entry>
</feed>
