Category: English


The end of the year is near. It’s time to look back in 2014. Looking back every year, a tradition I started in 2005. Now 2014 is coming to an end, what has happened this year?

One of the things that 2014 has brought is Beginhoven, my urban farming association, has obtained a lot from the municipality. So, in 2014, we have taken our first steps in actually growing some vegetables. The lot needs some work before it can produce food, and wild rabbits are eating our plants. However, we had some harvest nevertheless. We’re working on a toad pool and a storage hut. Beginhoven, urban farming, it’s an awesome project, but what I think is the most important thing about the project is the people, my friends, working together to archive a common goal. I am blessed to have friends like this. Something I have realised the past year on more then one occasion. Thank you everyone <3.

Apart from Beginhoven, 2014 has also meant the end of me being a student. A few weeks ago I’ve received my master’s degree. Working on my thesis project, well, scientific writing is tough, that I can tell you. Writing the code to do what they want, well, that’s rather straight forwards, but writing a thesis report about it, a whole different story.

In 2014 I’ve also met some amazing new friends, both in real life and online, inspiring people, beautiful souls. Ah… got to love festival season, right ;)

So… now I have arrived at the end of 2014, and at the end of a phase in my life. I am no longer a student. So…. I have arrived at a crossroad. Where to go from here? What road to take? What will the future bring? The future, a story yet untold. Where will I be next year? At this point, there is no way of telling. I welcome the unknown.

Happy 2015,
Love ya all <3

So, I was trying to compile an ancient Delphi 7 project in Lazarus. After running the import Delphi project wizard, and attempting to compile. After removing some Windows specific code (Windows version detection in OSinfo.pas has no meaning when compiling for Linux) ran into an error saying

Can't find unit exeinfo used by lnfodwrf

This error seems to be caused by the presence of a unit in my Delphi 7 project having a name clash with a Lazarus RTL unit, strings.pas. After renaming the unit, the problem went away. Now there is some other problem about a missing using TTcpClient. Oh well….

So, it’s Christmas Eve… time to write my Christmas Blog Post.So, tomorrow it’s Christmas, and what is it all about…

Christmas… a commercial event, tons of presents, a Christmas dinner big enough to feast for a week, is that what Christmas is really about?

Christmas is supposed to be about peace. Peace can only be archived by forgiveness. Forgive others who did you
wrong. Forgive the people who have hurt you. Sometimes they don’t even realise they’re hurting you, simply
because they experience the world differently, because they just can’t understand how you think and feel.
And sometimes, people have been hurt so badly they can’t act differently. So forgive them.

Forgive yourself for all the stupid things you did. Forgive yourself for the times you’ve hurt others. Forgiveness is the key to peace. It’s the only way.

My wishes for Christmas is that everyone can be happy, really, that’s all I wish for, all of you to be happy.

Merry Christmas,
Vrolijk Kerstfeest,
Frohe Weihnachten
God Jul!

So, I am working on this project. It’s written in Java and it consists on several web services (tomcat servlets) interacting. For the client part I am using Jersey. I have been writing a couple of servlets, and they’ve been interacting just fine, until yesterday, I ran into a problem.

The code to make a POST requests consist of the following form:

String myURL="http://localhost:8080/SomeService/someFunction";
UriBuilder uriBuilder = UriBuilder.fromUri(myURL);
FormDataMultiPart form = new FormDataMultiPart();

form.field("Field1", Field1);
form.field("Field2", Field2);

URI location = uriBuilder.build();
WebResource webResource = Client.create().resource(location);
String response= webResource.type(MediaType.MULTIPART_FORM_DATA)
.post(String.class,form);

Code written this form has been working fine until yesterday. Until this happened


SEVERE: Servlet.service() for servlet [SomeServlet] in context with path [/someFunction] threw exception
com.sun.jersey.api.client.ClientHandlerException: javax.ws.rs.WebApplicationException: java.lang.IllegalArgumentException: Missing body part entity of type 'text/plain'

raised by webResource.type(MediaType.MULTIPART_FORM_DATA).post(String.class,form);/

Google wasn’t very helpful solving this issue. The problem: one of the fields had a null value. So basically, this is a NullPointerException. If it said so, I knew what to look for, but… looking at this message, I hadn’t a clue what to look for. I was more-or-less expecting this meant the servlet being called returned nothing. But, after some debugging, including sniffing packets using WireShark, I had to make the conclusion no request was attempted. From there, I started thinking back about my changes. I realised on the the last steps I made was adding more fields to the request. So, I uncommented the fields I’ve added, and it made the (incomplete) request just fine. From there, I realised the issue must be with the newly added fields. That’s how I found out what the problem really was about.

