Skip to content
This repository was archived by the owner on Jan 15, 2026. It is now read-only.
Merged
Show file tree
Hide file tree
Changes from all commits
Commits
File filter

Filter by extension

Filter by extension


Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
16 changes: 10 additions & 6 deletions .github/workflows/maven.yml
Original file line number Diff line number Diff line change
Expand Up @@ -11,23 +11,27 @@ on:

jobs:
build:

runs-on: ubuntu-latest

steps:
- uses: actions/checkout@v2
- name: Set up JDK 17
- uses: actions/checkout@v4

- name: Set up JDK 21
uses: actions/setup-java@v1
with:
java-version: 17
java-version: 21

- name: Build with Maven
run: mvn -B package --file pom.xml -DskipTests

- name: Make staging directory
run: mkdir staging

- name: Copy JAR to staging
run: cp target/distribution/* staging
run: cp target/distribution/* staging

- name: Upload
uses: actions/upload-artifact@v2
uses: actions/upload-artifact@v4
with:
name: Package
path: staging
Expand Down
12 changes: 6 additions & 6 deletions src/main/java/com/pi4j/catalog/components/Camera.java
Original file line number Diff line number Diff line change
Expand Up @@ -8,13 +8,13 @@
import com.pi4j.catalog.components.base.Component;

/**
* FHNW implementation of a camera, works with the raspberry-pi v2 camera module and
* FHNW implementation of a camera, works with the raspberry-pi v2 and v3 camera module and
* the Pi4J-Basic-OS image on the raspberry-pi.
* <p>
* Maybe works on other camera-modules too, but is not yet tested.
* <p>
* It uses the libcamera-still and libcamera-vid bash commands. those are pre-installed
* on all raspbian-versions after Buster.
* It uses the rpicam-still and rpicam-vid bash commands. Those are pre-installed
* on all raspbian-versions from Bookworm on.
*/
public class Camera extends Component {
public static PicConfig.Builder newPictureConfigBuilder(){
Expand Down Expand Up @@ -125,7 +125,7 @@ private void init() {
logDebug("initialisation of camera");

ProcessBuilder processBuilder = new ProcessBuilder();
processBuilder.command("bash", "-c", "libcamera-still");
processBuilder.command("bash", "-c", "rpicam-still");

try {
callBash(processBuilder);
Expand Down Expand Up @@ -254,7 +254,7 @@ private PicConfig(Builder builder) {
* @return a string that can be called from the bash
*/
public String asCommand() {
StringBuilder command = new StringBuilder("libcamera-still");
StringBuilder command = new StringBuilder("rpicam-still");
if (useDate) {
command.append(" -o '").append(outputPath).append(LocalDateTime.now()).append(".").append((encoding != null) ? encoding : "jpg").append("'");
} else {
Expand Down Expand Up @@ -407,7 +407,7 @@ private VidConfig(Builder builder) {
* @return a string that can be called from the bash
*/
public String asCommand() {
StringBuilder command = new StringBuilder("libcamera-vid -t " + recordTime);
StringBuilder command = new StringBuilder("rpicam-vid -t " + recordTime);
if (useDate) {
command.append(" -o '").append(outputPath).append(LocalDateTime.now()).append(".").append((encoding != null) ? encoding : "h264").append("'");
} else {
Expand Down
2 changes: 1 addition & 1 deletion src/main/java/com/pi4j/catalog/components/LcdDisplay.java
Original file line number Diff line number Diff line change
Expand Up @@ -202,7 +202,7 @@ public void displayLineOfText(String text, int line, int position) {
for (char character : text.toCharArray()) {
writeCharacter(character);
}
for(int i = 0; i< columns - text.length(); i++){
for(int i = 0; i < columns - text.length() - position; i++){
writeCharacter(' ');
}
}
Expand Down
Loading