I’ve had a lot of problems trying to update the OpenROV software from the default image. I keep on getting npm errors and install script errors. I’ve tried all the suggestions from the wiki and also forum.
So I decided to try and build my own image from Source after noticing on Github a recent change to using Vagrant with instructions on building your own image. I already had a copy of Virtual box and so decided to give it a try. I’m on Mac OSX system but it should work on other systems.
I had some problems with the build and after speaking to Bryan A on the OpenROV downgraded my copy of VirtualBox to version 4.2.10.
- Download and install a copy of Vagrant from http://www.vagrantup.com/
- I already had a recent copy of Virtual box, but this can be downloaded from http://www.oracle.com/technetwork/server-storage/virtualbox/downloads/index.html
- Clone the github file from https://github.com/OpenROV/openrov-image locally I used GitHUB desktop to do this.
- Using Terminal chang into the directory where cloned the repository openrov-image
- Type the command “vagrant up” On my system this started a number of commands but hung at “Waiting for VM to boot. This can take a few minutes.” A quick trip to Google revealed that others have experienced the same problem. First I had to stop the running image this can be done by typing the command “VBoxManage list runningvms” followed by BoxManage controlvm <id of running image> poweroff
- I fixed it by running up the Virtual box and starting the image manually. I closed the image then tried the Vagrant up command again this time the image seemed to spin up and download a number of different files before exiting back to the command prompt
- Type the command “vagrant ssh” to ssh into the image, Windows users will probably need to use putty to do this.
- change to the vagrant directory cd /vagrant
- and run the build “./build.sh”
- This will take sometime so go and have a cup of tea, at the end hopefully we should have a completed build ready for installation to the SDCard
- One problem was getting the system to recognise the SDCard the following instructions from http://superuser.com/questions/373463/how-to-access-an-sd-card-from-a-virtual-machine/#45808 was one solution and these instructions are repeated below:
On newer MacBook Pro’s the SD card slot is no longer exposed as a USB device. Because of this you’ll need to attach the raw device to the VM in order to gain raw access to the whole card. Full documentation is in the Advanced Storage Configuration section of the VirtualBox documentation.
As clearly stated in the docs:
Warning – Raw hard disk access is for expert users only. Incorrect use or use of an outdated configuration can lead to total loss of data on the physical disk. Most importantly, do not attempt to boot the partition with the currently running host operating system in a guest. This will lead to severe data corruption.
As a quick guide these are the steps to attach the device to a linux VM:
- Identify the raw disk block device on your host system
- Insert the SD card into the slot
- Open a Terminal and type “mount”. You’ll see output identifying the mounted volume from your SD card. On my system I get the following
/dev/disk1 on / (hfs, local, journaled)
devfs on /dev (devfs, local, nobrowse)
map -hosts on /net (autofs, nosuid, automounted, nobrowse)
map auto_home on /home (autofs, automounted, nobrowse)
/dev/disk2s1 on /Volumes/NO NAME (msdos, local, nodev, nosuid, noowners)`
- In my case the “NO NAME” volume is the SD card, so I take note of the
/dev/disk2s1 part. In this particular case the
s1 part represents a partition (slice) on the raw device, so the part we’ll use later is just the
- Open Disk Utility and “Unmount” the volume. Do not “Eject” it. Note that you may need to unmount the volume once in a while during the next steps as I found OSX would automatically remount it at random.
- Now we set up VirtualBox to be aware of the raw device with the following command in the Terminal.
- Note that the
/path/to/file.vmdk can be put anywhere, though it’s a good idea to store this in the guest VM folder such as
- Note that the
-rawdisk we use doesn’t reference the partition (slice) but only the block device as a whole.
<code>$ VBoxManage internalcommands createrawvmdk -filename /path/to/file.vmdk -rawdisk /dev/disk2
- Next we attach the raw disk to a guest VM within the VirtualBox UI
- Ensure the guest VM is not running.
- Open the settings area for the guest VM
- Click on “Storage” in the toolbar
- Next to the controller click on the icon to “Add Hard Disk”
- Select “Choose existing disk”
- Navigate to the
/path/to/file.vmdk you used in step 3 and select it
- You should now be returned to the Storage tab and see your
file.vmdk in the list.
- Start the VM
- Depending on whether you have a GUI or not the SD card may or may not automatically mount. If you need to mount is manually it is simply exposed as another standard block device, so on my guest this was exposed as /dev/sdb.
With the system now recognising the SDCard we could move onto installing the image to it
- Change to the build directory cd /vagrant/work/omap-image-builder/deploy/2013-07-20/ubuntu-12.04-r8-minimal-armhf-2013-07-20/
- Probe to get the SDCard “
sudo ./setup_sdcard.sh --probe-mmc" Note /dev/sdb
- I also needed to install some extra dependencies to get the install to run “sudo apt-get install wget pv dosfstools parted git-core”
- Finally we could install the image to the SD Card by issuing the command “
sudo ./setup_sdcard.sh --mmc /dev/sdb --uboot "bone""
- When finished you can log out of the VirtualBox and then call “vagrant halt” to stop the virtual system
Dale Dougherty did a walkaround at the UK Maker Faire. I’m featured with the OpenROV about half way through.
For the past two years I’ve been working on producing a book based on the Arduino called Arduino in Action for Manning publications. This was the first book that I have written and I now have the utmost respect for all authors.
I was helped in writing the book by two other author Joshua Noble and Jordan Hochenbaum. As well as writing I also had to produce all my own photographs, diagrams and circuit diagrams.
The book can be ordered in the UK from Amazon or from Manning publications directly Arduino in Action
I organised an event called Hack n Make to showcase Scottish Makers, mainly from the North East. Help to organise the event and make it a success included Jo Donaldson, Iain Gildea, Bruce Scharlau, Steve Milne, Phil Thomson and Heather Evans. The event took place on Sunday the 12th May and was part of The University of Aberdeen May Festival. The University were incredibly supportive, providing the venue as well as catering on the day.
It was a free event a all those that attended spoke very warmly about it.
I build a USB powered power supply for the topside part of the tether