How to use Banana PI BPI-R2's GPIO-s

you connected it wrong :slight_smile:

pin1 is the one with small arrow on board near the mpcie slot

1 Like

I wrote before that I had to be missing something. Pin1 marking on the board - classic. Thanks a lot! Would be draining my head, before/if I’d found out much later.

image

Looks like working now :slight_smile:

Yes, it does. Thanks again:

image

Great. You do not need to run it as root…just put a user in the same group (in my case “i2c” as the device).

I know, don’t worry. It will be accessible through cgi and snmp, so I’ll make sure it won’t run with elevated access rights.

Sorry for reviving old post again, but I am still playing with general GPIO, and I don’t get one thing: While I do understand the offset, I am unable to turn pin up.

Scenario: I am using a mosfet gate to switch over 12V supply (which goes through transformer to 5V) for fans. But I do not understand the gpio setup on this board as it seems.

According to picture in OP article, I am using PIN 16, which should be GPIO 25. The offset is 232.

How to correctly turn this pin UP? The gate has its own power supply.

Bellow doesn’t seem to work:

GPIO_NO=$((232+16))
echo $GPIO_NO  > /sys/class/gpio/export
echo out > /sys/class/gpio/gpio$GPIO_NO/direction
echo "1" >/sys/class/gpio/gpio$GPIO_NO/value

Not add pin but gpio number

Thus 232+25 ?

OK, that seems to be what I was missing. Thank you