I can't control my gpio level using libmraa

I follow https://wiki.radxa.com/Zero/dev/libmraa step by step. but i am struking in sudo mraa-gpio set 40 1 and sudo mraa-gpio get 40. The pin40 is always low level.although I’ve tried python code and Shell instruction, this problem is still on my way. Anyone have the similar problem like me?
my python code and shell recording is below:

rock@radxa-zero:~$ sudo mraa-gpio set 40 1
rock@radxa-zero:~$ sudo mraa-gpio get 40
Pin 40 = 0 
import mraa
powerKey = mraa.Gpio(40)
powerKey.dir(mraa.DIR_OUT)
powerKey.write(1)

This is my /boot/uEnv.txt

verbosity=7
console=ttyAML0,115200
overlay_prefix=meson
rootfstype=ext4
fdtfile=amlogic/meson-g12a-radxa-zero.dtb
overlays=meson-g12a-i2c-ee-m1-gpioh-6-gpioh-7 meson-g12a-uart-ao-b-on-gpioao-8-gpioao-9  meson-g12a-uart-ee-c
console=
rootuuid=c179bfd8-a277-4acb-ac3c-2aba013f4a2a
initrdsize=0xf871a5
kernelversion=5.10.69-7-amlogic-gfd159ba07d5c
initrdimg=initrd.img-5.10.69-7-amlogic-gfd159ba07d5c
kernelimg=vmlinuz-5.10.69-7-amlogic-gfd159ba07d5c

Hi @negi_negu,

I tested pin 40 on my R0 and see the same behaviour (it does not switch to high).

Are you able to switch state via mraa for any other pins?

I’m using mraa-gpio set in my project for other pins without issue.

Nothing in the GPIO table explains this lack of response.

Hope this helps!

Can you see if the following commands work for you?

sudo -i
echo 423 > /sys/class/gpio/export
echo out > /sys/class/gpio/gpio423/direction
echo 1 > /sys/class/gpio/gpio423/value
The following commands work for me:
    ## Mode mraa
    sudo mraa-gpio set 40 1           #pin40 pull high, led on
    sudo mraa-gpio set 40 0           #pin40 pull high, led off

Mode bash

echo 423 > /sys/class/gpio/export
echo “out” > /sys/class/gpio/gpio423/direction
while true;
do
echo 0 > /sys/class/gpio/gpio423/value #led on
sleep 1
echo 1 > /sys/class/gpio/gpio423/value #led off
sleep 1
done

There is a diference: “out” instead of out

To fix the zero wifi problem,

that is the result:
``
root@radxa-zero:~# echo 423 > /sys/class/gpio/export

root@radxa-zero:~# echo out > /sys/class/gpio/gpio423/direction
root@radxa-zero:~# echo 1 > /sys/class/gpio/gpio423/value
root@radxa-zero:~# mraa-gpio get 40
Pin 40 = 0
root@radxa-zero:~# mraa-gpio get 40
Pin 40 = 0
root@radxa-zero:~#
``

root@radxa-zero:~# echo "out" > /sys/class/gpio/gpio423/direction
root@radxa-zero:~# echo 1 > /sys/class/gpio/gpio423/value
root@radxa-zero:~# mraa-gpio get 40
Pin 40 = 0
root@radxa-zero:~# 

still not working

Don’t use mraa but a multi meter. The point of setting pin in sysfs is to check if the issue is on mraa or somewhere else.