Commit 5f9ba241 authored by Blaine Murphy's avatar Blaine Murphy

Added "scraps" collection and conversion scripts

parent 0440e11f
Pipeline #133852010 passed with stage
in 51 seconds
......@@ -16,6 +16,29 @@ $ jekyll serve
Open a web browser to `localhost:8000` to access the site.
## Scripts
Some shell scripts are included to ease graphics changes. These require a POSIX
compatible `sh` and graphics utilities.
### fixgif
The `fixgif` script is used to ensure a gif is optimized as well as looped
forever. Many older found gifs do not loop indefindefinitely and some have
a weird format that trips viewer implementations up. This utility requires
[Gifsicle](https://www.lcdf.org/gifsicle/) to be installed.
```shell
$ ./fixgif static/bullet.gif
```
### vid2gif
The `vid2gif` script is used to convert a video into an animated gif. This
utility requires [FFmpeg](https://ffmpeg.org/) to be installed.
```shell
$ ./vid2gif input.mp4 output.gif
```
## Licensing
Thematic markup, stylesheets, and scripts in this repository are licensed under
the 2-clause BSD license, see `LICENSE` for details. Page content is excluded
......
......@@ -5,6 +5,7 @@ exclude:
- README.md
- LICENSE
- project.geany
- fixgif
sass:
style: compressed
......@@ -18,3 +19,6 @@ collections:
projects:
output: true
permalink: /projects/:categories/:title:output_ext
scraps:
output: true
permalink: /scraps/:title:output_ext
......@@ -8,6 +8,9 @@ internal:
- title: Projects
icon: projects.gif
url: /projects/
- title: Scraps
icon: scraps.gif
url: /scraps/
external:
- title: GitLab
......
......@@ -6,6 +6,6 @@
{%- endcomment -%}
{% assign _format = "%B %-d, %Y at %l:%M %p" %}
{% assign _format = "%B %-d, %Y at %l:%M %p %Z" %}
<time datetime="{{ include.date | date_to_xmlschema }}">{{ include.date | date: _format }}</time>
......@@ -4,6 +4,8 @@
Parameters:
include.filename: filename of the image in the page's asset dir
include.alt: img alt attribute
include.pixelated: set to true to disable antialiasing
include.nolink: set to true to disable hyperlink
{%- endcomment -%}
......@@ -12,7 +14,12 @@
{%- endcapture -%}
<div class="image">
{%- unless include.nolink -%}
<a href="{{ _image_url }}">
<img class="image-image" src="{{ _image_url }}" alt="{{ include.alt | escape }}" />
{%- endunless -%}
<img class="image-image {% if include.pixelated %}image-image-pixelated{% endif %}"
src="{{ _image_url }}" alt="{{ include.alt | escape }}" />
{%- unless include.nolink -%}
</a>
{%- endunless -%}
</div>
......@@ -6,7 +6,7 @@ $text-color: #7cffff;
$link-color: #a466ff;
$code-color: #00ff7f;
$border-color: #9999ff;
$nav-colors: #e6ff3f, #ffa93f, #ff6161, #df3fff, #7478ff, #3fe6ff;
$nav-colors: #e6ff3f, #ffa93f, #ff6161, #df3fff, #7478ff, #3fe6ff, #3dff70;
// fonts
$heading-font-sizes: 2em, 1.5em, 1.17em, 1em, 0.83em, 0.75em;
......
......@@ -4,7 +4,9 @@
&-image {
max-width: 100%;
@include antialiased;
// include style modifiers
&-pixelated { @include pixelated; }
}
}
---
layout: document
title: Android Boot Animations from GIFs
date: 2020-04-07 23:27:00 +0000
---
A simple [shell script](https://gitlab.com/unixispower/gif2bootanim) that
converts GIF files into `bootanimation.zip` files that are compatible with
Android. I wrote this to convert GIFs from [GifCities](https://gifcities.org/)
into boot animations for my phone.
The script takes an animated gif like the following:
{% include image.html filename="input.gif"
alt="Animated GIF input image" pixelated=true %}
And converts it into a boot animation for an Android device:
{% include image.html filename="phone.gif"
alt="Phone showing the generated boot animation" %}
You can find the script and instructions on how to use it in its
[Git repo](https://gitlab.com/unixispower/gif2bootanim).
---
layout: document
title: WLN KD-C1 Teardown
date: 2018-01-11 02:44:00 +0000
---
I tried to find a teardown of the KD-C1 before I purchased it. I managed to
find a [Russian video](https://www.youtube.com/watch?v=zIZWfzFL2QY) of a
partial teardown, but this video stops short of removing the PCB from the
plastic case (for good reason as seen below). I decided to go deep and
completely disassemble the radio as far as I could.
{% include image.html filename="wln-kdc1.jpg" alt="WLN KD-C1 radio" %}
The belt clip and battery cover were easy to remove without tools. Below the
battery cover there were 6 Torx screws holding the plastic halves of the radio
together. One screw was hiding under the battery compartment label.
{% include image.html filename="clip-battery-removed.jpg"
alt="Radio with belt clip and battery removed" %}
Once the screws were removed the two plastic halves separated easily.
{% include image.html filename="back-removed.jpg"
alt="Radio with back half removed exposing PCB" %}
This is the point where the teardown I found stopped. The radio charges via
USB or in a charge cradle that connects to the PCB via metal contacts on the
bottom of the plastic case. These metal contacts are soldered directly onto
the PCB making removal from the case impossible without desoldering or cutting
them.
{% include image.html filename="contact-closeup.jpg"
alt="Battery charging contacts soldered to PCB" %}
I decided to take the risk of melting the case and used a ColdHeat portable
soldering iron and solder sucker to detach the tabs. After using the solder
sucker I was able to push the tabs through the holes they were installed in. I
melted the case just a bit, but it shouldn't be too obvious once the tabs are
replaced.
{% include image.html filename="contact-removed.jpg"
alt="Radio with battery contact removed" %}
The antenna and speaker wires were also soldered to the PCB and needed to be
desoldered before the board was removed. I wasn't able to completely remove
the antenna from the plastic case because it seems to be molded or glued into
the plastic. To work around this I tucked the antenna under the board once I
desoldered it.
{% include image.html filename="antenna-tucked.jpg"
alt="Antenna desoldered and tucked under PCB" %}
After the tabs, speaker, and antenna were disconnected the only remaining
restraint was a nut hidden below the volume/power knob. I removed the knob by
pulling it off the potentiometer. I was able to loosen the nut by wedging a
flat head screwdriver in one of the grooves and pushing to cause the nut to
spin counter-clockwise
{% include image.html filename="pot-nut.jpg"
alt="Nut attaching potentiometer to case" %}
Once all impeding connections were been broken I (finally) removed the PCB
from the case. I used a screwdriver to lift the right side of the board and
pulled it out by the lower right corner. This step was a little tricky and
took some patience.
{% include image.html filename="pcb-lifted.jpg"
alt="PCB pried away from casing using a screwdriver" %}
I took some photos of the board once I got it out. I tried to get clear shots
of all the ICs and traces in case someone finds them useful.
{% include image.html filename="pcb-back.jpg" alt="Back view of PCB" %}
Here is a shot of the side of "font" of the PCB that is hidden by the case.
{% include image.html filename="pcb-front.jpg" alt="Front view of PCB" %}
There are several 8-pin packages on the front of the board. One IC is labelled
with the model number of the radio "KD-C1", the other is labelled "HK24C08".
{% include image.html filename="pcb-front-bottom.jpg"
alt="Bottom of the front of the PCB" %}
This one is labelled "M4871".
{% include image.html filename="pcb-front-top.jpg"
alt="Top of the front of the PCB" %}
There is also what looks to be a custom microcontroller "TA3767P" and a radio
transceiver IC "AT1846S" on the back of the board. I had to remove a metal
shield to get access to the transceiver IC.
{% include image.html filename="pcb-back-bottom.jpg"
alt="Bottom of the back of the PCB" %}
I didn't come up with much searching for the AT1846S. I found a
[general description](https://img.ozdisan.com/ETicaret_Dosya/500549_6108302.pdf)
posted by a supplier, but I couldn't find a datasheet. The general description
states the IC is portable FM radio transceiver that works in the ranges
134MHz-174MHz, 200MHz-260MHz, and 400MHz-520MHz. At first glance this IC looks
similar to the
[RDA1846](https://github.com/phishman/RDA1846/tree/master/Datasheets) (aside
from the "S" suffix) that is in the Baofeng UV-3R radios. The layout of the
AT1846S on the PCB is similar to the pinout of the RDA1846 from its datasheet
meaning the two might be pin-compatible.
This has been a promising teardown. I am pleased to find out that the radio's
transceiver IC might officially support 1.25m frequencies. Now I just need
access to a spectrum analyzer and some radio testing equipment so I can get my
hand dirty with modifications.
#!/bin/sh
# Fix animated gifs designed for old browsers like Netscape
# Usage: fixgif file...
gifsicle --verbose --batch \
--no-comments --colors=256 --loopcount --optimize=3 \
"[email protected]"
......@@ -6,6 +6,5 @@ flair: in-progress
This site is always under construction, but I have yet to finish the homepage.
Check out the other content while I think of what to put here :)
<div style="text-align: center;">
<img style="max-width: 100%" src="{{ site.baseurl }}/static/construction.gif" alt="Under construction" />
</div>
{% include image.html filename="construction.gif"
alt="Under construction" nolink=true pixelated=true %}
......@@ -4,6 +4,6 @@ title: Personal Projects
item_collection: projects
item_template: icon_preview.html
---
I like to hack around on electronics and software to meet immediate "needs" as
I like to make electronics and write software to meet immediate "needs" as
well as to have some fun (okay, mostly for fun). Here are some of the projects
I have made:
---
layout: collection
title: Scraps
item_collection: scraps
item_template: icon_preview.html
---
Sometimes I like to take stuff apart to explore and maybe make some
modifications while I'm inside. Sometimes I need a quick, hacky script for an
experiment or other fun. This page collects the smaller endeavors that aren't
involved enough to be projects but are still worth posting:
static/bullet.gif

1.55 KB | W: | H:

static/bullet.gif

1.55 KB | W: | H:

static/bullet.gif
static/bullet.gif
static/bullet.gif
static/bullet.gif
  • 2-up
  • Swipe
  • Onion skin
static/complete.gif

3.42 KB | W: | H:

static/complete.gif

3.41 KB | W: | H:

static/complete.gif
static/complete.gif
static/complete.gif
static/complete.gif
  • 2-up
  • Swipe
  • Onion skin
static/dead.gif

9.26 KB | W: | H:

static/dead.gif

9.26 KB | W: | H:

static/dead.gif
static/dead.gif
static/dead.gif
static/dead.gif
  • 2-up
  • Swipe
  • Onion skin
static/divider-2.gif

1.43 KB | W: | H:

static/divider-2.gif

1.43 KB | W: | H:

static/divider-2.gif
static/divider-2.gif
static/divider-2.gif
static/divider-2.gif
  • 2-up
  • Swipe
  • Onion skin
static/email.gif

2.39 KB | W: | H:

static/email.gif

2.39 KB | W: | H:

static/email.gif
static/email.gif
static/email.gif
static/email.gif
  • 2-up
  • Swipe
  • Onion skin
static/gitlab.gif

6.66 KB | W: | H:

static/gitlab.gif

6.66 KB | W: | H:

static/gitlab.gif
static/gitlab.gif
static/gitlab.gif
static/gitlab.gif
  • 2-up
  • Swipe
  • Onion skin
static/home.gif

606 Bytes | W: | H:

static/home.gif

606 Bytes | W: | H:

static/home.gif
static/home.gif
static/home.gif
static/home.gif
  • 2-up
  • Swipe
  • Onion skin
static/next.gif

1.02 KB | W: | H:

static/next.gif

1.02 KB | W: | H:

static/next.gif
static/next.gif
static/next.gif
static/next.gif
  • 2-up
  • Swipe
  • Onion skin
static/posts.gif

2.06 KB | W: | H:

static/posts.gif

2.06 KB | W: | H:

static/posts.gif
static/posts.gif
static/posts.gif
static/posts.gif
  • 2-up
  • Swipe
  • Onion skin
static/prev.gif

1.02 KB | W: | H:

static/prev.gif

1.02 KB | W: | H:

static/prev.gif
static/prev.gif
static/prev.gif
static/prev.gif
  • 2-up
  • Swipe
  • Onion skin
static/projects.gif

1.82 KB | W: | H:

static/projects.gif

1.82 KB | W: | H:

static/projects.gif
static/projects.gif
static/projects.gif
static/projects.gif
  • 2-up
  • Swipe
  • Onion skin
static/twitter.gif

2.16 KB | W: | H:

static/twitter.gif

2.16 KB | W: | H:

static/twitter.gif
static/twitter.gif
static/twitter.gif
static/twitter.gif
  • 2-up
  • Swipe
  • Onion skin
#!/bin/sh
# Convert a video into an animated gif
# Usage: vid2gif video_file gif_file [fps] [scale]
video_file=$1
gif_file=$2
fps=${3:-5}
scale=${4:-480}
# from https://engineering.giphy.com/how-to-make-gifs-with-ffmpeg/
ffmpeg -i "$video_file" \
-filter_complex \
"[0:v] fps=$fps,scale=$scale:-1,split [a][b];[a] palettegen [p];[b][p] paletteuse" \
"$gif_file"
Markdown is supported
0% or
You are about to add 0 people to the discussion. Proceed with caution.
Finish editing this message first!
Please register or to comment