gpioSetDirection unable to open gpio417: Permission denied

Dear All,
I want to configure NVIDIA Jetson AGX Xavier GPIO pin number 22.
I have taken the code from this link GitHub - gaosiy/JetsonXavierGPIO
For modifying the GPIO pin number 22 i have modified the .cpp file as below:

jetsonXavierGPIONumber LEDControlPin = gpio417; 

/* To control pin high or low  */
gpioSetValue(LEDControlPin, on);     //Pull high
gpioSetValue(LEDControlPin, off);    //Pull low

After building when i try to execute the code then i am getting the below error:
gpioSetDirection unable to open gpio417: Permission denied
filedescriptor 3 Setting the LED on
gpioSetValue unable to open gpio417: Permission denied

I am also getting only 1.6 V on pin 22 instead of 3.3V while running this application.

Any kind of help to solve this problem will be highly appreciated.

Best Regards
Md Anayatullah

Have you tried run the application with “sudo” command?

Hello ozguryildiz,

Thanks for your reply.
After running the application with sudo command the error is gone. But i am still getting 1.6V instead of 3.3V on pin number 22. Any recommendation, how can i solve this problem?

NVIDIA Jetson Xavier uses "TXB0108RGYR " level shifter. We have used “TXB0106IPWRQ1” level shifter before and we observed same situation like you said. We removed this chip and our circuit works well in the scope of 1.8V. Your problem might be level shifter problem,too.