Code Monkey home page Code Monkey logo

Comments (4)

fivdi avatar fivdi commented on May 20, 2024

Is the following the case:

  • The program is creating a Gpio object where the direction is "output" and the edge is "rising", "falling", or "both".
  • Linux kernel > 3.13 is being used.

dmesg may also be displaying messages similar to these:

[ 1180.184658] GPIO chip pinctrl-bcm2835: gpio_lock_as_irq: tried to flag a GPIO set as output for IRQ
[ 1180.184688] gpio-17 (sysfs): failed to flag the GPIO for IRQ

If this is the case, then the error is explained by the fact that the Linux 3.13 kernel dropped support for detecting changes on GPIO output pins per hardware interrupt. It can still detect interrupts on input pins.

This is documented in the onoff readme here :).

See also raspberrypi/linux#808 and torvalds/linux@d468bf9

from onoff.

joraff avatar joraff commented on May 20, 2024

That's precisely it: new Gpio(4, 'out', 'falling'); What a bummer. Would an acceptable workaround be to initialize as an input, then switch to an output if I need to drive it?

from onoff.

fivdi avatar fivdi commented on May 20, 2024

Given that I have no information about the circuit you're building, I don't know. If everything is electrically ok, the setEdge and setDirection methods could probably be used to handle the software side of things.

from onoff.

joraff avatar joraff commented on May 20, 2024

Electrically everything is fine - it was working on a RPi model B+ before I upgraded to RPi 2. I was most likely using an older version of raspbian.

from onoff.

Related Issues (20)

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.