Category Archives: Technology

Enable Wifi on Wandboard Quad Ubuntu 14.04

There are no clear instructions for enabling the Broadcom wifi chip in the Wandboard Quad. What follows is an aggregation of information stemming from the research I did to get the chip working on my board.

What I’ve learned

The Wandboard Quad uses the 4330 chip, unlike the other Wandboards that use the 4329 chip. I found some instructions for Debian and Ubuntu on the Wandboard, but between the different chips and firmware, it was difficult to piece together.

You have to download the nvram.txt file for the Broadcom chip separately. Why it is not included in the images, I don’t know.

Ubuntu 14.04 disk image

I have a Wandboard Quad purchased in Oct 2014. I am running this image:
http://s3.armhf.com/dist/wand/ubuntu-trusty-14.04-rootfs-3.10.17.1-wand-armhf.com.tar.xz
from this Web site:
http://www.armhf.com/boards/wandboard/#trusty
The bottom line is that it was far more stable than the image on the official Wandboard site.

Enabling the Broadcom Wifi chip

Once I cobbled together the info, it was actually a piece of cake. You have to download the nvram.txt for the 4330, and then make symbolic links to the proper files so they are found on boo. You also have to create a config file (wpa_supplicant.conf) with your ssid and password:

sudo wpa_passphrase myssid mypassprase > /etc/wpa_supplicant.conf
cd /lib/firmware/brcm
sudo wget https://github.com/Freescale/meta-fsl-arm-extra/blob/master/recipes-bsp/broadcom-nvram-config/files/wandboard/brcmfmac4330-sdio.txt
sudo ln -s bcm4330_nvram.txt brcmfmac-sdio.txt
sudo ln -s brcmfmac4330-sdio.bin brcmfmac-sdio.bin
sudo reboot

Configure your Wifi interface
Now just go to /etc/network, open your favorite editor, and edit the “interfaces” file:

sudo nano /etc/network/interfaces

Then configure the wlan0 interface like normal:

# wireless network interface
auto wlan0
iface wlan0 inet dhcp
wpa-conf /etc/wpa_supplicant.conf

You can test by entering:

sudo ifup wlan0

Move your Linux installation to a new Solid State Drive – even a smaller one

Overview
Solid State Drives (SSD) are all the rage these days – and for good reason. They’re fast, silent, and have no mechanical parts to go wrong (although firmware bugs can and do bite people).
They’re also horribly expensive. For this reason many people who take the plunge buy drives that are smaller than the mechanical drives that are being replaced. This can be a problem. ┬áIf you’re moving to a larger drive, Clonezilla or other imaging programs do a fine job, but moving to a smaller drive can be daunting. If you do a Google search there are articles all over the Web that will give you bits and pieces of advice. The following is a procedure that I know will work, because I just moved my installation from a 300GB hard drive to a 240GB Intel 520 SSD.

First things first – preparation
First of all, make sure that all of your data will fit on your new drive. No article in existence can explain how to fit 400GB of data onto a 200GB drive. So check out how much space you are using and start housecleaning. Remember that you want to have some free working space as well.

Second, back up your drive. I said BACK UP YOUR DRIVE! Better yet, download a copy of Clonezilla and image it. Then you can recover from even the worst screwup by restoring the image. Clonezilla, learn it, love it, live it.
Finally, your /etc/fstab file should be using UUIDs instead of device ids to identify drives. Open /etc/fstab, and if you have entries that look like this:

/dev/sda2 / ext4 defaults,errors=remount-ro 0 1

instead of this:

UUID=ec9de201-c1f1-44d1-b398-5977188d4632 / ext4 defaults,errors=remount-ro 0 1

Then start Googling until you can boot with UUIDs. Although I won’t cover the difference between device designations and UUIDs in this article except to say that the reason for using UUIDs is that the device IDs and partition numbers on the new drive may not match the old ones, so fstab could be incorrect. Once you can boot with UUIDs, we are in a position to assign new drives the same UUIDs as the old drive had, ensuring that fstab will not have to be edited.

Create and copy your partitions
For this part you will need a Linux Live CD or USB flash drive. Hopefully, you already have one handy in case of emergency. Boot from the live CD or USB flash drive. Attach the old and the new drive to the system.
Ok, here we go.
To copy partitions:
1. Partition the new drive. If you have “/boot” and “/” partitions on the old drive, create them on the new drive.
2. Format the partitions with the same file systems as the old drive partitions.
3. Boot from a live CD or USB flash drive
4. Open a terminal
5. mount the partitions from both the old and the new drives (use “sudo blkid” to see the devices and partitions).
6. For each partition, run:
sudo cp -afv source_mount_point/. destination_mount_point
So for example:

sudo cp -afv /mnt/old_drive_boot/. /mnt/new_drive_boot

7. run “sudo blkid” and make note of the UUIDs of the old drive (open text editor and copy and paste from the terminal).
8. Unmount the old drive partitions (“sudo umount MOUNT_POINT”)
9. For each partition, set the GUID to match the ones on the old partitions:

