Code Monkey home page Code Monkey logo

Comments (15)

neuberfran avatar neuberfran commented on August 18, 2024 3

@FDelporte Tks
https://www.youtube.com/watch?v=YpFe7AQj29o

  1. I am interested in learning more about Cli commands:
    sdk install gradle, sdk install kotlin and gradle run
  2. I heard that Kotlin's LSP is purposely bad (jetbrains wants to protect its IDE). So it would be bad to use neovim/vscode/kotlin

from pi4j-kotlin.

FDelporte avatar FDelporte commented on August 18, 2024 1

Did you use this Kotlin DSL? https://www.pi4j.com/kotlin/
@mhashim6 the DSL probably needs an update to newer Pi4J dependencies...

from pi4j-kotlin.

mhashim6 avatar mhashim6 commented on August 18, 2024 1

Thanks for reporting this. Will investigate and make a fix/ release

from pi4j-kotlin.

FDelporte avatar FDelporte commented on August 18, 2024 1

Success! ;-)

What I did

  • checkout this project on a RPi 5
  • with sdkman: sdk install gradle and sdk install kotlin
  • opened directory in visual studio code and installed kotlin and gradle extensions
  • change dependencies in the project to Pi4J 2.6.0 and slf4j 2.0.12
  • added the new plugin dependency com.pi4j:pi4j-plugin-gpiod
  • in the code, removed the 'piGpioProvider()' because v2.6 of Pi4J automatically loads the provider which is best for the version of the RPi Pi4J is running on
  • start the test app with Gradle run
kotlin-pi4j.mp4

from pi4j-kotlin.

mhashim6 avatar mhashim6 commented on August 18, 2024 1

@mhashim6 we have a V2.6.1 ready for release, so that would require a new update of this Kotlin library. Maybe we should wait a bit till this is released?

It should be no problem, right now I'm working on fixing the tests as some mocks have become now interfaces instead of classes in 2.6.0 :)

I would not release 2.6.0, will wait for your signal.

from pi4j-kotlin.

FDelporte avatar FDelporte commented on August 18, 2024 1

Thanks, I just commited some fixes for unit tests and moved library version definition to the root level...

from pi4j-kotlin.

FDelporte avatar FDelporte commented on August 18, 2024 1

I'm happy you also got it working!

  1. SDKMAN: https://foojay.io/today/installing-java-with-sdkman-on-raspberry-pi/
  2. I don't know about that, but this was the first time I tried out Kotlin in VSC myself and found it very easy.

from pi4j-kotlin.

neuberfran avatar neuberfran commented on August 18, 2024

@FDelporte

from pi4j-kotlin.

FDelporte avatar FDelporte commented on August 18, 2024

Should not be related to the Java version, I even use Java 22 with Pi4J...

from pi4j-kotlin.

neuberfran avatar neuberfran commented on August 18, 2024

@FDelporte

implementation("com.pi4j:pi4j-ktx:2.4.0") // Kotlin DSL
implementation("com.pi4j:pi4j-core:2.3.0")
implementation("com.pi4j:pi4j-plugin-raspberrypi:2.3.0")
implementation("com.pi4j:pi4j-plugin-pigpio:2.3.0")

I put all these things in every build.gradle.kts I found in the package I pulled from github and I still get the errors

  1. In the future I will have to add things from Firestore, as I am migrating the Android Things project to here. I hope I have more luck
    Tks for everything

from pi4j-kotlin.

mhashim6 avatar mhashim6 commented on August 18, 2024

@FDelporte really appreciate it. I'm publishing the release rn.

Apologies I didn't have the time

from pi4j-kotlin.

FDelporte avatar FDelporte commented on August 18, 2024

@mhashim6 no problem! this is a pet project for all of us :-)
not sure if the Kotlin plugin itself needs more updates, can you do a quick check please?

from pi4j-kotlin.

FDelporte avatar FDelporte commented on August 18, 2024

@mhashim6 we have a V2.6.1 ready for release, so that would require a new update of this Kotlin library. Maybe we should wait a bit till this is released?

from pi4j-kotlin.

mhashim6 avatar mhashim6 commented on August 18, 2024

Thanks, I just commited some fixes for unit tests and moved library version definition to the root level...

@FDelporte I'm curious why is the AutoContext not automatically detecting mocks? Even though it seems to auto pick other platforms/ providers like the gpiod

from pi4j-kotlin.

FDelporte avatar FDelporte commented on August 18, 2024

@eitch @taartspi good remark above by @mhashim6. Indeed AutoContext on non-RPi indeed seems not to load the Mock. Can this be forced are what was the approach envisioned with the recently introduced priorities?

from pi4j-kotlin.

Related Issues (6)

Recommend Projects

  • React photo React

    A declarative, efficient, and flexible JavaScript library for building user interfaces.

  • Vue.js photo Vue.js

    šŸ–– Vue.js is a progressive, incrementally-adoptable JavaScript framework for building UI on the web.

  • Typescript photo Typescript

    TypeScript is a superset of JavaScript that compiles to clean JavaScript output.

  • TensorFlow photo TensorFlow

    An Open Source Machine Learning Framework for Everyone

  • Django photo Django

    The Web framework for perfectionists with deadlines.

  • D3 photo D3

    Bring data to life with SVG, Canvas and HTML. šŸ“ŠšŸ“ˆšŸŽ‰

Recommend Topics

  • javascript

    JavaScript (JS) is a lightweight interpreted programming language with first-class functions.

  • web

    Some thing interesting about web. New door for the world.

  • server

    A server is a program made to process requests and deliver data to clients.

  • Machine learning

    Machine learning is a way of modeling and interpreting data that allows a piece of software to respond intelligently.

  • Game

    Some thing interesting about game, make everyone happy.

Recommend Org

  • Facebook photo Facebook

    We are working to build community through open source technology. NB: members must have two-factor auth.

  • Microsoft photo Microsoft

    Open source projects and samples from Microsoft.

  • Google photo Google

    Google ā¤ļø Open Source for everyone.

  • D3 photo D3

    Data-Driven Documents codes.