Nexus 7 Dashboard Install

Nexus 7 Dash Install

Nexus 7 Dash InstallShortly after the Nexus 7 was first released, I saw reports of people replacing the head unit in their car with the tablet. Apparently the Nexus 7 is almost exactly the correct size to fit in a double-din space. I’ve been thinking about doing something like that ever since and this past weekend, I finally did.

I specifically purchased a 2012 model Nexus 7 for two reasons:

  1. It is less expensive. I picked up a 32 GB refurbished model for $150. Since this is going to live in my car, I don’t need the fantastic display of the newer model and the extra space will be extremely useful for storing music and things.
  2. It works with USB Rom. This basically does all the hard work of making sure usb works correctly and sending the tablet into a deep sleep when the car is off. It isn’t being updated anymore, but is based on CyanogenMod 10.1. I haven’t found any missing features yet.

Gotchas

  • The Nexus 7 is almost exactly the correct size. My particular double din adapter thing had screw holes that would have been perfect if the device was about 5mm smaller. So it’s a jury rigged attachment using screws, plexiglass, coat hanger wire, and duct tape. Also a bit of Sugru and strong glue. It should hold pretty well, but we’ll find out.
  • The plug for a car antenna is very different from the one for the usb dongle. I ended up splicing the cables together. Someone might make an adapter, but I wasn’t patient enough to figure that out. Splicing antenna cable is a pain. It’s basically a coax cable but tiny.
  • The usb otg y cable I bought didn’t quite fit in the car. It has a straight micro usb connector. I had actually ordered another one with a right angle connector from ebay, but wanted one sooner that I could play with. That worked out well since the ebay one wasn’t quite what I needed (my fault, not theirs). I ended up cutting of the straight connector and using the right angle connector from the ebay adapter. Soldering usb cables is also a pain. Again due the general tinyness of the inner cables. On the plus side, I’m better at soldering now than I was three days ago.
  • The amp I bought was huge. Way bigger than I expected. Big enough that it doesn’t fit behind the dash. It lives in the glovebox now. Fortunately, I don’t really use the glovebox so that isn’t a problem.
  • When connecting wires, make sure things are off. I definitely blew a fuse (and then spent about an hour figuring out which one) because I left things on while wiring up the amp.
  • The radio doesn’t work as well as I would like. I’m not sure why. I’m going to experiment with a different app to see if that makes any difference. I also might not have done a good enough job splicing the antenna cable.

Apps

Useful Links

Posted in General

Node.js and systemd

With Arch Linux switching to using systemd I needed a systemd.service file for node.js and there didn’t seem to be one. Or at least I couldn’t find one. So I wrote one.

It requires forever to daemonize node.

Posted in General

Init Script for Calibre Server

I use the very excellent Calibre to make my ebooks accessible to all of my devices anywhere I am. It has a very useful server component that many ebook readers can use to download content. What I was missing was a way to automatically start/stop calibre-server. For that,I put together this rc script for Arch Linux.

#!/bin/bash

. /etc/rc.conf
. /etc/rc.d/functions

CONTENT=/mnt/miscellaneous/Books/Literary
PORT=8080

DAEMON=calibre-server
PIDFILE=/var/run/$DAEMON.pid
ARGS="--auto-reload --with-library=$CONTENT --pidfile=$PIDFILE --port=$PORT --daemonize"

case "$1" in
 start)
  stat_busy "Starting $DAEMON"
  [ -z "$PID" ] && $DAEMON $ARGS &>/dev/null
   if [ $? = 0 ]; then
     add_daemon $DAEMON
     stat_done
   else
     stat_fail
     exit 1
   fi
   ;;
 stop)
   stat_busy "Stopping $DAEMON"
   PID=`cat $PIDFILE`
   [ -n "$PID" ] && kill $PID &>/dev/null
   if [ $? = 0 ]; then
     rm_daemon $DAEMON
     stat_done
   else
     stat_fail
     exit 1
   fi
   ;;
 restart)
   $0 stop
   sleep 1
   $0 start
   ;;
 *)
   echo "usage: $0 {start|stop|restart}"
esac
Tagged with: , , ,
Posted in Arch Linux, Scripting

SmugMug Upload

A while back I created a set of scripts to upload files to SmugMug using php. I have recently rewritten that uploader and made it available on BitBucket. It should work almost exactly the same but it is generally better organized.

Tagged with: , ,
Posted in Scripting

Pull info from Pithos for Conky

I switched from pianobar to Pithos as pianobar didn’t work as well with conky as I would have liked. The script below lets me get information from Pithos that I can use in pianobar.

#!/usr/bin/php
< ?php

$song=`dbus-send --print-reply --dest=net.kevinmehall.Pithos /net/kevinmehall/Pithos net.kevinmehall.Pithos.GetCurrentSong`;

$matches = array();

switch($argv[1]) {
	case 'album':
		$pattern = '~"album".*?"(.*?)".*~s';
		break;
	case 'title':
		$pattern = '~"title".*?"(.*?)".*~s';
		break;
	case 'artist':
		$pattern = '~"artist".*?"(.*?)".*~s';
		break;
	default:
		exit;
}

preg_match($pattern, $song, $matches);

if($matches) {
	echo $matches[1];
}
Tagged with: , , ,
Posted in Scripting