sudo tune2fs -U UUID /dev/sdXX

10. Turn off your machine, remove the old drive and boot from the Live CD/USB again.
11. Follow the next section derived from http://zeasite.com/blog

Install GRUB2 to your new drive
1. In Terminal type

sudo fdisk -l (or "parted" and "list" if you are using GPT instead of MBR)

2. Mount the / partition drive

sudo mount /dev/sdXX /mnt

(example ‘sudo mount /dev/sda11 /mnt’ ,don’t miss the spaces.)
3. Only if you have a separate boot partition:

sudo mount /dev/sdYY /mnt/boot

4. Mount the virtual filesystems:

sudo mount --bind /dev /mnt/dev
sudo mount --bind /proc /mnt/proc
sudo mount --bind /sys /mnt/sys

5. To ensure that only the grub utilities from the LiveCD get executed, mount the /usr directory:

sudo mount --bind /usr/ /mnt/usr

6. Ok, now we can chroot onto the new drive.

sudo chroot /mnt

7. Ensure that there’s a /boot/grub/grub.cfg

update-grub2

8. Now reinstall Grub

grub-install /dev/sdX

(eg. grub-install /dev/sda – do not specify the partition number.
9. Verify the install

sudo grub-install --recheck /dev/sdX

10. Exit chroot : CTRL-D on keyboard (or “exit”)
11. Unmount virtual filesystems:

sudo umount /mnt/dev
sudo umount /mnt/proc
sudo umount /mnt/sys

12. If you mounted a separate /boot partition:

sudo umount /mnt/boot

13. Unmount the LiveCD’s /usr directory:

sudo umount /mnt/usr

14. Unmount last device:

sudo umount /mnt

15. Reboot.

sudo reboot

16. After you successfully reboot, make sure that you change fstab and other files to tweak your system for your new SSD:
https://wiki.archlinux.org/index.php/Solid_State_Drives
Enjoy your new SSD!

Software Engineers and Musicians

There is almost no difference between a preening, tattooed rock star and a Star Trek worshipping, Cheetos-eating computer geek.

Ok, maybe I’m overstating that just a tad. I’m an executive at a software company. I started out as a software engineer and I still consider myself a software engineer (of course as soon as one moves into a management role, former colleagues snicker behind your back when you continue to refer to yourself as a “software engineer”). I have worked in the software industry for 27 years. With all the seismic changes that have occurred over that time, from green screen terminals, to PCs, to networks, to desktop supercomputers, to the Internet and mobile computing, one fact has remained constant; an inordinate percentage of software engineers are also amateur or semi-professional musicians.

I have personally observed this phenomenon through the years. I can’t count the number of times that I have been out to dinner with new acquaintances who work in the software industry. The talk turns to music, and inevitably a majority of the group actively plays an instrument. One colleague of mine recently quoted a study (I have no idea if this is true) which showed that 85% of IT workers were also musicians.

The question is; why should this be so? Believe me; my friends and I have batted around a number of theories. There are some obvious similarities; the stereotypical rock star exists on Jack Daniels and cocaine, the software engineer on Twinkies and Jolt cola. Rock stars rebel against bureaucracy and the “suits” at the big companies (or at least they used to when the music was more important than commercial success). Software engineers do the same (that’s why so many good ones opt to work at small companies and open source projects). Rock stars have their band. Software engineers have their team. Both choose jobs that don’t require a dress code (just turn out good tunes or good code) and have more flexible hours (or just more hours). Rock stars work towards the CD release, software engineers the product release. Just as many software engineers are amateur musicians, many musicians are amateur computer geeks.

I have a theory that I think neatly explains the significant overlap in interest and skill between these two groups. Like most good theories, this one is forehead-slappingly obvious once you hear it. In a nutshell, software engineers and musicians do virtually the same thing. Allow me to explain. Most people who do not work in the high-tech industry assume that software engineering is mathematical in nature. Ask any teenager why he or she is uninterested in programming and I’ll bet you that most will say “I’m not good at math”. There is a perception that programming is a mathematically based calculation, probably because the parallel idea persists that computers are nothing more than giant, blindingly fast calculators. But the truth is that programming is not a mathematical exercise, it is a creative exercise. Programmers are given a language syntax, programming interfaces, and a toolset which together form a structured framework. Within that framework they can be inventive, creative, and imaginative. Truly great programmers create elegant, almost beautiful solutions to complex problems. Peer recognition of their creativity and expertise is a large part of their reward. Sound familiar? Musicians are also given a “language syntax” and a set of rules that form a structured framework. Within that very structured framework they are also called upon to be inventive, creative, and imaginative. A software engineer hones the same skills that are required of the musician. If he or she also happen to have a good ear, why not pick up an instrument and leverage those skills in a different and equally interesting realm? All that is required is that he or she learn another language and a different structure.

I have no idea how one would go about attempting to prove whether my theory is correct, but I will admit to having a hidden agenda. My hope is that the next time the reader meets a software engineer, the first thought that comes to mind will not be “computer geek”. It will be “artist”.