Hello peoples,

Now that I am graduated, as mentioned in previous post, I am working on a project for my university. Well… today I also started working on one of my own projects again, the WordPress OAuth plugin. I am extending the plugin with features like sorting of buttons, and separating the OAuth code from the general code, to prepare support for other authentication schemes such as OpenID and Persona.

Once the separation code has been completes, it should result into two separate plugins BlaatSchaap Auth for the general code and BlaatSchaap OAuth for the OAuth specific code. This also introduces a problem. When current users upgrade to the next version, BlaatSchaap OAuth is upgraded, but then requires the BlaatSchaap Auth plugin. How to I install the BlaatSchaap Auth plugin automatically during the BlaatSchaap OAuth plugin upgrade. I have been googling about this issue, but without result. Is there an official way to do things like this or should I just hack some code together to do this trick?

Anyhow, tomorrow I’m having another party. Yeah, I am celebrating my birthday more then once this year. Party time! lol.

I have recently finished my master thesis project. Now I have been asked to integrate my project with another project my university is running. This project is a distributed Java project. Components of the project are implemented as Java Servlets, which run on a Tomcat server. The communication between the various components is implemented using the Jersey library.

So, the idea is that I implement the various components from my projects as Java Servlets, capable of running on a Tomcat server, using the Jersey library. In order to develop for this target, some set-up is required. First of all, as an IDE, not the regular version of Eclipse, but Eclipse for Java EE developers is required.

Once we have that edition up and running, we can create the set-up required for tomcat. Eclipse can download and install an installation of tomcat in a specified directory. I usually don’t like to install software outside the package manager, but since Eclipse will write configuration files, simply pointing to the system installation of Tomcat is not going to work.

So, let’s have a look at this Tomcat. Start Eclipse in a new workspace, and click the “Workbench” arrow in the top right.

1

Then, click windows -> show view -> servers. Now, a message appears at the bottom saying to servers have been configured. Click the message to configure a server.

2

3

Select Server type “Tomcat v 7.0” (listed under Apache). Please note that I am using Tomcat version 7 as this is the version used by my university. I suppose new projects should use version 8 instead.

4

In the next window, click Download and install, select a directory in your home directory, and wait until the

Finish

button is no longer gray. At the main window, right bottom, a progress indicator will be visible

5

Now, we follow this tutorial, section 6.1 and 6.2. For the jersey library, I’ll use the Jersey 1.18 zip bundle from the jersey website. I am using version 1.18 as this is used by my university. New projects should probably use an 2.x version. The JAR bundle should work as well but does not include all libraries. When using the bundle, the asm library should be downloaded separately.

Now, take a look at section 6.3. This example is written for the glassfish server, however, we are using the tomcat server. Replace org.glassfish.jersey.servlet.ServletContainer by com.sun.jersey.spi.container.servlet.ServletContainer.

Now, when we attempt to start the server, a configuration error message will appear.

7--

8

I am not quite sure what causes it, but when we delete the server and add it again, it will work. Now we’ve got a working Jersey Hello World running within Eclipse JEE.

Raspberry Pi and SD card file system corruption. I have been experiencing these issues and I can’t really pinpoint the source of the trouble. I decided to take one of my Raspberry Pi’s, install Raspbian on it, and then ISPConfig, to have a test server, with a similar configuration then the server hosting this blog, –production server– as you may. — anyhow — during the installation of some packages, the file system already got corrupted — therefore this was a never finished project.

At this point, I started to suspect the specific Pi. (I have two Model B revision 1 Pi’s) But, I cannot be sure. I have run the “Overclock stability test” script on both my Pi’s, on two different SD cards. Note: I am not overclocking, but it is a stability test, that reads and writes from the SD card. Everything seemed stable. (Also when I *did* overclock a bit)

One thing to notice about this test, it performs a series of sequential reads and writes. Perhaps that’s the difference. File system corruption occurs when writing to files. Keep in mind that SD cards are actually microcontrollers, and their programming might contain some FAT specific optimisations which cause corruption when running another file system. Keeping this in mind — the random writes method I have been suggesting earlier might not trigger the error. However… I am just speculating. In the end — it could be the power supply problem some people have been suggesting.

Anyway, enough about Pi’s, now it’s time for my ODROID U3 to do something: replacing my Raspberry Pi as NFS server. The Raspberry Pi has bad performance as an NFS server anyways. Therefore, in the past, I was about to replace it with my CubieBoard. Initial tests were promising, throughput was, –as far as I can recall– double the Pi’s. I went to sleep, to discover the next day, the CubieBoard was down. I assumed it crashed for some reason, and powercycled it. It didn’t come back up. No…. since that moment, I haven’t been able to get it to do anything. No boot from NAND or µSD card, nothing on the serial interface: it’s dead.

