Basics

Guides

API Reference

Menu

Basics

Guides

API Reference

Raspberry Pi Guide

Aussom CLI now has support for Raspberry Pi through Raspbian on aarch64. This means that there is a .deb installer just for Raspberry Pi on ARM 64. One key thing to note is that the installer contains the JavaFX Monocle native library. When running Aussom applications, or when packaging app installers, it will use the native Monocle driver to render the JavaFX UI without running a graphics server such as X or Wayland. This is referred to as headless mode, and it's really useful if, say, you want the Raspberry Pi to boot up and run a program that renders directly to an LCD screen. This allows you to package (.deb) your Aussom JavaFX apps so they can be run directly from the Linux frame buffer.

Unless otherwise stated here, the regular Aussom CLI functionality is the same as it is on other platforms such as Linux, macOS and Windows. One caveat: using the Hogan AI model with AGR on Raspberry Pi is very slow and pretty much unusable. The model requires 8 GB of RAM and a modern laptop/desktop processor, and the Raspberry Pi processor is a bit weak for this. The processor strength is the real limitation here. It does work, but it is very slow.

Packaging an Aussom App with Monocle and libglass

When packaging with APAC on a Raspberry Pi, it will already include the libglass .so file, so there is nothing to be done there. You will, however, need to add the following lines to the installer: block of the app's package.yaml to tell the launcher to start the application with these JVM args. Note that if you are using a different frame buffer, adjust the number below.

...
  appArgs: [ ]
  javaOptions:
  - -Dglass.platform=Monocle
  - -Dmonocle.platform=Linux
  - -Dmonocle.screen.fb=/dev/fb0
  - --enable-native-access=ALL-UNNAMED
  - --add-opens=java.base/jdk.internal.module=ALL-UNNAMED
  - --sun-misc-unsafe-memory-access=allow
  linux:
...

The three lines added are the -D ones for glass and monocle.

Raspberry Pi setup for Monocle and libglass

If you want your Aussom JavaFX UI to run in headless mode without X or Wayland, it will; however, input won't work out of the box because the input devices on Raspbian are only accessible to root. What this means is that when you run your Aussom JavaFX application, it will start up and show on the screen, but buttons won't work, and you'll get the following errors in the console.

Udev: Failed to write to /sys/class/input/mice/uevent
      Check that you have permission to access input devices
Udev: Failed to write to /sys/class/input/input5/uevent
      Check that you have permission to access input devices
Udev: Failed to write to /sys/class/input/event5/uevent
      Check that you have permission to access input devices
Udev: Failed to write to /sys/class/input/input3/uevent
      Check that you have permission to access input devices
Udev: Failed to write to /sys/class/input/event3/uevent
      Check that you have permission to access input devices
Udev: Failed to write to /sys/class/input/input1/uevent
      Check that you have permission to access input devices
Udev: Failed to write to /sys/class/input/event1/uevent
      Check that you have permission to access input devices
Udev: Failed to write to /sys/class/input/mouse0/uevent
      Check that you have permission to access input devices
Udev: Failed to write to /sys/class/input/input4/uevent
      Check that you have permission to access input devices
Udev: Failed to write to /sys/class/input/event4/uevent
      Check that you have permission to access input devices
Udev: Failed to write to /sys/class/input/input2/uevent
      Check that you have permission to access input devices
Udev: Failed to write to /sys/class/input/event2/uevent
      Check that you have permission to access input devices
Udev: Failed to write to /sys/class/input/input0/uevent
      Check that you have permission to access input devices
Udev: Failed to write to /sys/class/input/event0/uevent
      Check that you have permission to access input devices

To fix this, we first need to add your current user to the input group.

sudo usermod -a -G input $USER

Next we need to create a new udev rule to allow the input group to use the input devices and to change the permissions on those devices so input can write to them.

Create a new file for editing:

sudo nano /etc/udev/rules.d/99-input.rules

And add the following:

SUBSYSTEM=="input", KERNEL=="event*", GROUP="input", MODE="0660"
SUBSYSTEM=="input", KERNEL=="mice", GROUP="input", MODE="0660"
SUBSYSTEM=="input*", PROGRAM="/bin/sh -c 'chown -R root:input /sys/class/input/*/ && chmod -R 770 /sys/class/input/*/'"

Save and close. Next run the following to reload the rules.

sudo udevadm control --reload-rules
sudo udevadm trigger

Now you should be set, and when you run the application this time you shouldn't get any of those udev input errors in stdout anymore. This only needs to be applied once on the Raspberry Pi and should be good going forward.