Giter Site home page Giter Site logo

Comments (2)

andreacioni avatar andreacioni commented on August 12, 2024

Hi Brian,

there is not only a problem with permissions. As I said here #8 , I'm having timing issue (causing the same error above: "failed to open gpio X direction file for writing") related to fast Sleep in NewOutput. Increasing it to 1 second solved it and should be safe and quite short.
What do you think?

Cheers

from gpio.

brian-armstrong avatar brian-armstrong commented on August 12, 2024

1 second feels like a while to need to sleep in a library like this. I think it's sort of exposing the limitations of this approach. Ideally we could get notified by the kernel that the file has been exported, but I don't know of a good way of doing that without bringing in inotify, which might be fairly heavyweight for this.

I think the next best solution would be to poll this file fairly aggressively, maybe every 5ms or so. I would feel more comfortable watching it for up to a second if we could spend less time watching it, on average.

Also, are you sure the file mode is causing an issue? It seems weird that the file would export as a different user than the user exporting it. At any rate, I think 0660 would be more appropriate here than 0666.

from gpio.

Related Issues (12)

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.