So… now it’s about time to replace my 8530w laptop — temporary playing server — with a more permanent solution: my UDROID-U3. I am not going to discuss the entire configuration. I have discussed configuring NFS servers before. However, there are a few things I would like to discuss. I problem I have encountered before: using new nfs-utils versions with older linux kernels. The kernel for the UDROID is 3.8.13.23-3-ARCH, which is rather old.

The problem is, when starting the nfs daemon, it requests the versions on NFS to use from the kernel. Starting at nfs-utils 1.2.9, it will include 4.1 in this request. Older kernels will not recognise this and generate an error. On my Pi, I reverted to nfs-utils 1.2.8, but now, I have a more permanent solution.

The problem:

[root@odroid andre]# systemctl status nfsd
● nfsd.service - NFS Server Daemon
   Loaded: loaded (/usr/lib/systemd/system/nfsd.service; enabled)
   Active: failed (Result: exit-code) since Fri 1999-12-31 18:00:31 MST; 14 years 5 months ago
     Docs: man:rpc.nfsd(8)
  Process: 294 ExecStopPost=/usr/bin/exportfs -a -u (code=exited, status=0/SUCCESS)
  Process: 291 ExecStop=/usr/bin/rpc.nfsd 0 (code=exited, status=0/SUCCESS)
  Process: 260 ExecStartPost=/usr/bin/exportfs -a (code=exited, status=1/FAILURE)
  Process: 233 ExecStart=/usr/bin/rpc.nfsd $NFSD_OPTS $NFSD_COUNT (code=exited, status=0/SUCCESS)
 Main PID: 233 (code=exited, status=0/SUCCESS)

Dec 31 18:00:31 odroid rpc.nfsd[233]: rpc.nfsd: Setting version failed: errno 22 (Invalid argument)
Dec 31 18:00:31 odroid exportfs[260]: exportfs: Failed to stat /srv/nfs4/grassroot: No such file or directory
Dec 31 18:00:31 odroid systemd[1]: nfsd.service: control process exited, code=exited status=1
Dec 31 18:00:31 odroid systemd[1]: Failed to start NFS Server Daemon.
Dec 31 18:00:31 odroid systemd[1]: Unit nfsd.service entered failed state.


Note to audience: I have no battery connected to the RTC, so “Dec 31 18:00:31” is a faulty date before it contacted an NTP server.
Note to self: image has an American default timezone: fix it! timedatectl set-timezone CET

The solution:
The configuration file for the nfs server is /etc/conf.d/nfs-server.conf. When you open time file, you see nothing that would suggest setting a version. No, the file only specifies command line options to nfs daemon. Putting NFSD_OPTS="-V 4" does the trick. You can specify multiple versions by comma separating them, for example NFSD_OPTS="-V 2,3,4", which would enable NFS version 2, 3 and 4.

Wishing everyone a happy midsummer!

From my previous post, you’re been able to read I am trying to cross compile and set up an AVR32 system. I have been trying some things and learning about cross compiling. I realise, last post was written from my notes, and may appear a little messy. I have make some progress, and learned how to do things, and realise I should have dome some things differently then my first attempt.

I have decided to create two kinds of posts for this topic. First will be a how-to guide. Just step-by-step guide to re-create the cross-compiler, the grasshopper root-fs, and possibly what I might create in my next steps. I am trying to set up a distcc based cross compile system, using ArchLinux’ pacman package manager and its package build utility makepkg, which has native distcc support. But it is still a long road before that works.

Apart from that, I will create a separate post with pitfalls. During this project I have come across certain error messages, which, of course, I have asked Google. Therefore I think it’s important to post those errors so it can be found.

Quite a while ago, I bought a Grasshopper. (a.k.a. ICnova AP7000 Base) I bought the thing and never even touched it… until recently. This little board has an AP7000 CPU. It’s architecture is AVR32. Not the most common thing. That’s why I bought it ;)

Well…. I have been playing around with it for the past week, or rather, some preparation to play with it, such as, a cross compiler. Since it’s a less common architecture, there are some oddities to overcome, but let’s begin. I will be using crosstool-ng to build the cross compiler. When building a cross compiler for ARM, it’s just setting the target and build, but for AVR32, the build process is not that straight forwards.

The first thing to encounter is the fact that “config.sub” doesn’t recognise the architecture, and so the build doesn’t even start. A simple “hack”, by replacing the content of “lib/ct-ng.1.19.0/scripts/config.sub” with

