Neil Hopcroft

A digital misfit

Adding Navit to the build server

Since I’m considering changing my car, I’m having a look at some potential in-car computing systems. Navit looks like it might provide some interesting functionality for open source navigation based on OSM maps. So I’m adding Navit to my Jenkins build server. The project lives in Git and is built with CMake. Adding this build is easy and, while the build completes successfully (installation is another matter, but that is because I built sudo root from the command line which doesn’t give user tomcat permissions to overwrite some of the files…that’ll take a little sorting out, but shouldn’t cause any significant problems), there are some missing dependencies:

  • dbus
  • dbus-glib
  • liblocation
  • libosso
  • libgps
  • libgarmin
  • imlib
  • gypsy
  • fontconfig
  • libspeechd
  • fribidi
  • freeimage

Some of these should be resolved by installing the -devel packages:

  • dbus-devel
  • dbus-glib-devel

The rest will probably need projects added to the build server.


Setting up a Xamarin build in Jenkins

I recently had a look at a Xamarin Studio build running on a Mac, with the idea of adding the build to a Jenkins server.
The build originally failed claiming that the Xamarin licence wasn’t valid (it was only a starter licence when the machine had a business licence installed). There are two options to resolve this, either bring the licence to the Jenkins build or make the Jenkins build be the licensed user. I would generally prefer to keep the CI builds under a different user to contain any wayward builds, but in this case we chose to make the Jenkins server run as the licensed user.
The build had already been set up under the jenkins user, so I needed to pull that job into the new users configuration. This was just a question of copying the job files into the new tree.
I didn’t really get my hands dirty with Xamarin itself, it looks like a neat idea, allowing easy writing and subsequent porting of applications from one mobile platform to another.


Refactoring OBD diagnostics page

The original version of the OBD ‘wheres Neil?’ page was created as a Perl script generating HTML/Javascript on the fly, this was made as a proof of concept to get something on the web. It does leave a lot to be desired, though. For a start, in its current form it will only display the journeys from the last day for which there is data. This is adequate for answering the question “Where’s Neil?”, when live data is arriving that will be the latest, but it doesn’t really allow access to the full power of the collected data. There are some interesting things that might be worth trying to display:

  • Historic data for a particular piece of road
  • Locations of high-revs or high-speeds
  • Locations of sudden acceleration and braking
  • Maps of engine load/RPM and throttle position
  • Locations of good and bad fuel economy

And, I’m sure, there will be others.
To do this I want to bring in an Ajax interface to dynamically get data from the server. Fortunately (and one of the major advantages to this approach) this simplifies the code rather than complicates it. The currently auto-generated HTML/Javascript can be replaced with a static page which requests data using an Ajax request. Then the server need only serve an appropriate JSON object for the required data. This removes the need for the current mishmash of Perl, Javascript and HTML.


Build break in of-video #210

The of-video project has failed with these errors:

In file included from AVHandler.cc:25:0:
AVHandler.h:244:12: error: expected ‘;’ at end of member declaration
AVFrame *create_frame(PixelFormat fmt);
^
AVHandler.h:244:37: error: expected ‘)’ before ‘fmt’
AVFrame *create_frame(PixelFormat fmt);
^
AVHandler.cc: In member function ‘int AVHandler::setup_write()’:
AVHandler.cc:117:39: error: ‘CODEC_ID_NONE’ was not declared in this scope
av_output->oformat->audio_codec = CODEC_ID_NONE;
^
AVHandler.cc:146:49: error: expression cannot be used as a function
frame = create_frame(vstream->codec->pix_fmt);
^
AVHandler.cc:147:29: error: ‘PIX_FMT_RGB24’ was not declared in this scope
rgbframe = create_frame(PIX_FMT_RGB24);
^
AVHandler.cc:147:42: error: expression cannot be used as a function
rgbframe = create_frame(PIX_FMT_RGB24);
^

These are some more things missing their AV prefix following some configuration changes. I have made some local fixes for these.
Fixed in build #220.


