Cannot set GPIO value through Linux console

Discussion in 'Troubleshooting' started by udooquestions, May 29, 2014.

  1. udooquestions

    udooquestions New Member

    Joined:
    Apr 7, 2014
    Messages:
    7
    Likes Received:
    0
    I've been following this guide:

    http://www.udoo.org/ProjectsAndTutorial ... ipulation/

    trying to change the value of a GPIO from the default '0' to a '1'.

    I can set the direction (to 'out'), but when I try to set '1' into /value it always remains at '1', even if I manually edit the file with nano.

    What am I missing?
     
  2. andcmp

    andcmp New Member

    Joined:
    May 8, 2013
    Messages:
    161
    Likes Received:
    0
    Hi udooquestions, what OS are you running? Which UDOO do you have? Please share as much info as you can.
    See your statement in bold, what do you mean exactly?

    Thanks
     
  3. udooquestions

    udooquestions New Member

    Joined:
    Apr 7, 2014
    Messages:
    7
    Likes Received:
    0
    Hi.

    Board: UDOO Quad
    OS: Linaro Ubuntu 12.04 LTS

    > I can set the direction (to 'out'), but when I try to set '1' into /value it always remains at '1', even if I manually edit the file with nano.

    Even if I manually edit the 'value' file of the IO to be '1' with nano and save, and then look at the file it remains at '0' (sorry for being confusing originally!) Setting the 'direction' file works as expected, btw.

    That indicates to me that something prevents the settings to be changed.

    Any help would be appreciticted!
     
  4. jozefjozef

    jozefjozef New Member

    Joined:
    Jun 9, 2014
    Messages:
    3
    Likes Received:
    0
    I have same problem with Arch Linux ARM - linux-armv7 kernel. If i use 3.0.35-9-ARCH, everything works.
     
  5. jmarsico

    jmarsico New Member

    Joined:
    Jun 17, 2014
    Messages:
    1
    Likes Received:
    0
    This is happening to me as well.

    lubuntu "udoobuntu"
    ubuntuoo quad.
     
  6. delba

    delba Administrator Staff Member

    Joined:
    May 8, 2013
    Messages:
    1,064
    Likes Received:
    9
    As you said, f you set the GPIO in output mode you can set the voltage high or low using echo 1 > /sys/class/gpio/gpio40/value or echo 0 > /sys/class/gpio/gpio40/value but if you try to read the value from terminal using cat /sys/class/gpio/gpio40/value the value you read is casual because you're in output mode which means you cannot read.

    So: in output mode you CAN set the value but you CANNOT read the value because there is an inconsistency between pin and file state (see this thread: can-write-gpio-value-from-terminal-t1340.html)
     
  7. sarat.j

    sarat.j New Member

    Joined:
    Jul 1, 2014
    Messages:
    2
    Likes Received:
    0
    I am using cat/sys/class/gpio/gpio40/value command to see the value of output pin but it shows 0 when input is high. I am not facing this problem while using raspberry pi. Can anyone help me in solving this problem.
     
  8. NeverCast

    NeverCast New Member

    Joined:
    Nov 1, 2013
    Messages:
    3
    Likes Received:
    0
    Sorry for the late reply, a friend and I were messing with Arch Linux on the UDOO and we had this same issue. It was due to us mainlining our kernel. By switching over to the older linux kernel the GPIO was restored to function.

    pacman -Syu linux-udoo

    Hopefully this helps.
    This will downgrade your kernel as of this post date 2014-08-30. So some packages and software you've installed could cause boot issues or suffer performance.
     

Share This Page