Yet more on GPIO interrupts
@Boken-Lin A few days ago, you said: We will definitely add the patch into our buildroot so that the next update will have the irq support built-in.
This is NOT meant to be a complaint or hurry up, but do you have any rough idea when the updated with GPIO irq support as per the patch will be available?
The reason I ask is that I have now got some significant C/C++ code (as an extension to the new-gpio code I posted some time ago) that from my testing appears to work well in handling GPIO interrupts.
This includes a test program that in a very simple manner can be used to set a background program running that, on an interrupt (e.g. a button press), will run any shell command specified at the time the program was started. Thus allowing running of any command to be associated with a button push - multiple such instances can be set up - one for each GPIO pin if so desired.
However, this code is dependent upon:
- A kernel version with the above patch
- Installation of the kmod-gpio-irq package
I would like to post this code since I believe it would be of general use, but there is no point in doing so until the update is generally available.
@Kit-Bishop We will be putting out a new firmware today. :)
@Boken-Lin Great :-) Thanks. Didn't mean to give you a hard time over this.
Hi @Kit-Bishop, if you do an
oupgradenow, you should be able to upgrade to a firmware with the patches applied. Please let me know if it works.
@Boken-Lin Unfortunately, no it doesn't seem to work after a clean update to the latest release.
The first issue is that there is no kmod-gpio-irq that I require - it is not available via opkg even after doing an opkg update - so I tried installing the version I had built using the OpenWrt cross compile environment (and which worked with the patched system image I had built and installed).
I think i have tracked the problem down to the fact that there is no /sys/kernel/debug/gpio-irq file. The GPIO irq handling works by writing to this file.
I am trying to track down what I had installed in my separately compiled image that would have created this file.
If you have any info on this, I would be interested to hear. meanwhile, I will try to keep working to track down what is different between the latest Omega build (for which GPIO irq does not work) and the system build that I produced (for which GPIO irq works)
@Boken-Lin Thanks. Would be good if it was as simple as not having included the patch (it's this one: https://github.com/GBert/openwrt-misc/blob/master/gpio-test/src/patches-3.18/739-MIPS-ath79-add-gpio-irq-support.patch).
Though, it will be essential also that kmod-gpio-irq be available via opkg as well.
I'm probably about to take a break (it's getting to be evening here) - if I don't here anything more from you on this, I will keep looking tomorrow.
hey @Kit-Bishop firmware b265 and later have kmod-gpio-irq and the gpio.c patch.
I installed and ran
gpio-testlocally, the edge based interrupts do in fact get triggered!
Btw, I made the
gpio-testpackage available in the Onion package repo.
@Lazar-Demin Cool :-) Thanks for quick feedback :-)
I am currently on firmware b264 so will shortly upgrade and try again. Will report back when done
@Lazar-Demin Absolutely fantastic! Thank you very much :-)
Have upgraded to b266 and everything works perfectly - including my GPIO IRQ and test program.
My IRQ code is basically an extension to the code I have previously posted for new GPIO access (https://community.onion.io/topic/143/alternative-c-code-for-gpio-access) with the addition of IRQ handling capabilities.
Because it may be of use to others, I will do the following:
- Send the test program and needed library with some basic documentation on its use in a separate post
- Later, update the package and details in https://community.onion.io/topic/143/alternative-c-code-for-gpio-access with the latest sources and full documentation