OpenStack Part 5: Setting up OpenStack

Still following this guide.

For the controller node I needed to install first:

  • SQL database: MariaDB
  • NoSQL database: MongoDB
  • Message queue: RabbitMQ
  • Memcached

to support these services on the controller node:

  • Identity (keystone)
  • Image service (glance)
  • Dashboard (horizon) – will only be installed after setting up the networking node

these on the network node:

  • Networking (neutron)

and these on the compute node:

  • Compute (nova)

First I install keystone and glance on the controller node, then nova on the compute node, and neutron on the network node. Back to the controller node, I will add horizon and ceilometer.

keystone

While installing keystone, and populating the database, I ran into an issue where the script returned an error:

2016-07-27 22:36:21.749 3111 ERROR oslo_db.sqlalchemy.exc_filters [-] DBAPIError exception wrapped from (pymysql.err.InternalError) (1071, u'Specified key was too long; max key length is 767 bytes')

A solution was found here: https://bugs.launchpad.net/openstack-manuals/+bug/1575688

It basically comes down to ubuntu is now using a character set with 4 bytes per character, while the python engine, while trying to create a field 250 characters long can only support 767 bytes, which is less than the 1000 bytes it would take. The fix described will reconfigure mariadb to use 1 byte characters instead, and recreate the keystone database.

glance

As described in the guide

nova

As described in the guide, but I did have some trouble because I entered the wrong password for the nova user while creating it in openstack.

neutron

I found this example architecture, but then I would need to add another VLAN interface to the compute and network node machines, and the controller node only needs the management interface, so I can remove interface to the tunnel network again:
http://docs.openstack.org/mitaka/networking-guide/scenario-classic-ovs.html

On the controller node I would need to install:

  • neutron-server
  • neutron-plugin-ml2

On the network node:

  • openvswitch-switch
  • neutron-plugin-ml2
  • neutron-openvswitch-agent
  • neutron-l3-agent
  • neutron-dhcp-agent
  • neutron-metadata-agent

And on the compute node:

  • openvswitch-switch
  • neutron-plugin-ml2
  • neutron-openvswitch-agent

The guide describes how to install a basic neutron service on the controller node, but instead I would like it to run on the network node instead.

Installation of the above mentioned services has been done, but setting it up proved too much at this point.  I will cover this in a following post.

More information will probably come from this http://docs.openstack.org/mitaka/networking-guide/, instead of the basic installation guide.

horizon

The was very straightforward, as one would expect.  Installation followed the guide.

ceilometer (still optional)

Postponing installation of ceilometer for later.

BMW R Nine T

It’s already been a few weeks now since I’ve taken this baby out for a spin, but I still wanted to write it up in a post of it’s own.

I’ve only ever owned a Suzuki M800, and only a few times have I swapped bikes with colleagues or friends. So this won’t be an expert comparison review on the BMW R Nine T, but just my personal experience.
I’ve always thought that the next bike I’d buy would be a Harley Davidson Breakout, or a Night Rod Special, but I might have to step down from that. This R Nine T is just amazing. It looks great, it rides fantastic. There is A LOT of power at low rpm, and still you feel you are in absolute control. The few times I’ve ridden other motorcycles, it took me a while to adjust to the power curve, either I kept stalling it because I didn’t rev it up high enough, or I had troubles with selecting the correct gear. Not with this one, the power is there from the low rpm, all the way up to the highs, which gives for a very comfortable feeling.
The little tug to the right the bike give you when you rev it up at standstill, because of the boxer motor and shaft drive, I was warned about before I got on. I was a bit surprised that it was this pronounced, but it’s not noticeable when riding. It’s just a great feeling to have.
The one thing that did strike me odd was that it felt amazing heavy to steer around tight corners. I’m used to my M800 being very light around the corners, although a lot of people assume it must feel really heavy, just because the bike looks heavy. I guess that I’ve been using all counter steering on the Suzuki, the handlebars are very wide, giving me a big lever to push against. So with minimal effort to guide her through the bends. Now with the R Nine T, that kind of steering was a lot harder. I guess that I should lean into the curve more on a bike like that, something that doesn’t have any (or just a little) effect on the Suzuki. I’ll have it to give it another try sometime next year, when the motorcycle season starts again.

Quadcopter part 8: I2C

For the quadcopter I bought a GY-80 arduino compatible 10 DOF (degrees of freedom) sensor IMU. The small board comes with an accelerometer, a gyroscope, a magnetometer, and a pressure sensor. For now I only need the accelerometer and the gyroscope, and this post deals with connecting the sensor board to the beaglebone back and reading out the results by using the BlackLib library.

First some specifications on the sensor board:

  • 3 Axis Gyro
    • ST Microelectronics L3G4200D
    • Address: 0x69
    • Datasheet
  • 3 Axis Accelerometer
    • Analog Devices ADXL345
    • Address: 0x53
    • Datasheet
  • 3 Axis Magnetometer
  • Barometer + Thermometer

Connecting the sensors to the beaglebone black is very straightforward. The sensor board supports both 5V and 3.3V power, and in case of the beaglebone al the I2C lines are 3.3V logic levels, I decided to power the sensors with the 3.3V.

To connect the SDA and SCL lines to the beaglebone black board, you need to realise that the beaglebone comes with 3 I2C busses. Only I2C bus 0 and 1 are by default enabled, and used by the system, the third one can be turned on by using the device tree overlays. But I2C bus 0 isn’t exported to the expansion headers so I will have to use I2C bus 1, on expansion header P9, pins 19 and 20, since these are by default enabled, no additional configuration was required.

