https://github.com/fdelporte/pi4j-example-minimal-crac
Minimal Pi4J Example Application using CRaC
https://github.com/fdelporte/pi4j-example-minimal-crac
Last synced: 3 months ago
JSON representation
Minimal Pi4J Example Application using CRaC
- Host: GitHub
- URL: https://github.com/fdelporte/pi4j-example-minimal-crac
- Owner: FDelporte
- License: apache-2.0
- Created: 2023-10-16T13:51:42.000Z (over 1 year ago)
- Default Branch: main
- Last Pushed: 2023-10-17T09:45:38.000Z (over 1 year ago)
- Last Synced: 2025-01-13T13:31:35.301Z (4 months ago)
- Language: Java
- Size: 28.3 KB
- Stars: 0
- Watchers: 1
- Forks: 0
- Open Issues: 0
-
Metadata Files:
- Readme: README.md
- License: LICENSE
Awesome Lists containing this project
README
Minimal Pi4J Example Application Using CRaC
===========================================This project is based on [github.com/Pi4J/pi4j-example-minimal](https://github.com/Pi4J/pi4j-example-minimal) to experiment with the use of [CRaC](https://docs.azul.com/core/crac/crac-introduction) combined with Pi4J. It builds a FAT JAR as explained on [Build as a FAT JAR with Maven](https://pi4j.com/documentation/building/fat-jar/).
## Requirements
As described on the blog post [Running a CRaC Java application on Raspberry Pi - UPDATE](https://webtechie.be/post/2023-10-16-crac-on-raspberry-pi-update/).
* Raspberry Pi OS, 64-bit, Bookworm edition, released on October 11, 2023.
* Azul Zulu Builds of OpenJDK, version 17 or 21 with CRaC:
* `17.0.8.crac-zulu`
* `21.crac-zulu`
* or newer## Run with CRaC on Raspberry Pi
### Get the Project
```bash
$ git clone https://github.com/FDelporte/pi4j-example-minimal-crac.git
$ cd pi4j-example-minimal-crac
```### Build and Initial Run
#### First Terminal
This Pi4J application needs to be executed as sudo to have the needed privileges to interact with the GPIOs.
```bash
$ mvn package
$ sudo `which java` -XX:CRaCCheckpointTo=cr -jar target/pi4j-crac.jar
```#### Second Terminal
```bash
$ sudo `which jcmd` target/pi4j-crac.jar JDK.checkpoint
```### Start From Snapshot