GPIO real number of Radxa ZERO using mraa

Hi,
I am trying to use GPIO with MRAA library. I am working with Python. Someone knows the real number of the GPIO of this board?

I

I thought mraa can use physical pin number. But in any case that you do need the “real” GPIO pin number, you can reference our WIki which listed the number, along with how to calculate them.

Edit: mraa uses board number for GPIO pin.

Can you tell me the number of PIN#18,24,36 in python?

GPIO numbers of your reference Wiki, do not work. I can not write in python
GPIO=mraa.Gpio(510)
Because the script fails

Hi @Javier_Vela, as your second post shows, mraa is referencing the physical pin numbers.

Likewise, if for instance you wanted to set pin 19 to active from the command-line you could use:
mraa-gpio set 19 1

Then to set it to inactive:
mraa-gpio set 19 0

For more details, you can run mraa-gpio without any options:
mraa-gpio

As python is simply accessing mraa at the system level, I would expect it to use the same values.

Hope this helps!

Hi,

mraa-gpio version
Version v2.1.0-20-g9ea5a29 on Radxa Zero
mraa-gpio list
It shows the above image. According to this image, Radxa has the following GPIO options:
3,5,7,8,10,11,12,13,16,18,19,21,22,23,24,27,28,32,35,36,37,38,40
I have tested all the pins and the pins that no fail are:
3,5,7,8,10,13,16,18,21,22,23,24,37,38,40
Pin 35,36 fail
Pin 22,38 do not change his state

According to this:
PIN03 GPIOA_14
PIN05 GPIOA_15
PIN07 GPIOAO_3
PIN08 GPIOAO_0
PIN10 GPIOAO_1
PIN11 GPIOAO_2
PIN12 GPIOX_9
PIN13 GPIOX_11
PIN16 GPIOX_10
PIN18 GPIOX_8
PIN19 GPIOH_4
PIN21 GPIOH_5
PIN22 GPIOC_7 //Not supported gpio funtion now
PIN23 GPIOH_7
PIN24 GPIOH_6
PIN27 GPIOAO_3
PIN28 GPIOAO_2
PIN32 GPIOAO_4
PIN35 GPIOAO_8
PIN36 GPIOH_8
PIN37 GPIOAO_9
PIN38 GPIOAO_10
PIN40 GPIOAO_11

It is normal that pin 22 not works.
Maybe PIN36 no works because it needs a Pull up/down resistor in his output

Hi @Javier_Vela, as you’ll see under the More details about 40-pin Header on the gpio wiki page @RadxaYuntian provided both pins 22 and 36 are open drain and thus require additional connections depending on intended usage :wink:

Otherwise it looks like you’re making progress with your python/mraa integration?

Hey, Javier. May I ask you: which linux image you have flashed to your micro SDCard for you to ge the libmraa library up and running? I am still struggling to get it going with the TwisterOS, which was the only image that could boot from the SD card and work properly in my 4 GB Radxa.

Hi, I have tested several images.
I am using: Armbian_21.08.4_Radxa-zero_buster_current_5.10.79
I don’t like: DietPi_RadxaZero-ARMv8-Bullseye and radxa-zero-debian-buster-xfce4-arm64-20220302-0856-mbr

goldelox@radxa-zero:~$ uname -a
Linux radxa-zero 5.10.69-10-amlogic-g617a45dd0fce #amlogic SMP PREEMPT Wed Jan 26 09:18:39 UTC 2022 aarch64 GNU/Linux
goldelox@radxa-zero:~$ uname -r
5.10.69-10-amlogic-g617a45dd0fce
goldelox@radxa-zero:~$ cat /etc/os-release
PRETTY_NAME=“Debian GNU/Linux 10 (buster)”
NAME=“Debian GNU/Linux”
VERSION_ID=“10”
VERSION=“10 (buster)”
VERSION_CODENAME=buster
ID=debian
HOME_URL=“https://www.debian.org/
SUPPORT_URL=“https://www.debian.org/support
BUG_REPORT_URL=“https://bugs.debian.org/

When I finish my goals with with Radxa, I will write a info document for preparing the SO for my things