Page 1 of 1

RevPi Compact controlling digital output with libgpiod issue

Posted: 30 Jul 2021, 15:31
by Asadxtr
We're trying to set the gpio pin to high, but it won't go to high when we actually go to measure on the digital output pin. The digital output led flashes only briefly though.
Using the following code in the terminal:

Code: Select all

sudo chrt -f 48 gpioset gpiochip3 0=1
gpioget gpiochip3 0
When we try to readout pin 0 it actually says it's high ('1') and led briefly flashes, but when we read it out with multimeter it's still at 0V.

Then when we try with the following code, we get ~3.3V on the digital output pin when reading it out with multimeter and the leds keep flashing briefly on the RevPi:

Code: Select all

while true; do sudo chrt -f 48 gpioset gpiochip3 0=1; done
What is causing this ( is it the watchdog still?) and how can this problem be solved?
Thanks.

Re: RevPi Compact controlling digital output with libgpiod issue

Posted: 03 Aug 2021, 09:52
by dirk
Here is the answer to your question in our knowledge base:

RevPi Compact FAQ
https://kunbus-gmbh.atlassian.net/servi ... 2197684239

Search for “I want to set a GPIO pin high and I don't use piControl. Why does the pin always go low?”

You just have to register with your E-Mail address to access it.
The registration page is currently in German language only so here is a short animation how it works:

Re: RevPi Compact controlling digital output with libgpiod issue

Posted: 03 Aug 2021, 10:48
by Asadxtr
Thank you for your reply Dirk,

I have already read this on your website, but how can this be solved concretely?
I already tried prepending the program command by "chrt -f 48" but that didn't help.

Can the watchdog be configured someway to prevent this issue and if so how can this be done please?
What other solutions are there to this problem?
On the website, it says that the output has to be rewritten every 9 ms, but I don't know how to do that if other code has to run simultaneously in C code.

We've been struggling with this for quite some time now, this shouldn't be so difficult to implement.