1260 views|1 replies

6834

Posts

11

Resources
The OP
 

Luban Cat sets permissions for GPIO [Copy link]

When Python of Luban Cat controls GPIO, if the permissions for gpiochip are not set, an error will always be reported during operation, indicating that there is no permission to access "/dev/gpipchip4".

Although you can use sudo chmod 777 "/dev/gpiochip4" to temporarily grant permissions, it is inconvenient when it is delivered to users. After checking, you can modify /etc/udev/rules.d/99-rockchip-permissions.rules

# SPI, I2C, gpio devices
SUBSYSTEM=="spidev", GROUP="devuser", MODE="0660"
SUBSYSTEM=="i2c-dev", GROUP="devuser", MODE="0660"
# The gpio part did not take effect. The specific reason is still under investigation.
KERNEL="gpiochip[0-4]*" GROUP="devuser",MODE="0666"

This configuration rule tells udev that as long as the subsystem hardware matches spidev and i2c-dev, the device user group should be changed to devuser and the permissions should be changed to 0660.
Next, we need to create a devuser group and add the cat user to this group. Enter the following command

  1. sudo groupadd devuser
  2. sudo adduser "$USER" devuser
  3. south reboo

Then you can access i2c spi and gpiochip normally.

This post is from Linux and Android

Latest reply

Thanks for sharing! The operation of Linux is indeed different from that of MCU.   Details Published on 2023-8-28 19:44

7422

Posts

2

Resources
2
 

Thanks for sharing! The operation of Linux is indeed different from that of MCU.

This post is from Linux and Android
 
Personal signature

默认摸鱼,再摸鱼。2022、9、28

 

Guess Your Favourite
Just looking around
Find a datasheet?

EEWorld Datasheet Technical Support

EEWorld
subscription
account

EEWorld
service
account

Automotive
development
circle

Copyright © 2005-2024 EEWORLD.com.cn, Inc. All rights reserved 京B2-20211791 京ICP备10001474号-1 电信业务审批[2006]字第258号函 京公网安备 11010802033920号
快速回复 返回顶部 Return list