当前位置:网站首页>The problem of wirengpi program running permission
The problem of wirengpi program running permission
2022-06-25 09:35:00 【silno】
Recently, with c wiringPi Learning control led, The routine is compiled in linux The command interface can run normally .
Later, I tried to apache Environmental Science , adopt web control led, Never light up ,
It turned out In this function wiringPiSetup(); It's stuck .
Repeat the test , It is found that it is compiled led Insufficient permissions for the program ,
chmod 4755 led
Grant permission and then pass web Call to control led 了 .
because apache Is set up in linux In the system , many linux The operation of , Permission is required to execute .
therefore , If the program debugged separately can execute normally , If you change the environment, you will make mistakes , It is necessary to consider the issue of the execution authority of the program
Add :
There is a blog saying ,https://blog.csdn.net/qq_31669419/article/details/53339770
Run in raspberry pie opencv And GPIO Combined procedures , If you use wiringPiSetup() Set function initialization wiringPi System , When running the program, you must obtain root jurisdiction , But at this point, if you call a function imshow An error occurred when
Actually , stay wiringPi It is also provided wiringPiSetupSys(void) Initialization function , It can be non root The user calls , Provided GPIO Pins must be used in advance gpio Command export . The pin number in this mode is native Broadcom GPIO Pin number (BCM).
wiringPiSetupSys();
pinMode(17,OUTPUT);//BCM The first 17 The foot is wringPI The first 0 foot
Before running the program , First, input the command in the terminal
gpio export 17 out
------------------------------------
It's a little bit of a hassle , Give me permission
边栏推荐
- C program termination problem clr20r3 solution
- Oracle one line function Encyclopedia
- 【mysql学习笔记22】索引
- Title B of the certification cup of the pistar cluster in the Ibagu catalog
- [competition - Rural Revitalization] experience sharing of Zhejiang Rural Revitalization creative competition
- Data-driven anomaly detection and early warning of item C in the May 1st mathematical modeling competition in 2021
- matplotlib matplotlib中plt.grid()
- 22 mathematical modeling contest 22 contest C
- 首期Techo Day腾讯技术开放日,628等你!
- Level 6 easy to mix words
猜你喜欢
Matplotlib axvline() and axhline() functions in Matplotlib
Use Navicat to compare data differences and structure differences of multi environment databases, and automatic DML and DDL scripts
Title B of the certification cup of the pistar cluster in the Ibagu catalog
C # startup program loses double quotation marks for parameters passed. How to solve it?
On the underlying index principle of MySQL
首期Techo Day腾讯技术开放日,628等你!
5、 Project practice --- identifying man and horse
The meshgrid() function in numpy
Wallys/MULTI-FUNCTION IPQ6010 (IPQ6018 FAMILY) EMBEDDED BOARD WITH ON-BOARD WIFI DUAL BAND DUAL
matplotlib matplotlib中axvline()和axhline()函数
随机推荐
How to download the school logo, school name and corporate logo on a transparent background without matting
[buuctf.reverse] 121-125
[IOU] intersection over union
When unity released webgl, jsonconvert Serializeobject() conversion failed
处理图片类库
将jar包注册为服务,实现开机自动启动
How much money have I made by sticking to fixed investment for 3 years?
How to delete a blank page that cannot be deleted in word
C program termination problem clr20r3 solution
Analysis on the bottom calling process of micro service calling component ribbon
[competition -kab micro entrepreneurship competition] KAB National College Students' micro entrepreneurship action participation experience sharing (including the idea of writing the application form)
A game WP
Abbreviations of common English terms for IC R & D
Level 6 easy to mix words
Title B of the certification cup of the pistar cluster in the Ibagu catalog
Fcpx quickly add subtitles | Final Cut Pro import fcpxml subtitle file does not match the video time? I got it in code
富时A50开户什么地方安全
[opencv] - Discrete Fourier transform
行业春寒回暖,持续承压的酒店企业于何处破局?
Use Navicat to compare data differences and structure differences of multi environment databases, and automatic DML and DDL scripts