Coffee Roaster UI with JavaFX

Posted by

The first version of the UI for the coffee roaster used a web app hosted on the raspberry pi. This allowed me to control the roaster with any device on the network. The main device I used was a cheap tablet mounted on the roaster.

You can find the code for this project on my GitHub.
User interface: https://github.com/AnthonyDipilato/CoffeeRoasterUI
Arduino Code: https://github.com/AnthonyDipilato/CoffeeRoasterArduino

Here is a video of an early test:

Connection issues made it an unreliable, so I decided to switch to a touch screen monitor and control direct from the raspberry pi. I found a 20″ touch screen monitor (Dell E2014T) for $113 on amazon. The monitor was larger than what I was looking for, but it was half the price of smaller monitors.

I used a python script running Tkinter for the UI. I used Tkinter because it was quick and easy.

The python script ran fine and was more reliable than the hosted webapp. But I was limited on the design so I decided to switch to JavaFx.

JavaFx supports CSS so it gives more freedom to the design and I thought it would be fun to learn a new framework. I also found a library for graphic gauges called Medusa. The gauges were perfect for displaying the temperature readings.

To display the temperatures over time I am using the JavaFx line chart.

Oracle stopped bundling JavaFX in their JDK since 8u32. In order to get JavaFX to run on Raspberry Pi you need a precompiled library like Gluon.

I found the easiest way to compile the code to the raspberry pi is to use Netbean’s remote platform.

You need to give permissions for the input devices for the app to work. Appending the following to /etc/udev/rules.d/99-com.rules

SUBSYSTEM=="input" PROGRAM=="/bin/sh -c '\
chmod +666 /sys/class/input/mice/uevent;\
chmod +666 /sys/class/input/event0/uevent;\
chmod +666 /sys/class/input/input0/uevent;\
chmod +666 /sys/class/input/mouse0/uevent\
'"

Due to humidity from being outside for over a year, the 20″ touch screen was becoming inconsistent with registering touches. I decided to switch over to the official raspberry pi 7″ capacitive touch screen.

To avoid the same problem I designed a quick disconnect mount for the raspberry pi and display. I printed the case with Hatchbox wood pla.

     

Because of the reduced size of the screen, I had to remove the line chart and logging options from the UI.

Flame testing with new UI,

 

Video of the UI in use:

Completed