Merged inital_site into master

This commit is contained in:
Bastian de Byl
2018-01-11 05:58:06 +01:00
4 changed files with 124 additions and 29 deletions

2
.gitignore vendored
View File

@@ -2,3 +2,5 @@ themes/*
test.md
public/*
static/*
r53Batch.json
distroConfig.json

View File

@@ -1,8 +1,8 @@
# Tranquilpeak
baseURL = "http://bdebylnet-cdn.s3-website-us-east-1.amazonaws.com"
baseURL = "https://bdebyl.net/"
languageCode = "en-us"
defaultContentLanguage = "en-us"
title = "basdb"
title = "bdebyl"
theme = "hugo-tranquilpeak-theme"
# disqusShortname = "basdb-site"
# googleAnalytics = "UA-123-45"
@@ -99,7 +99,7 @@ canonifyurls = true
# If false it will flat categories.
hierarchicalCategories = true
description = "Hugo tranquilpeak theme demo"
description = "bdebyl.net"
# Customization
# Define the behavior of the sidebar
@@ -122,7 +122,7 @@ canonifyurls = true
# Current image is on AWS S3 and delivered by AWS CloudFront.
# Otherwise put your image in folder `static/_images/` (development) or in `source/assets/images/` if you can't or don't want to build the theme,
# and use relative url : `your-image.png`
coverImage = "https://s3.us-west-2.amazonaws.com/basdb-static-content/site-static/img/cover.png"
coverImage = "https://bdebyl.net/img/cover.png"
# Display an image gallery at the end of a post which have photos variables (false: disabled, true: enabled)
imageGallery = true
@@ -167,20 +167,20 @@ canonifyurls = true
# Comment and uncomment to enable or disable sharing options
# If you wanna add a sharing option, read user documentation :
# Tranquilpeak configuration > Theme configuration > sharing-options
# [[params.sharingOptions]]
# name = "Facebook"
# icon = "fa-facebook-official"
# url = "https://www.facebook.com/sharer/sharer.php?u=%s"
[[params.sharingOptions]]
name = "Facebook"
icon = "fa-facebook-official"
url = "https://www.facebook.com/sharer/sharer.php?u=%s"
# [[params.sharingOptions]]
# name = "Twitter"
# icon = "fa-twitter"
# url = "https://twitter.com/intent/tweet?text=%s"
[[params.sharingOptions]]
name = "Twitter"
icon = "fa-twitter"
url = "https://twitter.com/intent/tweet?text=%s"
# [[params.sharingOptions]]
# name = "Google+"
# icon = "fa-google-plus"
# url = "https://plus.google.com/share?url=%s"
[[params.sharingOptions]]
name = "Google+"
icon = "fa-google-plus"
url = "https://plus.google.com/share?url=%s"
# [params.header.rightLink]
# class = ""

View File

@@ -0,0 +1,73 @@
---
title: "Make Your Ears Bern"
date: 2018-01-11T04:26:57+01:00
categories: ["Blog"]
tags: ["electronics"]
thumbnailImagePosition: top
thumbnailImage: "/img/headphone-fix/thumbnail.jpg"
coverImage: "/img/headphone-fix/IMG_7518.jpg"
---
A colleague offered a pair of Bern Bluetooth drop-in headphones to me fore free, with the catch being: _I had to fix them_
<!--more-->
# Don't Turn It On, Take It Apart!
---
Past mistakes have taught me to be gentle and patient when it comes to taking things apart. This was no exception either. After looking over the unit on each side, I figured the only way *in* was lifting the mesh cover off. So I went at it, carefully, with a pair of tweezers. I worked my way around the edge and wedged the mesh upwards.
{{< image classes="fancybox clear center nocaption" src="/img/headphone-fix/IMG_7505.jpg" >}}
# Okay, Maybe Turn It On
---
Now that the problematic speaker side was successfully opened without any damage, it was time to investigate what was wrong.
I played a song via smartphone on the speakers. The result was as expected: _the right speaker put out no sound._ I checked the known-good left speaker using my **Rigol 1074Z** oscilloscope. This may not have been entirely necessary, but I wanted to find out what to expect when troubleshooting the right channel.
{{< image classes="fancybox fig-50" group="turniton" src="/img/headphone-fix/IMG_7506.jpg" title="Left Speaker" >}}
{{< image classes="fancybox clear fig-50 right" group="turniton" src="/img/headphone-fix/IMG_7511.jpg" title="Right Speaker">}}
Knowing what to expect on the oscilloscope, I hooked up the probe to the right, problematic, speaker. The result was much different, indicating either noise or an open circuit. It may be worth mentioning that the right speaker was disconnected at this point in time to ease the troubleshooting process.
# Where Did It All Go Wrong?
---
Lucky for me the PCB pads were labeled -- even better `SPKL+` (_left_) and `SPKR+` (_right_) were easy to find.
{{< image classes="fancybox clear center" src="/img/headphone-fix/IMG_7507.jpg" >}}
Outside of the bluetooth board hidden under the piece of tape, there's not a whole lot going on in the circuit. It was my guess that the visible surface mount QFN chip was most likely the op-amp used for the speakers. A quick Google search of `AIWI TI` (_as shown in the photograph_) resulted in [the following datasheet](http://www.ti.com/lit/ds/symlink/tpa6132a2.pdf) which verified that to be the case.
{{< image classes="clear center" src="/img/headphone-fix/TPA6132A2.png" title="TPA6132A2 QFN Pinout" >}}
**Bingo!** Now knowing the pinout, I could use my trusty multimeter (_a Fluke 115_) to test continuity of the circuit from the known-good and the now known-bad speaker traces back to the `OUTL` and `OUTR` outputs of the amplifier.
{{< image classes="fancybox clear center" src="/img/headphone-fix/IMG_7514.jpg" >}}
Removing the board from the housing required a bit of finesse. I didn't want to bother desoldering the left speaker connections to make removal easier. So, with a bit of gentle back and forth I was able to get it the PCB out and inspect traces on the bottom side.
# Something's Not Quite Right...
---
Continuity from `SPKL+` to the QFN pin was good, yet `SPKR+` to the op-amp showed open circuit. Visibly, everything on the PCB looked fine. There were no apparent signs of damaged or lifted traces, nor bad soldered wires or pins. Somehow the trace shortly after the chip was damaged in a way that resulted in an open circuit at the point of the right speaker's solder pad.
After a few minutes of scratching my head and repeatedly going over the datasheet to check for any misunderstandings on my part, I realized the cause of the issue didn't matter so much. The objective was to fix the unit. I simply needed to re-establish the connection for `SPKR+` to the chip.
Using the 3.5mm mini-jack's solder pads, I found continuity to be true from the chips left and right outputs to the conveniently accessible solder pads. _A bodge wire was in order_..
{{< image classes="fancybox clear center" src="/img/headphone-fix/IMG_7515.jpg" >}}
# All's Well That Ends Well
---
Again, using my trusty Fluke 115, I verified continuity from the chip's `OUTR` pin to `SPKR+`. Lo and behold it was now closed-circuit! I was very happy to see the expected waveform from the known-good left channel now also appearing on the right channel.
{{< image classes="fancybox clear center" src="/img/headphone-fix/IMG_7516.jpg" >}}
At this point I quickly re-soldered the wires to the speaker and enjoyed music now coming into both ears!

View File

@@ -6,25 +6,41 @@ tags: ["code"]
thumbnailImagePosition: top
thumbnailImage: "/img/humble-beginnings/main.png"
---
After much deliberation I've finally decided to go with the [**Tranquilpeak**](https://github.com/kakawait/hugo-tranquilpeak-theme) theme. However, before this I ran into a slew of issues with the badly ported [**Tracks**](https://github.com/ageekymonk/hugo-tracks-theme) theme from WordPress
After running into too many road blocks I've decided to go with the [**Tranquilpeak**](https://github.com/kakawait/hugo-tranquilpeak-theme) theme for this site. Before this, I was really looking forward to using the [**Tracks**](https://github.com/ageekymonk/hugo-tracks-theme) theme (ported from WordPress)
<!--more-->
If you want a general overview, feel free to check out the relevant [commit](https://github.com/bdebyl/hugo-tracks-theme/commit/86ca4963c4d0a67ddb1560197c91617e7d3e3754) on my GitHub fork.
<!-- toc -->
If you want a general overview, feel free to check out the relevant [commit](https://github.com/bdebyl/hugo-tracks-theme/commit/86ca4963c4d0a67ddb1560197c91617e7d3e3754) on my GitHub fork of the **Tracks** theme.
# Rough Start
The first thing I noticed was that the navigation bar seemed a bit off.
----
Right off the bat I noticed the navigation bar seemed a bit off, to say the least:
{{< image classes="center" src="/img/humble-beginnings/header-problem.png" title="Navbar Issue" >}}
The links show as numbers and attempt to link to `/0`, `/1`, and `/2` which lead to 404s. This didn't seem like the intended functionality. It turned out to be a problem with the usage of the following variable: `.Site.Sections`
The links showed as numbers and pointed to `/0`, `/1`, and `/2` respectively. These, of course, lead to 404s.
As I'm still learning the ins and outs of Hugo, I'm not familiar with what a section *should* be, but I did know the `sidebar.html` layout file didn't seem to do anything nor exist anywhere on the site (even on mobile screen sizes). I did attempt to find out how sections work by experiment with directories along with `index.md` / `_index.md` files within the `content/` folder. Though, I was unsuccessful in getting the structure I wanted to appear, appear, along with not really understanding why `0` and `0` pages even existed.
{{< image classes="center" src="/img/humble-beginnings/404.png" title="404 Page - Should probably make this look a bit better, eventually..">}}
This didn't seem like the intended behavior, so I kept digging. Eventually, I found out the problem lied in the usage of the `.Site.Sections` variable used in a loop to populare items in the page header.
> **.Site.Sections**
>
> top-level directories of the site.
\- [Source](https://gohugo.io/variables/site/#site-variables-list)
As I'm still learning the ins and outs of Hugo, I'm not familiar enough with what a section *should* be beyond what the documentation states. I did attempt to find out how sections work by experimenting with directories in `content/` and files such as `index.md` / `_index.md`. Regretfully, I was unsuccessful in figuring out the proper structure to utilize `.Site.Sections`. I still do not fully understanding where the `0` and `1` "sections" even originated from. In any case, I decided the only course of action was to use something other than sections for the behavior I wanted.
# The Fix
The issue lied in the following chunk of code for `layouts/partials/headers.html`:
----
Looking at other template files in the theme's layout, I stumbled on a chunk of code in `layouts/partials/headers.html` that defined the behavior of the aforementioned "navbar" problem:
```html
<div class="col-md-6">
<div class="menu">
@@ -37,10 +53,12 @@ The issue lied in the following chunk of code for `layouts/partials/headers.html
</div>
```
For some reason it seemed that `.Site.Sections` would populate as `0` and `1`. Now, this may be an error of my part from lack of understanding of how Hugo works, but I have yet to make sense of the documentation as far as sections go.
The original uses the `.Site.Sections` variable, which I replaced with `.Site.Params.navlinks`. **This** seemed like intended behavior as the user-defined `config.toml` nav links weren't ever utilized or populated anywhere on the site.
{{< image classes="center clear" src="/img/humble-beginnings/tracks-config.png" title="Nav Links from Tracks Theme config">}}
I borrowed the code found in `layouts/partials/sidebar.html` (*which also never appears to be used*) to include the nav links and get my desired behavior:
In any case, I borrowed the code found in `layouts/partials/sidebar.html` to include the nav links I desired:
```html
<div class="col-md-6">
<div class="menu">
@@ -51,14 +69,16 @@ In any case, I borrowed the code found in `layouts/partials/sidebar.html` to inc
</div>
```
# But Wait, There's More!
----
# But Wait, There's More!
After getting more comfortable with how themes are designed for Hugo, I found a slew of other problems with the ported **Tracks** theme:
After getting more comfortable with how themes are written for Hugo, I found a slew of other problems with the ported **Tracks** theme:
* Improper HTML for `/about/` and `/contact/` resulting in a sloppy looking, inconsistent site.
* Redundant `portfolio.html`: duplicated HTML code already used in `category.html`
* Completely unused:
* `layouts/partials/sidebar.html`
* `layouts/_default/taxonomy.html`
* `layouts/_default/list.html`
* `<div class="col-md-10 category-description">` in `layouts/partials/category.html`
@@ -66,4 +86,4 @@ After getting more comfortable with how themes are designed for Hugo, I found a
* Pagination
* Syntax Highlighting
At the this point in time I decided it was no longer worth my time in trying to re-work something I wasn't very familiar with, as my main objective was simply to get a portfolio website with blog functionality up and running.
At this point I decided it was no longer worth my time in trying to re-work something I wasn't very familiar with. My main objective was simply to get a portfolio website with blog functionality up and running, not to custom build or *re*-build a theme. **Tranquilpeak** offered exactly what I wanted, though not necessarily *how* I wanted them. You can't always get what you want :)