When powering up the board:

root@beaglebone:~# i2cdetect -y -r 1
0  1  2  3  4  5  6  7  8  9  a  b  c  d  e  f
00:          -- -- -- -- -- -- -- -- -- -- -- -- --
10: -- -- -- -- -- -- -- -- -- -- -- -- -- -- 1e --
20: -- -- -- -- -- -- -- -- -- -- -- -- -- -- -- --
30: -- -- -- -- -- -- -- -- -- -- -- -- -- -- -- --
40: -- -- -- -- -- -- -- -- -- -- -- -- -- -- -- --
50: -- -- -- 53 UU UU UU UU -- -- -- -- -- -- -- --
60: -- -- -- -- -- -- -- -- -- 69 -- -- -- -- -- --
70: -- -- -- -- -- -- -- 77

With the BlackLib library, reading out the sensor data was fairly easy. Sources can be found on my github.

With this final hardware installed on the quadcopter, the assembly has been completed!
wpid-wp-1425224103231.jpeg

Quadcopter part 7: C++ Programming with BlackLib

[UPDATE]: this was on kernel version 3.8.  I’ve started over on kernel version 4.4, and since the PWM code in BlackLib (v2 and v3) aren’t working with 4.4, I’ve decided to do the implementation myself.  All the C++11 options, dialects, etc can be removed from the eclipse project settings.
BlackLib v3 does have a nice Makefile now, so building and using it doesn’t require you to set up a seperate project in eclipse anymore, you just need to specify the include path and the library path.

First you’ll need the cross compiler. For example, on Ubuntu:
sudo apt-get install gcc-arm-linux-gnueabihf

This will give you:
nicky@nicky-Precision-M4800:~/Projects/BlackLib$ arm-linux-gnueabihf-g++ --version
arm-linux-gnueabihf-g++ (Ubuntu/Linaro 4.9.1-16ubuntu6) 4.9.1
Copyright (C) 2014 Free Software Foundation, Inc.
This is free software; see the source for copying conditions. There is NO
warranty; not even for MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE.

nicky@nicky-Precision-M4800:~/Projects/BlackLib$ arm-linux-gnueabihf-gcc –version
arm-linux-gnueabihf-gcc (Ubuntu/Linaro 4.9.1-16ubuntu6) 4.9.1
Copyright (C) 2014 Free Software Foundation, Inc.
This is free software; see the source for copying conditions. There is NO
warranty; not even for MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE.

However it seems that this version is a bit more recent then the one BlackLib has been developed with, and it won’t compile due to a few missing includes. You can find this fix on my github repo: https://github.com/panic1/BlackLib/tree/unistd

Now I will be using eclipse to build a shared library from this BlackLib code, in my setup I’m using Eclipse Luna with CDT.

  1. Create a new C++ Project, Click next.
  2. Project name: BlackLib
  3. Uncheck default location, and select the location where you checked out the BlackLib code
  4. Select Shared Library, Empty Project
  5. Select cross toolchain (you might need to uncheck the checkmark at the bottom to show all toolchain options), and click next
  6. The toolchain prefix: arm-linux-gnueabihf-. Click finish

Now the fun starts, BlackLib is written with quite advanced C++11 functionality, and the compiler will have to be enable to allow these experimental features:

  1. Right click on the project, select Properties
  2. Go to C/C++ Build, Settings
  3. In the Cross Settings the prefix should be set to arm-linux-gnueabihf- (just in case you’ve forgotten in a previous step
  4. In the Cross C++ Compiler, Dialect, Language standard should be set to ISO C++11
  5. In the Cross C++ Compiler, Preprocessor, add a new symbol __GXX_EXPERIMENTAL_CXX0X__
  6. In the Cross C++ Compiler, Miscellaneous, check the Position Independent Code (-fPIC)
  7. Apply

As we don’t need them in the resulting library, in the project you can right click, go to Resource Configuration, and Exclude from Build the following folders:

  • SPI_SETUP
  • V1_0
  • V2_0/SPI_SETUP
  • V2_0/exampleAndTiming
  • exampleAndTiming.cpp

Now go ahead and build the project, this should result in a libBlackLib.so file we’ll start to use in the next steps.

Using the library in a new project is pretty straight forward:

Create a new C++ project in Eclipse, choose Empty Project and the Cross GCC toolchain, and click next. The toolchain prefix should be arm-linux-gnueabihf-, just like before.

Right click the project, and go to Properties, Project References and select the BlackLib project to be referenced.
Go to C/C++ Build, Settings, and add the path to the BlackLib/v2.0 folder Cross G++ Compiler Includes, and Cross G++ Linker Libraries should include the BlackLib library, and the path to the BlackLib/Debug where the libBlackLib.so file can be found.

To run your application on the Beaglebone board, you will first have to copy the libBlackLib.so file. There are several valid locations where Linux searches for shared libraries, I usually put it in /usr/lib/. Then copy your application binary, location doesn’t really matter, for example /root or /home/debian, make the binary executable (chmod), and run it.

Collection of guitars

Here I would like to share a picture of the guitars here at home. So from left to right: the ESP LTD EC-1000 ASB, the Jackson RRTMG and the ESP LTD KH-602. The amplifier is a Peavey Vypyr 30 with the Sampera2 foot switch.

image