I’ve recently taken a job at Ansible working on the enterprise offering Tower. In case you don’t know, Tower is a front-end for your Ansible playbooks w/ enterprise permission management. I was tasked with evaluating our database needs for a new System Tracking feature that we released. Working remotely at the time forced me to create detailed presentations on my progress and evaluation. I ended up taking the internal presentations and created a blog post about the evaluation process.
So you want to get an instance of OpenStack running to poke around and see what all the fuss is about without going insane. Welcome to Devstack. Once Devstack is setup you will have access to a web-based control panel with prepopulated data and instances. You will also be able to explore the OpenStack API with v2.0 and v3 authentication (keystone).
devstack webpanel
Setup
git clone https://github.com/chrismeyersfsu/playbook-devstack
cd playbook-devstack/
sudo ansible-galaxy install -r requirements.yml
Create an ec2 elastic ip address and override the playbook variable ec2_elastic_ip.
Map a domain/subdomain in route53 (or other dns service) to your elasic ip address. (i.e. devstack.example.com)
Set your webportal login password by overriding the playbook variable nova_password
Execution
Be aware that the playbook may take > 20 minutes on an ec2 instance to complete.
Installing to the internal MMC requires an SDCARD to install, but the sdcard is not required after that. The process is mostly the same. The MMC setup vs. the SDCARD setup depends on which image you download.
Installing Ubuntu
MMC:Download the latest file of the form BBB-eMMC-flasher-ubuntu-xx.xx-xxxx-xx-xx.img.xz SDCARD:Download the latest file of the form ubuntu-12.10-console-armhf-xxxx-xx-xx.tar.xz
Extract the image
sudo apt-get install xz
xz -d *.img.xz
Insert the sdcard into your desktop and note the device path. In my case the device is at /dev/sdc.
meyers@mcbeefy:~/beaglebone$ dmesg
[ 1659.900631] usb 3-1: USB disconnect, device number 3
[ 2664.433700] usb 3-1: new high-speed USB device number 4 using xhci_hcd
[ 2664.709199] scsi7 : usb-storage 3-1:1.0
[ 2665.706903] scsi 7:0:0:0: Direct-Access Generic- SD/MMC 1.00 PQ: 0 ANSI: 0 CCS
[ 2665.707747] sd 7:0:0:0: Attached scsi generic sg3 type 0
[ 2666.334388] sd 7:0:0:0: [sdc] 15519744 512-byte logical blocks: (7.94 GB/7.40 GiB)
[ 2666.334770] sd 7:0:0:0: [sdc] Write Protect is off
[ 2666.334775] sd 7:0:0:0: [sdc] Mode Sense: 03 00 00 00
[ 2666.335066] sd 7:0:0:0: [sdc] No Caching mode page present
[ 2666.335071] sd 7:0:0:0: [sdc] Assuming drive cache: write through
[ 2666.336660] sd 7:0:0:0: [sdc] No Caching mode page present
[ 2666.336667] sd 7:0:0:0: [sdc] Assuming drive cache: write through
[ 2666.337339] sdc: sdc1 sdc2
[ 2666.338721] sd 7:0:0:0: [sdc] No Caching mode page present
[ 2666.338726] sd 7:0:0:0: [sdc] Assuming drive cache: write through
[ 2666.338730] sd 7:0:0:0: [sdc] Attached SCSI removable disk
[ 2666.821868] EXT4-fs (sdc2): mounted filesystem with ordered data mode. Opts: (null)
Flash the image to the sdcard. Substitute <mmc_or_sdcard>.img and /dev/sdX accordingly.
sudo dd if=<mmc_or_sdcard>.img of=/dev/sdX bs=1M
Upon completion remove the sdcard and perform the following:
Ensure the beaglebone is off
If you plan on powering the beaglebone with usb, ensure the ethernet is unplugged.
Insert the sdcard into the beaglebone
Hold down the button that is by itself near the SDCARD
Insert the USB power or barrel jack power
Once the lights begin blinking blue you may release the button
Wait =~ 45 minutes until all the lights are blue
Once all the lights turn solid blue the MMC is successfully flashed and you may power down your beaglebone (unplug the power), remove the sdcard. Wait a couple seconds, then plug the power back in and the system will boot Ubuntu.
Verifying Ubuntu Install
Find the ip of your beaglebone on your network.
meyers@mcbeefy:~$ sudo nmap -sP 192.168.1.*
Starting Nmap 5.21 ( http://nmap.org ) at 2013-06-30 14:13 EDT
Nmap scan report for 192.168.1.1
Host is up (0.00086s latency).
MAC Address: 00:23:69:0E:20:D7 (Cisco-Linksys)
Nmap scan report for 192.168.1.2
Host is up (0.076s latency).
MAC Address: BC:AE:C5:C4:F6:AB (Unknown)
Nmap scan report for 192.168.1.103
Host is up (0.065s latency).
MAC Address: BC:AE:C5:C4:F6:AB (Unknown)
Nmap scan report for 192.168.1.106
Host is up (0.00023s latency).
MAC Address: 3C:07:71:24:21:4B (Unknown)
Nmap scan report for 192.168.1.107
Host is up.
Nmap scan report for 192.168.1.112
Host is up (0.075s latency).
MAC Address: BC:AE:C5:C4:F6:AB (Unknown)
Nmap scan report for 192.168.1.114
Host is up (0.062s latency).
MAC Address: BC:AE:C5:C4:F6:AB (Unknown)
Nmap scan report for 192.168.1.116
Host is up (0.00072s latency).
MAC Address: C8:A0:30:B2:8E:5D (Unknown)
Nmap scan report for 192.168.1.118
Host is up (0.017s latency).
MAC Address: BC:AE:C5:C4:F6:AB (Unknown)
Nmap done: 256 IP addresses (9 hosts up) scanned in 6.18 seconds
Save the below code as spidev_test.c on to your Raspberry Pi and compile it
gcc spidev_test.c -o spidev_test
Running
The MSP430 board LED1 will blink 3 times upon recognition of the SPI clock. After this initial sequence, when you SPI data “HELLO WORLD\n” to the MSP430 it will turn on the LED1 light.
On your Raspberry Pi run the previously compiled program. The -s options sets the frequency of the clock when performing the SPI communication.
sudo ./spidev_test -s 120000
Again, a successful sending of “HELLO WORLD\n” will be denoted by LED1 lighting up on the MSP430 board.
Save the below code as spidev_test.c on to your Raspberry Pi and compile it
gcc spidev_test.c -o spidev_test
Running
Plug your Arduino to your desktop via the serial cable. Open the arduino Serial Monitor and set the bitrate to 115200. Now, on the Raspberry Pi, run the compiled code
sudo ./spidev_test
You should see HELLO WORLD print in the Arduino IDE Serial Monitor.
Debugging
Make sure that your kernel has the required drivers (spi-bcm2708.ko and spidev.ko)
pi@raspberrypi ~/spi $ ls -al /lib/modules/`uname -r`/kernel/drivers/spi/
total 64
drwxrwxr-x 2 pi pi 4096 Aug 10 10:53 .
drwxrwxr-x 23 pi pi 4096 Aug 10 10:53 ..
-rw-rw-r– 1 pi pi 14428 Aug 10 10:53 spi-bcm2708.ko
-rw-rw-r– 1 pi pi 10852 Aug 10 10:53 spi-bitbang.ko
-rw-rw-r– 1 pi pi 15803 Aug 10 10:53 spidev.ko
-rw-rw-r– 1 pi pi 10693 Aug 10 10:53 spi-gpio.ko
Always excercise caution when working with electronics. All software is provided on an "as is" basis without warranty of any kind, express or implied. Unless otherwise noted, all code content is licensed under the Apache 2.0 license