GPIO Interrupts Omega2



  • Hi everyone and @administrators

    I was digging and searching for all the posts in this forum about how to enable interruptions in Omega2 GPIOs, however, after much reading and understanding how the Omega2 SDK works, among other things, I was able to understand how to enable interruptions in Omega2, thanks to @Kit-Bishop because without his post this would have been almost impossible not to say impossible.

    I have managed to modify the code of @Kit-Bishop to be able to read and write in the GPIOs of the Omega2, with this also enable PWM and PULSE, the only thing missing are the interruptions, however, for this it is necessary the module "kmod-gpio-irq" which @luz has already modified to work on the Omega2 (https://github.com/OnionIoT/gpio-irq/pull/1), however, this module is not available in the official Omega2 packages, so it can not be installed using "opkg".

    I tried to compile it on my own using the Omega2 SDK following the cross-compilation tutorial (https://docs.onion.io/omega2-docs/cross-compiling.html), then install it using opkg, however it reaches a dead end, because when I compiled it with that SDK the kernel using corresponds to version 4.4.71 , however, the version running the Omega2 is 4.4.46 (as you can see in the image attached) so it can not be installed because of the incompatibility.

    I could try to use kernel 4.4.46 and compile it, however, because of the importance of this module (the interruptions are VERY important) I think it is more feasible to ask the @administrators to add it to the official packages.

    So, @administrators, could you add the package please? This was already done for Omega1 but not for Omega2.

    @Lazar-Demin @onion

    Thank you very much!!

    0_1499452707209_ErrorGPIOIRQ.png



  • @Keitaro While opening the complete setup to build matching kernel modules is definitely something @onion should do (@administrators, @Lazar-Demin, hello again…), there's a ugly workaround for this: you can just force the module to load:

    opkg install --force-depends kmod-gpio-irq_4.4.71\+HEAD-1_mipsel_24k.ipk
    

    This is not without risk - if kernel internals have changed too much between the kernel you are running and the kernel the module has been compiled for, this will crash the system or cause any other undefined behaviour.

    Having said that, the kernel APIs used by kmod-gpio-irq haven't changed between kernels 4.4.46 and 4.4.71, so it should work in this case.



Looks like your connection to Onion Community was lost, please wait while we try to reconnect.