当前位置:网站首页>【驱动】udev设置GPIO加载后所有者、所属组和权限
【驱动】udev设置GPIO加载后所有者、所属组和权限
2022-07-30 03:53:00 【郭老二】
1、问题描述
默认情况下,操作gpio需要root用户(普通用户root权限也不可以)。因此需要导出gpio和操作gpio时,需要设置所有者、所属组和权限。
2、解决方法
2.1 创建gpio操作组
groupadd -f -r gpio
groupadd参数详解:
-r:创建系统工作组,系统工作组的组 ID 小于 500;
-f,--force: 如果指定的组已经存在,不重新创建,仅以成功状态退出。
2.2 将普通用户添加到gpio组中
usermod -a -G gpio userName
usermod参数详解:
-G<群组> : 修改用户所属的附加群组
-a, --append: 将用户附加到-G选项中提到的群组,而不将其从其他组中删除
2.3 创建规则
在/etc/udev/rules.d下,创建规则文件
sudo touch 99-gpio.rules
设置规则文件权限
sudo chmod +777 99-gpio.rules
udev规则一:
SUBSYSTEM边栏推荐
- Gateway 路由网关
- Tcp programming
- Nacos配置中心
- Send it to your friends and let TA treat you to fried chicken!
- New interface - API interface for "Taote" keyword search
- 论坛管理系统
- 高并发框架 Disruptor
- day10--install mysql on linux
- The difference between BGP room and ordinary room in Beijing
- Nacos service registration and discovery
猜你喜欢

Forum management system

小程序毕设作品之微信二手交易小程序毕业设计成品(8)毕业设计论文模板

Mini Program Graduation Works WeChat Second-hand Trading Mini Program Graduation Design Finished Works (7) Interim Inspection Report

Mini Program Graduation Works WeChat Points Mall Mini Program Graduation Design Finished Products (3) Background Functions

ospf map

小程序毕设作品之微信积分商城小程序毕业设计成品(6)开题答辩PPT

Mini Program Graduation Works WeChat Second-hand Trading Mini Program Graduation Design Finished Work (2) Mini Program Function

SDL player in action

Basic introduction to protect the network operations

Gateway 路由网关
随机推荐
Nacos achieves high availability
基于全志D1-H和XR806的名贵植物监控装置
Redis server启动后会做哪些操作?
使命、愿景、价值观到底有什么区别
STM32 SPI+WM8978 voice loopback
Mini Program Graduation Works WeChat Points Mall Mini Program Graduation Design Finished Product (2) Mini Program Function
Wechat second-hand transaction small program graduation design finished product (1) Development overview
智能答题功能,CRMEB知识付费系统必须有!
MySQ死锁
day10--install mysql on linux
Resampling a uniformly sampled signal
Chapter 51 - Knowing the request header parameter analysis【2022-07-28】
第51篇-知乎请求头参数分析【2022-07-28】
Nacos service registration and discovery
Let's learn the layout components of flutter together
route filter
OpenFeign实现负载均衡
Nacos installation and deployment
Gateway 路由网关
TCP congestion control technology and acceleration principle of BBR