The Hardware Build This post will cover the design and build of my hardware solution for the DIY Smart Garage Door Controller, from its humble beginnings on the breadboard (pictured below) to final prototype. The initial breadboard circuit was something I threw together to work on the software. It was based on a single momentary switch (button) simulating the door sensor, with an LED simulating the relay. Not a whole lot changed in the design, other than to add a second door sensor.
While looking for parts of my house that I want to bring into the Smart Home/IOT era, I started searching for DIY “smart” devices to get started on a low budget. One blog post titled $10 DIY Wifi Smart Button / Switch caught my attention with the ESP8266 Development Board - this is a very cheap and convenient board that can be powered via USB, flashed using Arduino IDE (along with several other methods) and has built-in WiFi.
Earlier this week, I thought I stumbled across a bug in the go standard library. Earlier this week, I was wrong. While browsing the net/http sources, I spotted what appears to be an index out of range in calls to http.Request.BasicAuth(). Decoding func parseBasicAuth(): If the value string has prefix “Basic “ base64 decode the remainder of the string find the index of the first colon (:) in the decoded result return username and password as the substrings before and after the colon, respectively But wait - what if there’s nothing after the colon?
Edit: Thanks to /u/epiris for pointing out that I actually posted a server-side code example, not client side. I think I got distracted while finishing off the post… completely missing the point! Whoops. Code sample is fixed now. At work this week, I was tasked with updating a couple of older internal go applications currently serving HTTP to serve HTTPS instead. Generally, go makes this a pretty simple task and there are plenty of existing guides on the web that cover the process, so I won’t bore you with it here.
Following on from my last post… The Hugo Quickstart Guide gives instructions on setting up version control and publishing a site on GitHub Pages - but using the method of pushing to a gh-pages branch. This is the typical path for a “project site”, but a user site (with no repository in the URL) will publish to Pages only from the master branch. So adding the hugo files to version control required me to either start another project - or just be sensible about it and use a non-master branch of the user project (which must be named <username>.
Every blog needs a first post, and what better subject to record than the birth of this blog. Last weekend, I was reading a particular reddit post and noticed the OPs username forfunc. I’ve also been watching (and loving!) @francesc’s JustForFunc channel. I like the wordplay and thought myself very clever indeed when I came up with “for func sake”… It just so happened that the username was available in the places I want to use it; and I’ve been less than thrilled with my previous username choice(s)… so I spent an hour or so creating new accounts across the web.