Adding yocto project

There seems to be a number of people using Yocto Project for their embedded systems builds, indeed, I have experimented with it for the Intel Galileo board I dabbled with a couple of years ago.
To add this to the CI build server I am going to use the Jethro branch. First step is to to clone the code and manually try some builds from the command line. This gives me an error:

libsdl-native is set to be ASSUME_PROVIDED but sdl-config can’t be found in PATH. Please either install it, or configure qemu not to require sdl.

I will add libsdl to the CI build server and see if that resolves the problem – it doesn’t. The latest code there installs libSDL2 and sdl2-config, which doesn’t resolve the dependency problem. Instead removing the SDL lines from the yocto/build/conf/local.conf file does resolve the problem.
The next problem is the sheer size of the build – it is, after all, a system to build a complete image – I aborted the ‘bitbake world’ build at about 20% completion when it threatened to consume all available disk space. ‘bitbake core-image-minimal’ is probably manageable. Then there is the question of how long a build will take – the 20% of the ‘world’ build had taken nearly 2 days, so it isn’t something we want to do clean rebuilds of on a regular basis.
Now the build is failing with

build/genattrtab /usr/share/tomcat7/.jenkins/workspace/yocto/build/tmp/work-shared/gcc-5.2.0-r0/gcc-5.2.0/gcc/common.md /usr/share/tomcat7/.jenkins/workspace/yocto/build/tmp/work-shared/gcc-5.2.0-r0/gcc-5.2.0/gcc/config/i386/i386.md insn-conditions.md \
-Atmp-attrtab.c -Dtmp-dfatab.c -Ltmp-latencytab.c
make[1]: *** [s-attrtab] Killed

A quick search reveals that this is likely caused by running out of memory. Applying the suggested fix there, to add some swap space, resolves this problem.
Now the build runs to completion, taking 37 hours to complete even though I had already allowed 200-odd of the tasks to run in a shell.
The next question is how updates occur, I have launched a few more builds since this completion and there have been no changes, leaving the build with no tasks requiring rerunning. I’ll put this on a weekly rebuild schedule and see what happens.


Resurrecting Where’s Neil? and the OBD data logger

A little experimenting with the bluetooth OBD units in my car has shown that one of them hasn’t blown yet – I thought my car had a tendency to overvoltage and smoke them, at least a couple have given up their magic smoke.
This means there is potential to resurrect the “Where’s Neil?” web page (which might become password protected at some point, to maintain my privacy – I’ll give you a password if I’m coming to visit you). Next though, I need to get the data connection working again – my PAYG SIM has expired. My old Android phone, the one with the OBD software on, is SIM locked to Orange, but I have a Mifi dongle that is not tied to any particular network. I spoke to someone in a phone shop who was absolutely sure they didn’t do data SIMs and that a normal voice SIM wouldn’t work in a data dongle. But I bought a new EE voice SIM anyway, thinking that it would work with my old Android phone even if it didn’t work with the dongle. Turns out it is the other way around, it is fine in the dongle not in the phone. So now I have a chain that looks like this:

Engine <=> CAN Bus <=> OBD reader <=> Bluetooth <=> Phone <=> Wifi <=> Dongle <=> GSM <=> Webserver

Nothing can go wrong here, surely.
Actually, it does work, although it is a bit cumbersome. So the page is live again, although it will only be used occasionally since my car will run its battery down if I forget to remove the OBD unit – I have put a new heavy duty battery in it, but I still worry. Although a quick search on Amazon reveals some small Lithium Ion battery packs that will provide enough power for a jump start, so it might be worth investing in something like that, in case of emergency.


Build break – of-fem-fenics build #156

Build #156 of of-fem-fenics is giving this error:

