Is it possible to turn off/on 5v GPIO4 Raspberry Pi from software?

  • Install WiringPI addon to get gpio program: plugin.program.wiringPi-8.1.1-RPi2.arm.zip


    Then log off and log in with ssh and use

    Code
    1. # set pin as output
    2. gpio mode 4 out
    3. # set high value
    4. gpio write 4 1
    5. # set low value
    6. gpio write 4 0


    Support my work with small (or big) Paypal donation


    Amlogic devices works better with CoreELEC

    Blu-ray Disc Java menus support - forum thread, Github

    my lamp addon (unofficial/community with limited support)
    my touchscreen support and instructions by Grruhn (now touchscreen addon exists in repository)


  • Install the RPi Tools add-on and you have RPi.GPIO and gpiozero to play with. Google them for more details.

  • I have libreelec 8.1.1 and RPi.GPIO add-on is not in the repo. Can someone point me in the right direction?

    I'm looking to write a couple scripts for fan and status led control, but can't seem to find anything useful in my searches.

    I have an ODROID C2

  • Jayge91, read post above yours (about installing RPi Tools add-on).


    Support my work with small (or big) Paypal donation


    Amlogic devices works better with CoreELEC

    Blu-ray Disc Java menus support - forum thread, Github

    my lamp addon (unofficial/community with limited support)
    my touchscreen support and instructions by Grruhn (now touchscreen addon exists in repository)


  • RPi.GPIO is part of RPi Tools add-on. Install it and you will get required functionality.


    Support my work with small (or big) Paypal donation


    Amlogic devices works better with CoreELEC

    Blu-ray Disc Java menus support - forum thread, Github

    my lamp addon (unofficial/community with limited support)
    my touchscreen support and instructions by Grruhn (now touchscreen addon exists in repository)


  • I m in no way an expert of gpio pins but don't think you can switch pin 4 with a script..that's connected to the pi power supply..so basically you r taking current direct from wall adaptor...

    To control pins 2 and 4 you ll need to use a gpio and a relay or npn transistor...with that script you control the transistor to cut current from pin 4 by disconnecting pin 6 (Ground)

  • I have libreelec 8.1.1 and RPi.GPIO add-on is not in the repo. Can someone point me in the right direction?

    I'm looking to write a couple scripts for fan and status led control, but can't seem to find anything useful in my searches.

    I have an ODROID C2

    Is this what you'r looking for?This is a project using rpi fan control with speed control and rgb led...