Skip to content
Projects
Groups
Snippets
Help
Loading...
Help
Support
Submit feedback
Contribute to GitLab
Sign in
Toggle navigation
Q
qgroundcontrol
Project
Project
Details
Activity
Releases
Cycle Analytics
Repository
Repository
Files
Commits
Branches
Tags
Contributors
Graph
Compare
Charts
Issues
0
Issues
0
List
Boards
Labels
Milestones
Merge Requests
0
Merge Requests
0
CI / CD
CI / CD
Pipelines
Jobs
Schedules
Charts
Wiki
Wiki
Snippets
Snippets
Members
Members
Collapse sidebar
Close sidebar
Activity
Graph
Charts
Create a new issue
Jobs
Commits
Issue Boards
Open sidebar
Valentin Platzgummer
qgroundcontrol
Commits
e0215a70
Commit
e0215a70
authored
Jan 14, 2016
by
Don Gagne
Browse files
Options
Browse Files
Download
Email Patches
Plain Diff
Stupid proof Linux serial port use
parent
f9874376
Changes
1
Hide whitespace changes
Inline
Side-by-side
Showing
1 changed file
with
39 additions
and
0 deletions
+39
-0
QGCApplication.cc
src/QGCApplication.cc
+39
-0
No files found.
src/QGCApplication.cc
View file @
e0215a70
...
...
@@ -188,6 +188,45 @@ QGCApplication::QGCApplication(int &argc, char* argv[], bool unitTesting)
setAttribute
(
Qt
::
AA_DontCreateNativeWidgetSiblings
);
#endif
#ifdef Q_OS_LINUX
#ifndef __mobile__
if
(
getuid
()
==
0
)
{
QMessageBox
msgBox
;
msgBox
.
setInformativeText
(
"You are runnning QGroundControl as root. "
"You should not do this since it will cause other issues with QGroundControl. "
"QGroundControl will now exit. "
"If you are having serial port issues, execute the following commands to fix most serial port issues:
\n
"
"sudo usermod -a -G dialout $USER
\n
"
"sudo apt-get remove modemmanager"
);
msgBox
.
setStandardButtons
(
QMessageBox
::
Ok
);
msgBox
.
setDefaultButton
(
QMessageBox
::
Ok
);
msgBox
.
exec
();
_exit
(
0
);
}
// Determine if we have the correct permissions to access USB serial devices
QFile
permFile
(
"/etc/group"
);
if
(
permFile
.
open
(
QIODevice
::
ReadOnly
))
{
while
(
!
permFile
.
atEnd
())
{
QString
line
=
permFile
.
readLine
();
if
(
line
.
contains
(
"dialout"
)
&&
!
line
.
contains
(
getenv
(
"USER"
)))
{
QMessageBox
msgBox
;
msgBox
.
setInformativeText
(
"The current user does not have the correct permissions to access serial devices. "
"You should also remove modemmanager since it also interferes. "
"Execute the following commands to fix these issues:
\n
"
"sudo usermod -a -G dialout $USER
\n
"
"sudo apt-get remove modemmanager"
);
msgBox
.
setStandardButtons
(
QMessageBox
::
Ok
);
msgBox
.
setDefaultButton
(
QMessageBox
::
Ok
);
msgBox
.
exec
();
break
;
}
}
permFile
.
close
();
}
#endif
#endif
// Parse command line options
bool
fClearSettingsOptions
=
false
;
// Clear stored settings
...
...
Write
Preview
Markdown
is supported
0%
Try again
or
attach a new file
Attach a file
Cancel
You are about to add
0
people
to the discussion. Proceed with caution.
Finish editing this message first!
Cancel
Please
register
or
sign in
to comment