Building the application
We provide pre-built binaries for executing the application on x86 / x86-64 / ARMv7 / AArch64 Windows / Mac / Linux systems. There is also a Docker image for easier deployment.
Building manually
In case you wish to build the latest version of the software manually, you will need the build tools for compiling the software.
| Arch | Debian | Alpine | Purpose |
|---|---|---|---|
| git | git | git | Fetch the repository |
| jdk-openjdk | openjdk-25-jdk | openjdk25 | Java runtime |
| maven | maven | maven | Build tool |
| hidapi | libhidapi-dev | hidapi-dev | HID bindings |
| liburing | liburing-dev | liburing-dev | io_uring bindings |
Previous versions (< 3.4) had the following requirements:
| Arch | Debian | Alpine | Purpose |
|---|---|---|---|
| git | git | git | Fetch the repository |
| gcc | build-essential | gcc, libc-dev | Native compilation |
| jdk-openjdk | openjdk-21-jdk | openjdk21 | Java runtime |
| maven | maven | maven | Build tool |
| hidapi | libhidapi-dev | hidapi-dev | HID bindings |
| liburing | liburing-dev | liburing-dev | io_uring bindings |
Then, simply execute the following sequence of commands:
- First, obtain the source code from the official GitLab repository:
git clone https://gitlab.utu.fi/tech/soft/tools/power/powergoblin
- Unlike on many other distros, the Debian policies prevent the configuration of
JAVA_HOME. Thus, the JAVA_HOME variable must be set first on Debian based distros. You can easily test this by printing the contents of the variable in a terminal:
$ export JAVA_HOME=$(readlink -f /usr/bin/java | sed "s:bin/java::")
- Next we will generate a simple jar package with:
mvn package
You can find the resulting jar file from goblin-service/target/fatjar/.
- A whole distribution with integrated Java VM can be built with
jlink. The resulting package can be executing on the same OS / hardware combination without requiring any additional dependencies.
Don't forget the clean command! Otherwise, the classes generated in phase 3) could interfere with the process.
mvn -P jlink clean package
mvn -P jlink -pl goblin-service jlink:jlink
- The next step builds a local Docker image (
powergoblin:latest). Docker images also allow easier deployment. See theDockerfileincluded on the root directory for more details.
docker build -t powergoblin:latest .
Note that many prebuilt drivers are provided in the src directory. So, possibly only the step 4) is required to run the software locally.
We do not currently recommend starting the application with mvn exec:java, because due to some threading issues the process won't shut down properly if stopped with ctrl-c, and needs to be explicitly killed. It will also start hogging the CPU so it has to be killed quickly.
You can also share custom files using the PowerGoblin's builtin web server (create a web/ directory, copy the files there and start PowerGoblin) to share the files outside a container etc.
Related links
- SmartPower (3)
- https://www.hardkernel.com/shop/smartpower-iii/
- https://wiki.odroid.com/accessory/power_supply_battery/smartpower3
- https://forum.odroid.com/viewtopic.php?f=86&t=45176
- https://en.wikipedia.org/wiki/Standard_Commands_for_Programmable_Instruments
- https://github.com/hardkernel/smartpower3
- https://github.com/hardkernel/smartpower3/pull/35
- https://github.com/muehlbau/odroid-smartpower-linux
- https://github.com/gary-rowe/hid4java
- Java libraries
- https://fazecast.github.io/jSerialComm/
- https://github.com/rm5248/JavaSerial
- https://docs.oracle.com/cd/E17802_01/products/products/javacomm/reference/api/javax/comm/package-summary.html
- https://github.com/VirtuContraFurore/jSmartPower3
- https://stackoverflow.com/questions/16726559/configure-minicom-to-use-hardware-flow-control
- Charts
- https://www.wearedevelopers.com/magazine/top-javascript-charting-libraries
- https://www.monterail.com/blog/javascript-libraries-data-visualization
- https://www.w3schools.com/js/js_graphics_chartjs.asp
- https://plotly.com/javascript/
- https://www.chartjs.org/
- https://d3js.org/
- https://dhtmlx.com/docs/products/dhtmlxGantt/
- MQTT
- JPMS
- https://stackoverflow.com/questions/78202128/javafx-21-modular-application-how-to-add-automatics-modules-h2-and-hibernate
- https://www.baeldung.com/executable-jar-with-maven
- https://github.com/dlemmermann/JPackageScriptFX
- https://stackoverflow.com/questions/52215353/javafx-maven-with-moditect-and-java-11
- https://bitbucket.org/Gumara/mavenjavafx/src/moditect/pom.xml
- io_uring
- Syntax highlight
- Modules
- https://developer.mozilla.org/en-US/docs/Web/JavaScript/Guide/Modules
- https://stackoverflow.com/questions/59536593/one-mjs-file-that-works-on-the-browser-and-nodejs-using-native-js-modules
- https://stackoverflow.com/questions/46913851/why-and-when-to-use-default-export-over-named-exports-in-es6-modules
- https://hacks.mozilla.org/2015/08/es6-in-depth-modules/
- https://v8.dev/features/modules
- https://stackoverflow.com/questions/39380512/how-to-use-js-modules-from-non-module-files
- https://gist.github.com/sindresorhus/a39789f98801d908bbc7ff3ecc99d99c
- pdf.js
- Selenium


