pi4j / pi4j-kotlin Goto Github PK
View Code? Open in Web Editor NEWKotlin DSL for Pi4J V2
Home Page: https://pi4j.com/kotlin/
License: Apache License 2.0
Kotlin DSL for Pi4J V2
Home Page: https://pi4j.com/kotlin/
License: Apache License 2.0
Hi,
I have Rpi4 8gb with Java-17.0.11
I can run a hello world remotely in Kotlin but I get the error below when I try to run the CoroutinesExample example from github
[main] INFO com.pi4j.util.Console -
[main] WARN com.pi4j.library.pigpio.impl.PiGpioNativeImpl - PIGPIO ERROR: PI_INIT_FAILED; pigpio initialisation failed
Exception in thread "main" java.lang.reflect.UndeclaredThrowableException
at jdk.proxy1/jdk.proxy1.$Proxy20.create(Unknown Source)
at com.pi4j.context.Context.create(Context.java:317)
at com.pi4j.internal.IOCreator.create(IOCreator.java:58)
at com.pi4j.internal.IOCreator.create(IOCreator.java:106)
at MinimalExampleKt.main(MinimalExample.kt:159)
at MinimalExampleKt.main(MinimalExample.kt)
Caused by: java.lang.reflect.InvocationTargetException
at java.base/jdk.internal.reflect.NativeMethodAccessorImpl.invoke0(Native Method)
at java.base/jdk.internal.reflect.NativeMethodAccessorImpl.invoke(NativeMethodAccessorImpl.java:77)
at java.base/jdk.internal.reflect.DelegatingMethodAccessorImpl.invoke(DelegatingMethodAccessorImpl.java:43)
at java.base/java.lang.reflect.Method.invoke(Method.java:568)
at com.pi4j.provider.impl.ProviderProxyHandler.invoke(ProviderProxyHandler.java:100)
... 6 more
Caused by: com.pi4j.library.pigpio.PiGpioException: PIGPIO ERROR: PI_INIT_FAILED; pigpio initialisation failed
at com.pi4j.library.pigpio.impl.PiGpioBase.validateResult(PiGpioBase.java:265)
at com.pi4j.library.pigpio.impl.PiGpioBase.validateResult(PiGpioBase.java:251)
at com.pi4j.library.pigpio.impl.PiGpioNativeImpl.gpioInitialise(PiGpioNativeImpl.java:98)
at com.pi4j.library.pigpio.PiGpio.initialize(PiGpio.java:159)
at com.pi4j.plugin.pigpio.provider.gpio.digital.PiGpioDigitalInputProviderImpl.create(PiGpioDigitalInputProviderImpl.java:60)
at com.pi4j.plugin.pigpio.provider.gpio.digital.PiGpioDigitalInputProviderImpl.create(PiGpioDigitalInputProviderImpl.java:41)
... 11 more
Process finished with exit code 1
Some users on reddit thought it would be nice to integrate coroutines in the DSL.
I was thinking of introducing a pi4jAsync
sister DSL in which user can call suspended functions.
IMO SPI doesn't need a DSL; IT can be accomplished by using the already-created DSLs. We just should provide a Kotlin example.
https://pi4j.com/documentation/io-examples/spi/
Pi4j doesn't load gpiod when used with this dependencies :
implementation("com.pi4j:pi4j-ktx:2.4.0")
implementation("com.pi4j:pi4j-core:2.6.0")
implementation("com.pi4j:pi4j-plugin-raspberrypi:2.6.0")
implementation("com.pi4j:pi4j-plugin-gpiod:2.6.0")
implementation("com.pi4j:pi4j-library-gpiod:2.6.0")
This seems to always try to load pigpio and tell me that it's not available.
A declarative, efficient, and flexible JavaScript library for building user interfaces.
🖖 Vue.js is a progressive, incrementally-adoptable JavaScript framework for building UI on the web.
TypeScript is a superset of JavaScript that compiles to clean JavaScript output.
An Open Source Machine Learning Framework for Everyone
The Web framework for perfectionists with deadlines.
A PHP framework for web artisans
Bring data to life with SVG, Canvas and HTML. 📊📈🎉
JavaScript (JS) is a lightweight interpreted programming language with first-class functions.
Some thing interesting about web. New door for the world.
A server is a program made to process requests and deliver data to clients.
Machine learning is a way of modeling and interpreting data that allows a piece of software to respond intelligently.
Some thing interesting about visualization, use data art
Some thing interesting about game, make everyone happy.
We are working to build community through open source technology. NB: members must have two-factor auth.
Open source projects and samples from Microsoft.
Google ❤️ Open Source for everyone.
Alibaba Open Source for everyone
Data-Driven Documents codes.
China tencent open source team.