2019-04-12

Yup. retiring. New posts will be made at jezra.net

Comments
Name:
not required
Email:
not required (will not be displayed)
Website:
not required (will link your name to your site)
Comment:
required
Please do not post HTML code or bbcode unless you want it to show up as code in your post. (or if you are a blog spammer, in which case, you probably aren't reading this anyway).
Prove you are human by solving a math problem! I'm sorry, but due to an increase of blog spam, I've had to implement a CAPTCHA.
Problem:
6 plus 9
Answer:
required
  • Tags:
2016-09-30

After five years of decent service and running 24/7, Wind, my media playing machine started having hardware failure issues as well as lingering problems decoding large video files. For a few years now, I had been hoping to find a SBC that would be able to handle my video decoding needs, as well as be able to fit inside of a phone body.

Say "hello" to Redbar. Unfortunately, I still have issued with decoding video. Hopefully a switch from Debian to Arch will resolve some of my issues.

The Build

Redbar utilizes a MinnowBoard Turbot with a USB soundcard and a USB wireless network adapter. When the build took place, photos were taken with my mobile phone which I upgraded to cyanogenmod without backing up my pictures. [hella sad face]

Oh well, here are some pictures of the machine.

Redbar

This is actually the finished product. The phone is a Kellogg Redbar that I gutted.

Storage

Mounted in the body of the phone is a 2 TB SATA hard-drive. Power for the drive is pulled from the 5V pin on the SBC.

SBC

Mounted to the base of the phone is the Turbot. The OS (currently Debian Jessie) is running from the MicroSD card.

Power

A small button was attached to the bottom of the phone so that the device can be turned on and off.

Because the OS is running from a SD card, I should really find a way to run 'sync' before the 'shutdown' command powers off the SBC.

Final Location

Boring.... The phone, the TV, and there is a stereo amp in there as well.

Anywho, I'm not too happy with the way the device has been decoding TED Talk videos, and I'm experimenting with making a SD card image of Arch Linux so that I can take advantage of more recent software for my media player.

Also, I'm going to complain about the absurd difficulty that I am having with attempting to downmix all audio to 2 channel stereo. Sheesh, what a pain.

Now quit reading, and go replace a computer with a slightly less problematic computer.

Comments
Name:
not required
Email:
not required (will not be displayed)
Website:
not required (will link your name to your site)
Comment:
required
Please do not post HTML code or bbcode unless you want it to show up as code in your post. (or if you are a blog spammer, in which case, you probably aren't reading this anyway).
Prove you are human by solving a math problem! I'm sorry, but due to an increase of blog spam, I've had to implement a CAPTCHA.
Problem:
0 plus 4
Answer:
required
2016-09-03

A few days ago, the urge to create an internetted thingy was upon me. Recently, I had been reading documentation regarding machine to machine communication using MQTT as well as BLE, and then I took a quick look at my tinker pile. The amount of neat things that I purchased for use in a project was far too high.... and then it hit me: LESS HOARDING, MORE MAKING!

What I was craving to make, was a network accessible pixel LED, inside an orb light fixture, that could be controlled using MQTT.

For this build, I used:

  • an orb light fixture from the ReStore
  • an Unwired One single board computer running OpenWRT
  • a single ws2801 pixel LED that was left over from the Glimmer build.

The Build

The Fixture

The orb light fixture appears to be a run of the mill wall or ceiling CFL fixture. If I remember correctly, the orb cost around $5. The cost of computer cases these days is getting out of hand. :)

Take it Apart!

For some reason, the fixture manufacturer decided to put a bunch of unnecessary crap in my new computer case. Fortunately, it only took a few minutes to get the orb in a usable state.

Test the Circuit

ws2801 pixel LEDs are controlled using SPI. On the Unwired One device, there are no GPIO pins that are dedicated to SPI. Instead, the SPI bus is created by loading a kernel module with arguments to determine which GPIO pins will be used for SPI.

Solder Leads to the LED

Once the circuit was working, leads were soldered to the LED so that it could be connected directly to the GPIO headers.

After the soldering was complete, the leads were wrapped in electrical tape.

Make a Notch for the Power Cable

Since the orb is intended to rest on a table, it was necessary to make a notch in the base for the power cord to fit through. Thus ensuring that the orb will be flush on a flat surface. After a bunch of waffling around trying to find my files and metal snips, a grab and twist with some needle nosed pliers did the trick.

Put it Together

After more waffling while trying to determine the best way to make some fancy standoffs for the computer board, I opted to simply hot glue the board to a piece of cardboard, and then hot glue the cardboard to the underside of the orb base.

Fast
Simple
Effective
... and I'm lazy

The LED was also hot glued to the base, pointing upward into the glass orb. /

Now me has ORB!

Have Some Coffee

Technically, this picture is for the morning after the Orb Device had been created, but it does a damn fine job of showing what the orb thingy looks like.

The Code

Enable SPI

As previously stated, the SPI on the board needs to be configured by added a kernel module. In order for the kernel module to be loaded each time the device is restarted, the /etc/rc.local file was edited to launch the following script:

#!/bin/sh

#see http://www.unwireddevices.com/wiki/index.php/Working_with_SPI_(C/C%2B%2B)
#BUS : SPI bus number, can be bus0, bus1, bus2, bus3
#ID : SPI device ID (integer number)
#SCK, MOSI, MISO : GPIO numbers for the corresponding SPI signals
#MODE : SPI mode (0, 1, 2 or 3)
#FREQ : max SPI frequency (Hz)
#CS : GPIO number for the CS signal (optional)
# insmod spi-gpio-custom BUS=ID,SCK,MOSI,MISO,MODE,FREQ,CS

bus="bus1"
id=1
sck=20
mosi=23
miso=18
freq=25000000

cmd="insmod spi-gpio-custom $bus=$id,$sck,$mosi,$miso,0,$freq"
echo $cmd
`$cmd`

Honestly, the entire script can be replaced with one line of code: the final command. However, the script was written while reading the documentation of the process and if I ever need to edit the script, there are hella useful comments in there.

Control the Orb

The code for controlling the orb is written in Python and requires the Paho MQTT library.

code is available at https://gitlab.com/jezra/orb

oh... It would be really nice if I could copy the payload parsing documentation from the README.md in the code repository. Sadly, the lazy dev hasn't yet created that file. Well then, I know what I'm doing later!

Now quit reading, and go make an orb thingy.

Comments
Name:
not required
Email:
not required (will not be displayed)
Website:
not required (will link your name to your site)
Comment:
required
Please do not post HTML code or bbcode unless you want it to show up as code in your post. (or if you are a blog spammer, in which case, you probably aren't reading this anyway).
Prove you are human by solving a math problem! I'm sorry, but due to an increase of blog spam, I've had to implement a CAPTCHA.
Problem:
2 plus 5
Answer:
required
subscribe
 
2019
2016
2015
2014
2013
2012
2011
2010
December
November
October
September
August
July
June
May
April
March
February
January
2009
December
November
October
September
August
July
June
May
April
March
February
January
2008