Dec 30, 2013

How I increased my free Dropbox space

Taking advantage of a variety of freebies offered by dropbox, I increased my space from the base 2GB to 5.8GB. I'm also working on a potential 1GB increase by two referrals. If they sign up, each party gets 500MB extra.

1) Uploaded photos via the Camera Upload feature in the IOS app: each 500mb photo upload scored 500MB increase. You must do this with an app in IOS or Android to get the space. You can't just copy photos over to your Camera Uploads folder on a computer. So, the process is slow. 

2GB increase to 4.5GB.


2) Completed 5 of the steps indicated in the "Getting Started" guide on the desktop dropbox web site. This gives you another 250 MB. This one was kind of a surprise. I had already done 5 steps by the time I looked into it, just had to hit the option.


3) Downloaded the Mailbox app for IOS (sorry, no Android app yet) and linked it to dropbox. Earned 1GB. After I earned the extra 1GB, I just deleted the app. Still have the space.

Total earned: 3.75GB.

The reason I got started on this was because I had been pretty bummed that Picasa was getting unusable and the upgrade path was google+.

So, I did some googling around about photo sharing apps. Surprise, several reviews and postings recommended dropbox as the easiest, cleanest way to share photos. I tried this out from the IOS 7 App. When I examined it, I liked what I saw. 

Dec 23, 2013

LeoStick Volume Control


I first became interested in building a micro-controller hardware volume control for computers through the tutorial from Adafruit on the Trinket Volume Knob. The Trinket is an interesting ATTINY85-based platform designed by Adafruit. It can, with a little set up effort, be used with the Arduino IDE. 

The basic idea of this kind of volume control is this: turn a rotary encoder, which acts like a volume knob on audio equipment, and the micro-controller sends a keyboard code to your computer, altering the volume level. To do this, the micro-controller has to appear as an HID USB device to the computer.

But, after much effort and for one reason or another, I couldn't get the Trinket Volume Knob to be recognized on Ubuntu 12.04, Mac OS/X 10.7.5 or a Windows 7 64 bit.

My next attempt was with the code offered by Bluebie  on the Digistump/digispark forum. The digispark is also an ATTINY85-powered dev platform, programmable through a special version of the Arduino IDE offered by Digistump. It differs from the Trinket in several ways, notably the choice of the micronucleus bootloader. I got a little farther with this design, I could get the volume mute function working in Mac 10.7.5, but no volume up/down. No functionality in Ubuntu 12.04 LTS. Bluebie said that the volume control worked for her on OS/X 10.9, which may have functional differences from my installed 10.7.5.

I did some googling on arduino volume controls and stumbled upon the work of Stefan Jones with the Arduino Leonardo. I didn't have an actual Arduino Leonardo, but I did have a Freetroncs LeoStick, which is a nice clone of the Leonardo with some added features, in a smaller form factor.

I installed the LeoStick with the instructions offered in the LeoStick Getting Started Guide  on my Ubuntu 12.04 LTS system, using Arduino 1.0.5 as the base. Once I was satisfied the LeoStick was working in this setup, I  made the changes to the USBAPI.h and HID.cpp as Stefan Jones indicates in his post. I tried the test sketch that alternately mutes/unmutes volume from Stefan's post and that worked fine.

Finally, I used Bluebie's digispark volume knob code as a base for a LeoStick version. The code changes were trivial: 
  • Remove any references to DigisparkKeyboard
  • Add statements for Remote.mute(); Remote.increase(); and Remote.decrease(); as appropriate
  • Add Remote.clear(); at end of main loop to keep from repeating latest function.
That's it!

See the code at GitHub.

This worked for mute/up/down on my Mac and Ubuntu systems. It worked for volume up/down on my Nexus 7 4.4.2 (KitKat) as well, using a USB OTG cable to connect the LeoStick. Unfortunately, I could not get any functionality on Windows 7 with this set up.

UPDATE: Tested to work in Windows XP and Windows 7 64bit Home Premium. I had to remove the LeoStick after installing LeoStick Windows Drivers, available from the Freetronics site. On re-insert to a USB port, the Volume Control had full functionality.


May 15, 2013

TechShop SF 5/11/2013 Acrylic Boombox Concepts

Two concepts for a boombox acrylic frame, powered by a raspberry Pi. These are VERY difficult to photograph because they are so reflective. 

The first one below uses surface etching to simulate an Old School boombox, but with actual cutouts for a VFD and speakers. Took 36 minutes on the Epilog 60W laser @ TechShop. The art is from an artist's exhibit on the web. I didn't import the image, I redrew it from scratch.

The second one has a heat-bent "U" shape and a cutout for a handle, the speakers and VFD.



Mar 20, 2013

XBee Time & Temperature Monitor

After a remodel, I wanted to add one of the T2 (time and temp) monitors I've designed to the kitchen that would fit in with the new decor. There's a lot of white and gray, so decided to go with a laser cut white acrylic face plate.

The T2 is powered by arduino as a base station, collecting information and transmitting it to the T2 via XBee radio. A 1Wire DS18S20 temp sensor on my deck is attached to the arduino by repurposed CAT-5 cable run under my crawlspace. The arduino also collects time info from an EM-406A SIRF III GPS unit. All XBee units, receivers or transmitter, are on the same PAN ID channel, so the same information shows up on all. The XBee outputs serial via its TX to a Sparkfun serial LED locally on each receiver, making it easy to create a new monitor station for another location in the house.

