Posted by & filed under Uncategorized.

This great article, entitled “The care and feeding of software engineers“, does a pretty good job talking about us software engineers and why we do the things we do.

The article quotes a tweet by Mark Berry, which does a good job of summing up burn-out:

I can’t state this enough: Programmers don’t burn out on hard work, they burn out on change-with-the-wind directives and not ‘shipping’. — @markab

It is a long read, but worth it if you interface with software engineers for your career (or even if you have one as a partner).

Posted by & filed under OS X.

Here’s a hard to find utility in OS X for working with wireless:

/System/Library/PrivateFrameworks/Apple80211.framework/Versions/Current/Resources/airport

The utility provides a lot of functionality normally provided by the wireless-tools packages on Linux, such as iwconfig, iwlist, etc. Here’s the –help listing of the utility:

$ airport --help
Supported arguments:
 -c[]      --channel=[]         Set arbitrary channel on the card
 -z        --disassociate       Disassociate from any network
 -I        --getinfo            Print current wireless status, e.g. signal info, BSSID, port type etc.
 -s[]      --scan=[]            Perform a wireless broadcast scan.
                                Will perform a directed scan if the optional  is provided
 -x        --xml                Print info as XML
 -P        --psk                Create PSK from specified pass phrase and SSID.
				The following additional arguments must be specified with this command:
                                --password=  Specify a WPA password
                                --ssid=      Specify SSID when creating a PSK
 -h        --help               Show this help

Unfortunately, the output of the commands are disimilar, so if you’re parsing the output of the command (like I am), you’ll need to rebuild your parser.

Also, there is an XML output option, but it uses the goofy Apple dictionary format where keys and values are siblings and maintain no sort of logical relationship. So, it may be easier to parse than the raw output, but you’ll probably have to do some gross hacking to get it to work. Does anyone know of a clean way to parse “plist” xml?

Posted by & filed under Linux.

With my Raspberry Pi project, it has been using DHCP to get an IP address, and my network keeps assigning a different value (I know there are solutions to this but I haven’t made use of them yet). So, I went ahead and installed nmap using the homebrew package manager for OS X:

$ brew install nmap

And now, I can scan the local network to see what devices are up:

$ sudo nmap -sP 192.168.1.1-254

