Want to run Java on the Raspberry Pi? Belgium-based Frank Delporte can help. His new book, Getting Started with Java on the Raspberry Pi, is an excellent resource for both professional programmers and makers interested in experimenting and learning at their own pace. In this interview, Delporte talks about the benefits of combining Java and Raspberry Pi, as well as his experiences as a programmer. 

Programming, designing, and writing

Abate: Congratulations on publishing the book, Getting Started with Java on the Raspberry Pi (Elektor 2020). I will ask more about the book in a bit. But first: are you happy to have all the writing and editing behind you now? Or do you enjoy that sort of work? 
 
Delporte: I really love to write as you can see on my blog. But I have to admit a full book was a lot of work. It requires not only the writing itself, but also collecting all the required information, research, setting up experiments, drawing eletronic schemes, doing interviews, re-reading, etc. But the feeling of holding your first finished printed paper book is a once-in-a-lifetime experience which was really worth all the hard work.

Abate: Speaking of your writing and editing work, we featured your home workspace on the Elektor magazine website in May 2020. Are you still working from home due to the COVID-19 situation?
 
Delporte:
The situation is more-or-less back to normal now. I still work at home but not really for Covid. At work, we can keep enough distance, but from time to time, it’s still better to work home so you can focus on a specific task.
 
Getting Started with Java on Raspberry Pi
Delporte's new book.
Abate: You have an interesting background, which includes work as a software developer, technical lead, author, and video editor. Tell us more about yourself. 
 
Delporte:
I’ve always been interested in technology and how things work. I was the kind of kid that opened every coffee machine, radio or whatever device which was broken. I wasn’t able to fix them all, but I learned something new every time! As a teenager I had a radio show on a local station and did some DJing which gave me the possibility to experiment more with electronics.
That’s why I decided to study at a (technical) film school were we learned how film, radio and television are produced, how you calibrate cameras and connect all the devices and recordings together. After I graduated, video production changed a lot when computer editing got introduced, and that’s how I got into programming again when clients wanted their company video on CD-ROM and Internet.

Abate: In your bio, you mention the Commodore 64. Do you remember any of your early experiences with it?

Delporte:
I only had one game on my C64, because I really got more interested in programming. Thanks to Elektor, I found a book (must be around 1987) with an electronics board with eight relays you could control with the C64 and Basic. I used it to control my Lego train and used magnetic switches to detect the position of that train through the joystick ports. That was the first time I managed to combine software and hardware. Nowadays, such a project would be a lot easier (and cheaper) with Arduino or a Raspberry Pi and the many great extension boards.
 
Abate: What were your career goals in 1994 when you left NARAFI Nationaal Radio en Filmtechnisch Instituut in Belgium?

Delporte:
My first job was video editing at a local TV station, and after a few years, I started doing the same as a freelancer. I never had a clear career goal but rolled from job to job and learned new things along the way. That’s how I transformed myself from video editor to multimedia developer building company presentations on DVD and CD-ROM. And when the Internet started taking off, I switched to web development as my customers wanted to share the same information on websites with a content management system. And with that knowledge, I grew into Java development and technical lead doing product development using that technology.

Teaching code

Abate: When did you start organizing CoderDojo sessions? And what sort of courses do you teach?
 
Delporte:
In every company I’ve worked, it has been a challenge to find good technical colleagues. Engineering (and definitely IT) is still a too male environment. To me, engineering is magic. With a few lines of code or a few electronic components, you can build “stuff.” I wondered why kids — who love to build and experiment — suddenly stop doing this and don’t choose a study where they can continue “making things.”

CoderDojo is a free club where volunteers learn children from seven to 18 to experiment with “digital stuff.” We use Scratch (block based programming) for programming, build worlds in Minecraft with JavaScript, control electronics with Arduino, build robots with Lego, and much more. In 2013, I started such a club in Ieper and Roeselare and still lead the one in Ieper —  except now during Corona times, as it is difficult to organize such informal clubs when you have to keep a safe distance and can not gather around a PC with different people. Thanks to CoderDojo and other STEM (Science, Technology, Engineering and Mathematics) initiatives, we see a slow increase in the number of engineer students — boys and girls!
 
Abate: At which point did you realize, “Hey, I’m a good instructor/teacher, and I think I can help others interested in Java”? Or, did a friend or colleague point you in that direction?
 
Delporte:
I like to explain things and strongly believe in “learn by teaching.” That’s what I do at CoderDojo with children, but also with my blog and at work. To fully understand a topic, you must be able to explain it — or vice versa. The articles I write for my blog are always the result of something I want to try out but don’t really know how to do it (yet). During the process of figuring it out, I write down the steps I’ve taken and what worked and didn’t work. That’s how I learn new stuff and can share that knowledge with others.

A focus on Java

Abate: Tell us about your history with Java. Did you first learn it out of curiosity? Or was it for a class? Or for work?
 
Delporte:
When I started developing multimedia applications, I had to learn ActionScript (and even Lingo before that). Later, I changed to C# and SQL for the web applications. As you may now know already, I learn by experimenting. But also from reading books and short (on-line) courses. When I started at Televic Rail in 2010, I joined a team which was already using Java. Switching from C# to Java was very easy. After all these years of programming, I have to say I learn the most from colleagues! Sharing your work with others in presentations, improving the code with pull requests, accepting comments as how you can do things better are all the best ways to learn from others.
 
Since I started experimenting with Java on Raspberry Pi, I got involved in some open-source projects and discussions, and that’s a complete new world to me, where I meet a lot of very bright people who are also willing to share their knowledge and experience. Still every day I’m amazed by the stuff you can learn from these projects and people. You don’t have to contribute code, but you can also join such a project by reviewing pull requests, helping to test or document the code.
 