Mar 6, 2013

OpenWRT: Start a python script at boot time

The following script will start a python weather parsing script at boot time (that script not included here). Place the script in

/etc/init.d/weather

 

#!/bin/sh /etc/rc.common
# Copyright (C) 2008 OpenWrt.org

START=99
start() {
        sleep 5   # make sure boot process is done, no more console msgs
        echo "Weather VFD App Started"
        . /etc/profile
        echo $PATH
        python /opt/scripts/wunderground_parse.py &
}

START=99 will create an entry in rc.d named S99weather when the script is enabled.

chmod +x /etc/init.d/weather

/etc/init.d/weather enable  #places entry S99weather in /etc/rc.d/

 

The profile command is [dot] [SPACE]/etc/profile. This will invoke the environment variables which otherwise wouldn't be included at boot time. Those variables will include the

LD_LIBRARY_PATH

and other env variables.

This can also be started with /etc/init.d/weather start. You can stop the init script from starting up with 

/etc/init.d/weather disable

You could optionally add other commands to this startup script.

See the entry at the OpenWRT wiki.

 

 

 

Feb 24, 2013

Python: Call a function from outside a Class (in another Class)

Warning! I'm a noob to python and the following may not be the best way to solve the problem. It may even contain errors!

I wanted to create a python class that would contain most of the functions I needed to interface a Samsung VFD to a raspberry pi. The VFD connects to the pi using SPI. To make things a little cleaner, I wanted to initialize SPI from within my main class, called SPI_VFD in the code shown below. I also needed to call the functions spi.writebytes and spi.xfer2 (from the module spidev) from within my SPI_VFD class.

In initial testing, here's what worked for me:

import spidev

class thisspi:
    spi = spidev.SpiDev()

class SPI_VFD:
     def __init__(self, callspi):
         self.myspi = callspi
         self.setspi
     def setspi():
         self.myspi.spi.open(0,0)
         self.myspi.spi.mode=3

#instantiate spi connection
s = thisspi()

# initialize SPI_VFD class, passing the spi instance
vfd = SPI_VFD(s)

 

 

Feb 22, 2013

SPI for Samsung VFD on the raspberry Pi

TL:DR version - use spi.mode = 3
For an Internet radio project, I wanted to display "Now Playing" information on a beautiful Samsung VFD sourced from adafruit.com. Adafruit has provided a nice arduino library for this display which I used as a starter set to translate into/build a python SPI-VFD class for the raspberry Pi.

I'm a complete noob at python but I tackled the translation of C code to python without too much trouble. I got things going in fairly short order after some google searches, was able to print "Hello, World!" However, the VFD was behaving a bit oddly on a few commands, the cursor. Well, you have to have a cursor to get to the second line, right?


Initially, I found a very useful thread on the raspberry Pi forum from poster bgreat on setting up a Nokia LCD to work with the Pi. That didn't fit my use case because it used more connections for SPI than the Samsung's three wires. It did give me a model of how to code for SPI on the Pi in general, however. The posting thread is also good for getting background on how to install/activate hardware SPI on the Pi.

But I hit a wall for a couple of weeks on fixing the cursor. I did a lot of searches based on guesses as to what the problem was. TTL voltage? Tried a 74HCT244 TTL up converter, same cursor result.  Under-current flakiness? Used a 2A power supply and separate, powered hub. Same. Some kind of SPI under-run, tried sending extra dummy bytes, still flakey. Think, think, think!

In my googling, I tripped over a posting reference to 3-WIRE mode in SPI. Hmn... The Samsung VFD uses only three SPI connections. Look at the data sheet, there's just a quick, passing reference to "three wire serial interface" and nothing else said.  OK, let's experiment!

I saw a test program on mitchtech.net that included source code to set SPI mode with a variety of parameters. Those parameters triggered a memory of an answer on stackoverflow.com about some Py object bindings. OK. So first, not knowing what I'm doing, I stupidly try the command:
spi.mode = 1
thinkng the mode is either on/off. The python interpreter accepts that, but I still get the same flakey results. Go back and look at the SPI test program again. There's a case statement for mode  that clearly says "3  #3-wire mode". Doh! Missed that.

Try:
spi.mode = 3

Success!











Jan 9, 2013

Parrot DF3120 to Raspberry Pi via VNC



The Parrot DF3120 is a small, cheap digital picture frame that at one point could be had for around $25 USD. About the time Hack-A-Day featured it for it's ability to run a small Linux, I picked up a couple of them. Nowadays (January 2013), they're hard to get.
The two Parrot's lay in inventory, waiting for a project. Now, I'm exploring a use for them. They might have some uses with raspberry pi as an auxiliary display.
I mostly used Nathan Chantrell's instructions for setting up the DF3120 for Linux and getting started with VNC.However, I couldn't get the VNC server started on the raspberry pi with Nathan's command, kept getting an error message:
vncserver: geometry 320×240 is invalid
Over on the cjb.im blog, there was a slight addition to the command, which worked for me:
vncserver -geometry 320x240 -depth 8 :1
The picture above is the result of the first connect to VNC on the Parrot.
Unfortunately, I couldn't get htop to work as Nathan indicated, kept getting invalid display error for xterm.
Below is a picture of console access (Serial?) from one of the original sources of information for hacking this device: