Klipper3d / klipper

Klipper is a 3d-printer firmware
GNU General Public License v3.0
9k stars 5.18k forks source link

Linux: Add Using gpio with wiringPi #6355

Closed how2flow closed 7 months ago

how2flow commented 9 months ago

Addition of gpio control scheme.

in a wirringPi-enabled environment, Add Using wirringPi Option.

Rather than requesting R/W through ioctl Expect more performance improvement with direct access through wiringPi's memory mapping(mmap).

KevinOConnor commented 9 months ago

Thanks. I don't know much about wiringPi, but when I did a web search it did not appear to have a GPL compatible license. As such, I don't think it is a good fit for Klipper (which is GNU GPLv3).

Maybe I am missing something though.

-Kevin

Sineos commented 9 months ago

it did not appear to have a GPL compatible license

Isn't GNU Lesser Public License v3 compatible to GPL (thought it is more permissive even). See http://wiringpi.com/download-and-install/ at the end of the page and https://github.com/WiringPi/WiringPi

FWIW, I cannot much contribute to the usefulness of it in the context of Klipper, but it is IMO one of the best solutions for serious GPIO work with the RPi. I'm using it for some home automation stuff.

Unfortunately, it is no longer actively developed except some minor stuff under the above mention GH project. Sad to say, but I doubt that it is a sustainable solution.

how2flow commented 9 months ago

Unfortunately, it is no longer actively developed except some minor stuff under the above mention GH project. Sad to say, but I doubt that it is a sustainable solution.

I also take this part the most, but in controlling gpio, "wiringPi" uses mmap to read/write values directly to the register. That's why there doesn't seem to be a need to update the code to improve performance or add functionality.

I think the packages that have been used for a long time(It's still used by many users), and wiringPi support products, like RPi/Odroids, will be updated with new revisions whenever new boards are released. (In the case of Odroids, I'm updating it myself.. https://github.com/hardkernel/wiringPi)

+) I don't think there's a big problem with the license. LGPL3 is compatible with GPL3

But if you don't think it fits the direction of the klipper, just think that there is a method like this. There was no error in the running, and I'm enjoying printing by applying this code in my local :)

KevinOConnor commented 9 months ago

Thanks. LGPL is fine. I guess my confusion is that the first paragraph at wiringpi.com states that the source code is not publicly available (specifically, The source code is not publicly available but may be made available to those who wish commercial support.).

If someone can point me to the actual code for wiringpi (it would seem wiringpi.com is not the actual location for it) then I can take another look.

Cheers, -Kevin

Sineos commented 9 months ago

It is my understanding the source was once published under https://git.drogon.net/ but no longer is since the official maintainer stopped. The closest thing left is https://github.com/WiringPi/WiringPi

github-actions[bot] commented 8 months ago

Thank you for your contribution to Klipper. Unfortunately, a reviewer has not assigned themselves to this GitHub Pull Request. All Pull Requests are reviewed before merging, and a reviewer will need to volunteer. Further information is available at: https://www.klipper3d.org/CONTRIBUTING.html

There are some steps that you can take now:

  1. Perform a self-review of your Pull Request by following the steps at: https://www.klipper3d.org/CONTRIBUTING.html#what-to-expect-in-a-review If you have completed a self-review, be sure to state the results of that self-review explicitly in the Pull Request comments. A reviewer is more likely to participate if the bulk of a review has already been completed.
  2. Consider opening a topic on the Klipper Discourse server to discuss this work. The Discourse server is a good place to discuss development ideas and to engage users interested in testing. Reviewers are more likely to prioritize Pull Requests with an active community of users.
  3. Consider helping out reviewers by reviewing other Klipper Pull Requests. Taking the time to perform a careful and detailed review of others work is appreciated. Regular contributors are more likely to prioritize the contributions of other regular contributors.

Unfortunately, if a reviewer does not assign themselves to this GitHub Pull Request then it will be automatically closed. If this happens, then it is a good idea to move further discussion to the Klipper Discourse server. Reviewers can reach out on that forum to let you know if they are interested and when they are available.

Best regards, ~ Your friendly GitIssueBot

PS: I'm just an automated script, not a human being.

KevinOConnor commented 8 months ago

Thanks. If the upstream is now https://github.com/WiringPi/WiringPi then that is fine (as that repo appears to be LGPL-v3). I'll continue with a review if the original submitter can confirm that I should continue.

-Kevin

how2flow commented 8 months ago

I think this solution is very nice.

But since the official development has stopped, Raspberry Pi's new RPi5 model may not be compatible. (It's possible if the user ports it separately locally..) Of course, I'm an Odroid wiringpi package manager, so I do keep updating this side.

I think add descript like it's only supported up to Raspberry Pie 4, Or, If I have time, I can port wiringpi to RPi5 in my repo, and give you a guide.

All of this is possible because I gave the use of wiringpi as an option in this commit.

Thanks, Have a nice day

Sineos commented 8 months ago

Interesting: https://github.com/WiringPi/WiringPi/issues/186

While I agree that an advanced GPIO manipulation library may have its merits, I think WiringPi is not a future-proof choice.

Maybe, as also mentioned in the above thread: https://github.com/joan2937/lg

thijstriemstra commented 8 months ago

I think WiringPi is not a future-proof choice.

Agreed. Someone will have to maintain this new code @how2flow..

github-actions[bot] commented 7 months ago

Unfortunately a reviewer has not assigned themselves to this GitHub Pull Request and it is therefore being closed. It is a good idea to move further discussion to the Klipper Discourse server. Reviewers can reach out on that forum to let you know if they are interested and when they are available.

Best regards, ~ Your friendly GitIssueBot

PS: I'm just an automated script, not a human being.