Starting Nmap 6.00 ( http://nmap.org ) at 2012-06-10 10:12 EDT
Nmap scan report for 192.168.1.1
Host is up (0.0041s latency).
MAC Address: B8:8D:12:5A:00:00 (Apple)
Nmap scan report for 192.168.1.2
Host is up (0.0039s latency).
MAC Address: E8:E0:B7:17:00:00 (Toshiba)
Nmap scan report for 192.168.1.6
Host is up (0.32s latency).
MAC Address: B8:27:EB:4C:00:00 (Raspberry Pi Foundation)
Nmap done: 254 IP addresses (3 hosts up) scanned in 5.46 second

The better solution would be to have the device use a static IP address (or even cooler, add a tiny LCD screen to show the current IP address :D).

Posted by & filed under Reviews.

All of the links in this post goes to the relevant Amazon product, in case you want to purchase the same hardware.

Here’s some pictures of my Raspberry Pi enclosure. It is basically a hard drive enclosure which I drilled and filed down. You can get a similar enclosure from Amazon, however that version doesn’t have all of the holes like mine does (which might make it a little harder to drill out).

In the first picture, you can see where I added the WiFi antenna. Basically, I made sure the USB wireless card was flush against the bottom of the enclosure, figured out where the antenna aligned, and drilled it out with a bit slightly larger than the threading. It made for a pretty solid hold.

In the remaining pictures, you can see how I made room for the SHDC card, as well as the USB port for charging the device. Beneath the Raspberry Pi, there is a sheet of acrylic plastic I cutout so that the board wouldn’t short out with the aluminum enclosure. I kinda half assed it so far; it is simply held down with electrical tape. I also put another, smaller, piece of acrylic on the end farthest away form the SD card, so that the board would sit flat (that SD slot is about the same thickness as the acrylic).

Unfortunately, the Raspberry Pi doesn’t have any screw holes, so I can’t securely mount the board. For now it is floating around, and as soon as the USB cord is removed the device starts to bounce around the enclosure. I’m probably going to throw some double sided tape in there to hold it down.

I have two USB male/female cords, and an unpowered USB hub. I’m not sure which combo I’ll end up using quite yet. You can see a USB Bluetooth dongle in the pictures, but it needs to be on the outside of the case for it to function properly. This could be easily done by putting the female end of the cord flush against one of the enclosure holes and plugging it in from the outside. If I end up adding additional devices (like a USB GPS device) I’ll definitely need to use the hub.

Posted by & filed under Reviews.

This is a review of the FM Transmitter (CZH-05B) which I recently purchased from amazon. It had been on the site for about $100 for a while, but a few days ago it dropped to around $60 bucks, so I jumped on it. The device is capable of transmitting at either 0.1 Watts, or 0.5 Watts, where the latter apparently has a range of one mile (I haven’t tested this yet though).

The device itself is pretty fragile. If you plug in a mono-microphone into the mic jack, it will break your device. If you turn it on without an antenna, it will break your device. The antenna on the back does not stay upright, it will fall over on its own. The print on the device looks quite cheap; it’s easy to tell this came from some factory in china.

These setbacks aside, the device seems to run pretty good. The sound quality sounded quite nice.

There are two modes, which are toggled using the power button. The station select mode lets you set a station, and shows an icon of a speaker with a slash through it. During this time the transmitter is not transmitting. Once you set it to transmit mode, you can no longer select a station, but your audio is being transmitted. This is so that you aren’t scrolling through all the stations and destroying all of the signals.

This device lets you transmit on the non standard FM stations (e.g. stations ending in an even decimal number). Some modern radios allow you to pickup these semi-hidden stations. I believe the stations were done like this because signals would bleed out to the neighboring stations, e.g. 100.2 would pick up 100.1 and 100.3.

Warning: Make sure you check with local laws. Depending on how you use it, this thing could be illegal. Make sure you are not broadcasting over top of other stations. If anyone ever complains, stop using the device immediately. Basically; don’t be a dick.

Posted by & filed under Uncategorized.

The Raspberry Pi Arch Linux image runs sshd by default. Assuming you have it plugged into your network with the ethernet jack, you can SSH into it by running (on a remote machine):

$ ssh root@192.168.1.10
The authenticity of host '192.168.1.10 (192.168.1.10)' can't be established.
RSA key fingerprint is aa:bb:cc:2d:f3:d7:11:6b:fd:cc:22:72:b2:ac:ee:dd.
Are you sure you want to continue connecting (yes/no)? yes
Warning: Permanently added '192.168.1.10' (RSA) to the list of known hosts.
root@192.168.1.10's password: root

[root@alarmpi ~]# cat /proc/cpuinfo
Processor : ARMv6-compatible processor rev 7 (v6l)
BogoMIPS : 697.95
Features : swp half thumb fastmult vfp edsp java tls
CPU implementer : 0x41
CPU architecture: 7
CPU variant : 0x0
CPU part : 0xb76
CPU revision : 7

Hardware : BCM2708
Revision : 0002
Serial : 0000000000000001

That is, if you’re lucky enough that your router reports to you the IP address of the devices on your network. If you aren’t lucky (like me), you’ll need to attach a monitor to your pi, log in with the root:root credentials, and run ifconfig to figure out what the IP address is.

With my particular setup, the HDMI doesn’t seem to want to work properly, so I have to use the RCA jack for now. Luckily me I don’t plan on using a display with it so it’s not the end of the world.

Raspberry Pi Running (and hating my HDMI)

Posted by & filed under Linux.

So… You got Arch Linux installed on your Raspberry Pi. And, you want to update all of the packages so that you can start installing stuff. Well, not so fast. Arch Linux has this little “feature”, where you can’t really install packages without generating a key.

Generate Pacman Key

To generate a key, folks will tell you that it is as easy as running:

pacman-key --init

And those folks are total liars. When running that command, you will get the output, “Generating pacman keychain master key…”, and it will just sit there doing nothing. Forever. In actuality, you are supposed to open another virtual console (Alt + F3 or Alt + F4), and do a bunch of random shit that causes drive reads and writes.

Perhaps, to do those writes, you would run a command such as:

ls -R /

But, that isn’t nearly enough stuff on the tiny Raspberry Pi Arch image to generate enough IO. Still others will tell you to run:

updatedb

But, of course, that command does not exist on a newly installed system. To get that command available and then run it, you need to actually run:

pacman -S mlocate
updatedb

Once you’ve done that and made a lot of hard drive writes, you can switch back to the key init app by hitting Alt+F1. But, you’ll notice that it STILL isn’t done. At this point, get angry, go back to your terminals, and mash your keyboard with the recursive ls and the updatedb commands, and run the top command in another terminal. After several minutes of frustration and anger, your pacman-key –init command will finally be done.

Update Pacman

Now, you need to update the package manager itself. Run the command:

pacman -S pacman

And you should have the latest version.

Update ALL THE THINGS

Now, try running

pacman -Syyuf

Replace libusb with core/libusbx? Y
… procps? Y
… udev? Y
Proceed? Y

By the time it is done (about 15 minutes of installing), you’ll have all sorts of new packages on your system. Most importantly, you’ll have the latest firmware.

The udev, libusb, procps stuff is kinda goofy because Arch recently made a big change to their system, and since it’s a rolling release, those three packages seem to complain a little about being replaced.