CPPFLAGS=”-std=c++11 -fopenmp -DDOLFIN_VERSION=\”1.7.0dev\” -DNDEBUG -DDOLFIN_SIZE_T=8 -DDOLFIN_LA_INDEX_SIZE=4 -DHAS_PETSC -DENABLE_PETSC_TAO -DHAS_UMFPACK -DHAS_CHOLMOD -DHAS_PARMETIS -DHAS_ZLIB -DHAS_CPPUNIT -DHAS_MPI -DHAS_OPENMP -DHAS_QT4 -DHAS_VTK -DHAS_QVTK -I/usr/local/include -I/usr/local/include/vtk-6.3 -I/usr/local/Trolltech/Qt-4.8.6/include -I/usr/local/include/eigen3 -DLATEST_DOLFIN” /usr/local/bin/mkoctfile -c Mesh.cc -o Mesh.o
In file included from /usr/local/include/dolfin/function/FunctionSpace.h:37:0,
from /usr/local/include/dolfin/function/dolfin_function.h:10,
from /usr/local/include/dolfin.h:26,
from mesh.h:21,
from Mesh.cc:19:
/usr/local/include/dolfin/fem/FiniteElement.h: In member function ‘void dolfin::FiniteElement::map_from_reference_cell(double*, const double*, const ufc::cell&) const’:
/usr/local/include/dolfin/fem/FiniteElement.h:184:21: error: ‘const class ufc::finite_element’ has no member named ‘map_from_reference_cell’
_ufc_element->map_from_reference_cell(x, xhat, c);
^
/usr/local/include/dolfin/fem/FiniteElement.h: In member function ‘void dolfin::FiniteElement::map_to_reference_cell(double*, const double*, const ufc::cell&) const’:
/usr/local/include/dolfin/fem/FiniteElement.h:192:21: error: ‘const class ufc::finite_element’ has no member named ‘map_to_reference_cell’
_ufc_element->map_to_reference_cell(xhat, x, c);
^
make: *** [Mesh.o] Error 1

This build was, like the recent dolfin build, made following ffc build #45, among a number of other upstream project changes. I’m hoping that resolving the dolfin build errors will also resolve this build.
The dolfin build, while still erroring, has resolved the problems I suspected to come from this change without resolving this error, further investigation is required to resolve this.
Indeed, it turns out that fixing the dolfin build errors also fixes these.
Fixed in build #239.


State of the nation: things are looking up

For the first time since I started running the build server in earnest there are no red dots showing next to any of the projects. I have disabled a few projects, mostly because they are not used by the target projects I am interested in and because they have suffered some kind of build error which will take some tracking down.
There are still some test failures, showing as yellow dots for unstable builds, notably in the event locator project. This project needs revisiting and completely refactoring at some point, but first I need to dig out a development desktop machine with enough memory and disk space to run the development environment.
Now we have a good baseline from which any failures can be investigated and resolved.
The build queue is now pretty constantly full, so this is really too small a machine for the builds I am trying to run, but since I am only running them ‘for fun’ and not directly toward any business goal there isn’t a pressing desire to upgrade the AWS instance, besides, I have paid for three years of a heavy utilisation instance at this level, so I may as well keep it running doing something.
One factor making the build queue so full is that the octave project triggers builds of all the of- projects upon completion, so every change to octave causes 70-something items to be added to the queue – I could reduce the impact of this by turning the SCM polling frequency down, it is currently @hourly, which I suspect launches a lot of builds which could just as well be done @daily, especially given the build itself takes 12 hours.


Build break – obd android #42

Build #42 of the obd android project failed with

A problem occurred configuring root project ‘obd android’.
failed to find Build Tools revision 23.0.1

I currently have v22.0.1 installed, so time to update the Android SDK.
Running ‘tools/android update sdk –no-ui’ doesn’t update my build tools, despite going through some of the downloading/updating process. I did, however, find some instructions for installing different versions of build tools. I have now added 23.0.1 to my build-tools/ directory and launched a new build.
For some reason this hasn’t worked, so I have switched the build to use 22.0.1, the currently installed version. This allows the build to complete.
Fixed in build #53.