Close

Back to the Drawing Board

A project log for Tide Clock

Raspberry PI 3 and a 1280x800 HDMI Screen that will run a JavaFX application to display the Time, Tide and Weather forecast.

thomas-snowThomas Snow 11/29/2017 at 20:110 Comments

Faced with the prospect that Chromium could not render animation smoothly enough, I had to go back to the drawing board.  I was worried that I would have to write this app as an X Windows application.  I didn't have a development environment to easily develop one.  Luckily, my research into how to get better animation performance in HTML5 led me to thinking about Java.  That led to the discovery of JavaFX.  It's a library of Java objects that can take advantage of the hardware acceleration of many graphics systems to perform animation.  It's model was very HTML/XML-ish in nature, so it was easy to lay out things.  Using Java also took advantage of all of the Java code I wrote to support the web page via JSP.  So I whipped up a Proof of Concept that had everything but the clock (the clock was going to be tough).  This gave me an app with two scrolling panels.  Things were looking good!

New Software Motto:  Be wary when things look good.

I loaded the code into the Pi and viola!, it couldn't find the JavaFX libraries in the Java 8 SDK.  It turns out that Oracle stopped supporting JavaFX on ARM platforms in Java 1.8.33u and naturally, I had a newer version. 

More research found this page (God bless Stackoverflow!).  It describes a way to get a version of it.  I could only get the second answer to work:

So things were looking good, right?

No, see New Software Motto above.

It turns out that JavaFX is all bare metal.  It wants exclusive access to the video driver.  Since X Windows is using it, you can't run a JavaFX app in Xwin.  So I disabled X Windows and put the Pi into terminal only mode.

Still no Joy.  JavaFX is picky about the driver settings.  In the end I had to futz with the /boot/config.txt file.  I eventually found this setting worked:

# turn off lightning bolt
avoid_warnings=1
#dtoverlay=vc4-kms-v3d
#dtoverlay=vc4-fkms-v3d
gpu_mem=256

Discussions