#!/bin/bash
echo avr32-unknown-linux-uclibc

The second thing to encounter, upstream binutils has never heard of the AVR32 architecture. Have I mentioned it’s a less common architecture?
Specifically, the Binary File Descriptor library, libbfd, misses the definitions for AVR32. ATMEL provides a
patch against binutils 2.22. It’s not the most recent version… but ok.

GCC also doesn’t know anything about the AVR32 architecture. I have found GCC 4.4.7 at the ATMEL site. There seems to be a binutils 2.23, but that gave compilation errors, so I stuck with 2.22 (at least, for now. I just want a working cross compiler)

The GNU C Library also doesn’t know anything about the AVR32 architecture. I have to use the uClibc C library instead. The crosstool-NG integration isn’t complete, as I need to provide an external configuration file for uClibc. But here I ran into a number of problems as well. First of all. I am using version 0.9.31. I haven’t got a later version to work.

During stage 2 of the C compiler compilation

[ALL  ]    In file included from /home/andre/x-tools-avr32/avr32-unknown-linux-gnu/avr32-unknown-linux-gnu/sysroot/usr/include/bits/uClibc_mutex.h:15,
[ALL  ]                     from /home/andre/x-tools-avr32/avr32-unknown-linux-gnu/avr32-unknown-linux-gnu/sysroot/usr/include/bits/uClibc_stdio.h:107,
[ALL  ]                     from /home/andre/x-tools-avr32/avr32-unknown-linux-gnu/avr32-unknown-linux-gnu/sysroot/usr/include/stdio.h:72,
[ALL  ]                     from /home/andre/cross/bin/.build/src/gcc-custom/libgcc/../gcc/tsystem.h:87,
[ALL  ]                     from /home/andre/cross/bin/.build/src/gcc-custom/libgcc/../gcc/libgcc2.c:29:
[ERROR]    /home/andre/x-tools-avr32/avr32-unknown-linux-gnu/avr32-unknown-linux-gnu/sysroot/usr/include/pthread.h:227: error: expected ')' before '*' token

The default threading implementation is “nptl”, when I set it to “linuxthreads”, the problem is fixed. The next problem:

[ALL  ]    avr32-unknown-linux-uclibc-ranlib libgcov.a
[ALL  ]    # If the gcc directory specifies which extra parts to
[ALL  ]    # build for this target, and the libgcc configuration also
[ALL  ]    # specifies, make sure they match.  This can be removed
[ALL  ]    # when the gcc directory no longer holds libgcc configuration;
[ALL  ]    # it is useful when migrating a target.
[ALL  ]    Configuration mismatch!
[ALL  ]    Extra parts from gcc directory: crtbegin.o crtbeginS.o crtend.o crten
dS.o crti.o crtn.o
[ALL  ]    Extra parts from libgcc: crtbegin.o crtbeginS.o crtbeginT.o crtend.o 
crtendS.o

requires yet another fix in a build script. Actually, I just commented out the part that checked for this configuration mismatch. The file that needs to be patched is “libgcc/Makefile.in” in the GCC files from the ATMEL site. (comment away lines 839-851)

I also ran in some problems with messages like

Error: .size expression with symbol `_init' does not evaluate to a constant
Error: .size expression with symbol `_fini' does not evaluate to a constant

For wich I found a solution here. Even though the solution at the said site is for PowerPC, the solution should apply to all architectures. The solution consists of removing two lines from a file. “.build/src/uClibc-0.9.31/libc/sysdeps/linux/$ARCH/crtn.S”, “.size _init, .-_init” and “.size _fini, .-_fini”.

With those patches, I managed to get a working cross compiler. From there, I was able to cross compile a linux kernel version 3.15. Compiling some other programs like busybox gave a few problems with the uClibc. As I mentioned, I need to feed an uClibc config file to the crosstool-NG. I had to enable certain options to make certain functionally available.

One of the problems I ran into was

loginutils/lib.a(getty.o): In function `getty_main':
getty.c:(.text.getty_main+0x42a): undefined reference to `usleep'

This site mentioned, I need to enable “SuSv3 legacy functions” to enable the build of usleep. As I was at it, I’ve enabled SuSv3 legacy macro’s and SuSv4 legacy functions as well. Just in case anything needs them. Anyhow…. I will stop writing here, as I am running into another subject. I will write more soon, as I have more to tell about the grasshopper, including issues regarding NFS booting. I needed this cross-compiled busybox, which gave me the SuSv3 problem, to use in the NFS root…. so strictly spoken, this last remark belongs in the next post :P