Abate: Are you anti-Python or anti-C? I assume you aren’t, but I have to ask. 
 
Delporte:
Definitely not! I hate haters. There are no bad programming languages! I once read a quote which says, “The best tool for the job is the one you know the best.” In my case, that’s Java and JavaFX if I want to make an application with a nice user interface. But in my book, I also used Python to control a LED number display and an Arduino with LED strips.
 
For each project, you must make a decision what the best tool, programming language or framework is. And once you’ve decided, go for it! Maybe you’ll realize later you didn’t make the best choice, but at least you will have learned new things. 
 
LED strip
The LED strip setup..

Working with Java on the Raspberry Pi

Abate: You have been blogging about technology since 2007. It looks like your first post about Rapsberry Pi was "Pong on a Raspberry Pi" (December 2017). Can you tell us about your first experiences and projects with RPi? When did you get started with it?
 
Delporte:
When I started with CoderDojo, there were some coaches who already had experience with Arduino and Raspberry Pi. They brought there kits to the club, and I was really amazed of the power of these inexpensive boards and what you can achieve with them combined with small electronic components.
 
I was blogging already for some time, but my first “public” Raspberry Pi-project was indeed this Pong game that we used on some activities of the school of my son. I used Python for the user interface; but I have to be honest, I didn’t like to code it very much. For that kind of application, I really prefer JavaFX for which there is even a very nice gaming framework: FXGL.
 
Abate: Do you have any RPi-based designs or applications running at home or in your workspace?
 
Delporte:
I started with Java on the Raspberry Pi to build a drum booth controller for my son. It’s a touch-screen user interface to control multiple lights with a relay-board and LED strips controlled by Arduino. 
 
Drum booth controller
Installed components.
This way I learned to use serial communication between the two boards and I²C to control the relays. In my book, I extended this further and used a Mosquitto queue to exchange messages between more boards and PCs. 

Abate: What else are you working on these days? New projects, programs, or books?
 
Delporte:
I’m further experimenting with Java on the Raspberry Pi, of course. I wrote some more blog posts on this subject and also experimented with other Java technologies (Quarkus, Spring, GraalVM) and 64-bit operating systems on the board.
 
I also joined the Pi4J-team. Pi4J is a framework and library to combine Java applications with the full power of the GPIOs of the Raspberry Pi. This project was started by Robert Savage, and he was looking for extra team members to bring this project to a new generation which fully supports Java 11+ and the Raspberry Pi 4 with Java modules and an easily extendable architecture. I’m really excited about the second version of this framework, which we hope to release soon.

Abate: Let’s return to the book, Getting Started with Java on the Raspberry Pi. Why did you write it?

Delporte:
When starting the drum booth project, I had to find out how to use Java on the Raspberry Pi, how to install the right version of JavaFX, how to control the GPIO and an Arduino, etc. That’s when I wrote my first article, which was published in MagPi (July 2019, Dutch and French edition).
 
Elektor contacted me and asked if this could be the subject of a book. As I couldn’t find a recent one on this topic and Java had some major changes in the last years, this question really triggered me and the next day I started writing. It took me more than six months and a lot of evening and nights, but I really had fun while writing and experimenting. And, of course, I hope it’s as much fun to read the book and try out the projects that I included.
 
Abate: Do you have any advice for engineers or makers who are thinking about using Java for their Raspberry Pi-based designs?
 
Delporte:
Try it, really! Java is still one of the top programming languages worldwide. Whether you are an experienced Java developer or starting from scratch, there is a lot to learn and experiment when you combine Java with a Raspberry Pi and electronic components.
 
The examples in my book use very cheap parts like LEDs, buttons, LCD, LED number display, etc., so you may already have these available, or find them in any starter kit. All the book examples can be used to combine them to the project of your dreams. The drumbooth controller I made for my son is a combination of multiple of those examples. 
 
Drum booth LED strips
Rainbow effect selected for LED strips.
Abate: What has the feedback been so far?
 
Delporte:
Although Python was the initial language to be used on the Raspberry Pi (yes, that’s where the Pi comes from) and some still believe it’s the only right choice, I got a lot of positive feedback and questions on this topic. I even got the chance to write a post for the Oracle Java Magazine, which got a lot of readers and shares! There is a clear interest in this topic, and the future new generation of Pi4J will make it even easier to build powerful applications.
 
Abate: Is there a programming language that you don’t know that you plan to learn? Any hardware you’re thinking of trying out?
 
Delporte:
Java is not only a programming language, but also a virtual machine which runs the Java code. On this same VM, you can also run Scala, Kotlin and many other languages. So still a lot to explore within this world. For the Pi4J project, I want to extend the example code and documentation website, so I will need to set up multiple small hardware examples and learn a lot of new stuff myself.

Programming success

Abate: Let’s wrap up with your biggest engineering- or programming-related success. Is there a specific project (software or hardware) that stands out? What was difficult about that project? What did you learn?
 
Delporte:
In my job at Televic, we use a combination of Java and embedded programming to connect multiple servers and data sources to bring real-time passenger information to screens on whole sets of trains. Solving this technical challenge and finally walking through a driving train with 100 screens showing the departing trains at the next station with real-time delays and platform changes is very satisfying.
 
The flow needed to bring all this data through unreliable wireless connections (GSM signals aren’t really designed to handle fast driving vehicles) is a real masterpiece of which I’m very proud we could realize with a small team. But I’m equally impressed by the children at CoderDojo who manage to make their first Flappy Bird game in Scratch or blink a LED with Arduino!