From c6b051c14f9615240ae7b7a3e9c34329668313f3 Mon Sep 17 00:00:00 2001 From: Frank Delporte Date: Thu, 21 Mar 2024 13:17:25 +0100 Subject: [PATCH] FAT JAR example adjusted for 2.5.1 --- .../minimal-example-application-fatjar.md | 69 +++++++++++-------- 1 file changed, 40 insertions(+), 29 deletions(-) diff --git a/content/getting-started/minimal-example-application-fatjar.md b/content/getting-started/minimal-example-application-fatjar.md index 00ba299a6..64d0453d1 100644 --- a/content/getting-started/minimal-example-application-fatjar.md +++ b/content/getting-started/minimal-example-application-fatjar.md @@ -46,7 +46,7 @@ scp target/pi4j-example-fatjar.jar pi@192.168.0.252://home/pi On the Raspberry Pi open a terminal, or via SSH from your PC, execute this command: ``` -$ sudo java -jar pi4j-example-fatjar.jar +$ java -jar pi4j-example-fatjar.jar [main] INFO com.pi4j.util.Console - @@ -61,13 +61,18 @@ $ sudo java -jar pi4j-example-fatjar.jar [main] INFO com.pi4j.util.Console - [main] INFO com.pi4j.Pi4J - New auto context [main] INFO com.pi4j.Pi4J - New context builder +[main] INFO com.pi4j.runtime.impl.DefaultRuntime - Initializing Pi4J context/runtime... +[main] WARN com.pi4j.runtime.impl.DefaultRuntime - Replacing provider DIGITAL_OUTPUT RaspberryPi Digital Output (GPIO) Provider with priority 0 with provider GpioD Digital Output (GPIO) Provider with higher priority 150 +[main] WARN com.pi4j.runtime.impl.DefaultRuntime - Replacing provider DIGITAL_INPUT RaspberryPi Digital Input (GPIO) Provider with priority 0 with provider GpioD Digital Input (GPIO) Provider with higher priority 150 +[main] INFO com.pi4j.library.gpiod.internal.GpioDContext - Using chip gpiochip0 pinctrl-bcm2711 [main] INFO com.pi4j.platform.impl.DefaultRuntimePlatforms - adding platform to managed platform map [id=raspberrypi; name=RaspberryPi Platform; priority=5; class=com.pi4j.plugin.raspberrypi.platform.RaspberryPiPlatform] +[main] INFO com.pi4j.runtime.impl.DefaultRuntime - Pi4J context/runtime successfully initialized. [main] INFO com.pi4j.util.Console - -------------------- [main] INFO com.pi4j.util.Console - | Pi4J PLATFORMS | [main] INFO com.pi4j.util.Console - -------------------- [main] INFO com.pi4j.util.Console - PLATFORMS: [1] "Pi4J Runtime Platforms" -└─PLATFORM: "RaspberryPi Platform" {raspberrypi} {Pi4J Platform for the RaspberryPi series of products.} + PLATFORM: "RaspberryPi Platform" {raspberrypi} {Pi4J Platform for the RaspberryPi series of products.} [main] INFO com.pi4j.util.Console - [main] INFO com.pi4j.util.Console - --------------------------- [main] INFO com.pi4j.util.Console - | Pi4J DEFAULT PLATFORM | @@ -79,52 +84,58 @@ PLATFORM: "RaspberryPi Platform" {raspberrypi} -├─SPI: [2] -│ ├─PROVIDER: "PiGpio SPI Provider" {pigpio-spi} {com.pi4j.plugin.pigpio.provider.spi.PiGpioSpiProviderImpl} -│ └─PROVIDER: "RaspberryPi SPI Provider" {raspberrypi-spi} {com.pi4j.plugin.raspberrypi.provider.spi.RpiSpiProviderImpl} -├─ANALOG_INPUT: [0] -├─SERIAL: [2] -│ ├─PROVIDER: "PiGpio Serial Provider" {pigpio-serial} {com.pi4j.plugin.pigpio.provider.serial.PiGpioSerialProviderImpl} -│ └─PROVIDER: "RaspberryPi Serial Provider" {raspberrypi-serial} {com.pi4j.plugin.raspberrypi.provider.serial.RpiSerialProviderImpl} -├─DIGITAL_INPUT: [2] -│ ├─PROVIDER: "RaspberryPi Digital Input (GPIO) Provider" {raspberrypi-digital-input} {com.pi4j.plugin.raspberrypi.provider.gpio.digital.RpiDigitalInputProviderImpl} -│ └─PROVIDER: "PiGpio Digital Input (GPIO) Provider" {pigpio-digital-input} {com.pi4j.plugin.pigpio.provider.gpio.digital.PiGpioDigitalInputProviderImpl} -├─I2C: [2] -│ ├─PROVIDER: "RaspberryPi I2C Provider" {raspberrypi-i2c} {com.pi4j.plugin.raspberrypi.provider.i2c.RpiI2CProviderImpl} -│ └─PROVIDER: "PiGpio I2C Provider" {pigpio-i2c} {com.pi4j.plugin.pigpio.provider.i2c.PiGpioI2CProviderImpl} -├─ANALOG_OUTPUT: [0] -├─DIGITAL_OUTPUT: [2] -│ ├─PROVIDER: "RaspberryPi Digital Output (GPIO) Provider" {raspberrypi-digital-output} {com.pi4j.plugin.raspberrypi.provider.gpio.digital.RpiDigitalOutputProviderImpl} -│ └─PROVIDER: "PiGpio Digital Output (GPIO) Provider" {pigpio-digital-output} {com.pi4j.plugin.pigpio.provider.gpio.digital.PiGpioDigitalOutputProviderImpl} -└─PWM: [2] - ├─PROVIDER: "RaspberryPi PWM Provider" {raspberrypi-pwm} {com.pi4j.plugin.raspberrypi.provider.pwm.RpiPwmProviderImpl} - └─PROVIDER: "PiGpio PWM Provider" {pigpio-pwm} {com.pi4j.plugin.pigpio.provider.pwm.PiGpioPwmProviderImpl} +PROVIDERS: [6] "I/O Providers" + DIGITAL_INPUT: [1] + PROVIDER: "GpioD Digital Input (GPIO) Provider" {gpiod-digital-input} {com.pi4j.plugin.gpiod.provider.gpio.digital.GpioDDigitalInputProviderImpl} + SERIAL: [1] + PROVIDER: "RaspberryPi Serial Provider" {raspberrypi-serial} {com.pi4j.plugin.raspberrypi.provider.serial.RpiSerialProviderImpl} + I2C: [1] + PROVIDER: "RaspberryPi I2C Provider" {raspberrypi-i2c} {com.pi4j.plugin.raspberrypi.provider.i2c.RpiI2CProviderImpl} + DIGITAL_OUTPUT: [1] + PROVIDER: "GpioD Digital Output (GPIO) Provider" {gpiod-digital-output} {com.pi4j.plugin.gpiod.provider.gpio.digital.GpioDDigitalOutputProviderImpl} + SPI: [1] + PROVIDER: "RaspberryPi SPI Provider" {raspberrypi-spi} {com.pi4j.plugin.raspberrypi.provider.spi.RpiSpiProviderImpl} + ANALOG_OUTPUT: [0] + ANALOG_INPUT: [0] + PWM: [1] + PROVIDER: "RaspberryPi PWM Provider" {raspberrypi-pwm} {com.pi4j.plugin.raspberrypi.provider.pwm.RpiPwmProviderImpl} [main] INFO com.pi4j.util.Console - [main] INFO com.pi4j.util.Console - ------------------- [main] INFO com.pi4j.util.Console - | Pi4J REGISTRY | [main] INFO com.pi4j.util.Console - ------------------- [main] INFO com.pi4j.util.Console - REGISTRY: [2] "I/O Registered Instances" -├─IO: "LED Flasher" {led} {DOUT-22} -└─IO: "Press button" {button} {DIN-24} + IO: "Press button" {button} {DIN-24} + IO: "DOUT-22" {DOUT-22} {DOUT-22} [main] INFO com.pi4j.util.Console - [main] INFO com.pi4j.util.Console - LED high [main] INFO com.pi4j.util.Console - LED low [main] INFO com.pi4j.util.Console - LED high [main] INFO com.pi4j.util.Console - LED low +[Pi4J.RUNTIME-1] INFO com.pi4j.util.Console - Button was pressed for the 1th time [main] INFO com.pi4j.util.Console - LED high -... +[main] INFO com.pi4j.util.Console - LED low +[main] INFO com.pi4j.util.Console - LED high +[main] INFO com.pi4j.util.Console - LED low +[Pi4J.RUNTIME-1] INFO com.pi4j.util.Console - Button was pressed for the 2th time +[main] INFO com.pi4j.util.Console - LED high +[main] INFO com.pi4j.util.Console - LED low +[main] INFO com.pi4j.util.Console - LED high +[main] INFO com.pi4j.util.Console - LED low [main] INFO com.pi4j.util.Console - LED high -[Thread-1] INFO com.pi4j.util.Console - Button was pressed for the 1th time +[Pi4J.RUNTIME-1] INFO com.pi4j.util.Console - Button was pressed for the 3th time [main] INFO com.pi4j.util.Console - LED low [main] INFO com.pi4j.util.Console - LED high [main] INFO com.pi4j.util.Console - LED low +[Pi4J.RUNTIME-1] INFO com.pi4j.util.Console - Button was pressed for the 4th time [main] INFO com.pi4j.util.Console - LED high [main] INFO com.pi4j.util.Console - LED low [main] INFO com.pi4j.util.Console - LED high -[Thread-3] INFO com.pi4j.util.Console - Button was pressed for the 2th time [main] INFO com.pi4j.util.Console - LED low [main] INFO com.pi4j.util.Console - LED high -... +[Pi4J.RUNTIME-1] INFO com.pi4j.util.Console - Button was pressed for the 5th time +[main] INFO com.pi4j.runtime.impl.DefaultRuntime - Shutting down Pi4J context/runtime... +[main] INFO com.pi4j.plugin.gpiod.provider.gpio.digital.GpioDDigitalInput - Shutdown input listener for button +[main] INFO com.pi4j.util.ExecutorPool - Shutting down executor pool Pi4J.RUNTIME +[main] INFO com.pi4j.runtime.impl.DefaultRuntime - Pi4J context/runtime successfully shutdown. Dispatching shutdown event. ``` \ No newline at end of file