Cruisers Forum
 


Join CruisersForum Today

Reply
 
Thread Tools Rate Thread Display Modes
Old 07-05-2012, 16:37   #1
Registered User

Join Date: Feb 2011
Posts: 242
Linux configuration - must be root?

I used windows, but would like to move to linux on the boat.
I'm testing with Ubuntu 12.04 LTS and have some issues.

For safety's sake - I'd like the PC to boot up running Opencpn automatically.

So far, it won't see the GPS unless I start opencpn with sudo. I never saw that requirement in any of the docs, so I'm wondering if my install was done correctly. I'm still pretty new to Linux by the way. I installed with sudo synaptic to version 2.5 on this site. xgps has always worked right away but opencpn has been finicky. I'm not really sure what I did to get it working, but its been running over 24 hours testing the pc at home.

Must opencpn be started with sudo?
If not, what did I do wrong, or what to correct?

Maybe the new release of 12.04 is part of the problem. I'm also considering other linux flavors like xubuntu and xinutop, any suggestions appreciated of course
__________________

__________________
dave777 is offline   Reply With Quote
Old 07-05-2012, 22:49   #2
Registered User

Join Date: May 2010
Location: near San Jose, CA
Boat: Yankee Dolphin 24'
Posts: 113
Re: Linux configuration - must be root?

A very likely fix is to find the group that the port(s) that the GPS is on, and add it to the user running OCPN. You (probably) need sudo because the OCPN user doesn't have permission to read the port, so by adding the user to the group, it will have permission. for example:

% ls -l /dev/ttyS0
crw-rw---- 1 root dialout 4, 64 2012-05-07 20:36 /dev/ttyS0
% sudo usermod -a -G dialout $USER
%

then logout and log back in. Should work.

is the basic idea (from a shell, anyway).
Good luck!
__________________

__________________
tenchiki is offline   Reply With Quote
Old 08-05-2012, 09:38   #3
Registered User

Join Date: Dec 2005
Location: WNA
Boat: Dufour 35
Posts: 3,247
Re: Linux configuration - must be root?

dave777

You should not start opencpn with sudo.
Normally an Ubuntu installation does the right thing out of the box.
Can you publish your logfile? Instructions here -> FAQ | Official OpenCPN Homepage.

Thomas
__________________
cagney is offline   Reply With Quote
Old 08-05-2012, 22:04   #4
Registered User

Join Date: Feb 2011
Posts: 242
Re: Linux configuration - must be root?

Quote:
Originally Posted by tenchiki View Post
A very likely fix is to find the group that the port(s) that the GPS is on, and add it to the user running OCPN. You (probably) need sudo because the OCPN user doesn't have permission to read the port, so by adding the user to the group, it will have permission. for example:

% ls -l /dev/ttyS0
crw-rw---- 1 root dialout 4, 64 2012-05-07 20:36 /dev/ttyS0
% sudo usermod -a -G dialout $USER
%

then logout and log back in. Should work.

is the basic idea (from a shell, anyway).
Good luck!
Your probably right, but two questions:

1. By $USER to you mean substitute "$myloginname" or is there a group "$USER"?
2. My device is ttyUSB0 and the ls as you typed only returns
/dev/ttyUSB0
__________________
dave777 is offline   Reply With Quote
Old 09-05-2012, 10:35   #5
Registered User

Join Date: Dec 2005
Location: WNA
Boat: Dufour 35
Posts: 3,247
Re: Linux configuration - must be root?

Quote:
Originally Posted by dave777 View Post
Your probably right, but two questions:

1. By $USER to you mean substitute "$myloginname" or is there a group "$USER"?
2. My device is ttyUSB0 and the ls as you typed only returns
/dev/ttyUSB0
Xgps works for you. Gpsd must then be connected to /dev/ttyUSB0 and xgps is connected to the gpsd gps server. OpenCPN must, in that situation, also connect to gpsd . This is done by setting "NMEA Data Source" to "Network LIBGPS". What did you use?

There is no need to manually join the "dialout" group in Ubuntu. Fedora, for example is different. If you want to know which groups you belong to just find a command line and write "groups" and hit Enter.

$USER is synonymous for the current user. Once again find a commandline and write "echo $USER" and hit enter. Try the same with "whoami".

Thomas
__________________
cagney is offline   Reply With Quote
Old 13-05-2012, 21:32   #6
Registered User

Join Date: Feb 2011
Posts: 242
Re: Linux configuration - must be root?

Quote:
Originally Posted by cagney View Post
Xgps works for you. Gpsd must then be connected to /dev/ttyUSB0 and xgps is connected to the gpsd gps server. OpenCPN must, in that situation, also connect to gpsd . This is done by setting "NMEA Data Source" to "Network LIBGPS". What did you use?

There is no need to manually join the "dialout" group in Ubuntu. Fedora, for example is different. If you want to know which groups you belong to just find a command line and write "groups" and hit Enter.

$USER is synonymous for the current user. Once again find a commandline and write "echo $USER" and hit enter. Try the same with "whoami".

Thomas
Thanks for all of the tips.

It wouldn't work when connected to "Network LIBGPS" and opencpn would give the error message "unable to load libgps". Synaptic says that I have libgps20 installed version 3.4-2

I have connected with /dev/ttyUSB0 though it works only sometimes.
__________________
dave777 is offline   Reply With Quote
Old 18-05-2012, 21:10   #7
Registered User

Join Date: Apr 2010
Location: Newport News VA
Boat: Egg Harbor sedan cruiser 1970
Posts: 829
Re: Linux configuration - must be root?

on ubuntu 12.04, right now libgps is not working when run with opencpn.
hopefully it will get fixed soon.

EDIT, it looks like it is working! I just downloaded the latest beta and it connected using libgps. The nmea data stream window still shows blank, but the program locked on my location.

I had to install it from terminal window using

Quote:
sudo dpkg -i opencpn_2.6.1718-1_i386.deb
as the ubuntu package manager gives errors on the install.


For the boat, I have opencpn running a previous version of ubuntu and it is fine. Connects with libgps.

Quote:
I have connected with /dev/ttyUSB0 though it works only sometimes.
I tried that and it will never work for me.
GPSD is a daemon program that allows many other gps programs to get data from the gps. So that is a good thing. Perhaps using /dev/ttyUSB0 creates a conflict with GPSD also trying to get hold of it.

http://en.wikipedia.org/wiki/Gpsd
__________________
sdowney717 is offline   Reply With Quote
Old 18-05-2012, 22:08   #8
Marine Service Provider
 
bdbcat's Avatar

Join Date: Mar 2008
Posts: 4,883
Re: Linux configuration - must be root?

sdowney717....

Are you getting ubuntu install errors with 2.6.1718 ?

This was thought to be fixed.

What do you see? Can you bring the information to the 2.6.1718 Beta thread?

Thanks
Dave
__________________
bdbcat is offline   Reply With Quote
Old 19-05-2012, 02:38   #9
Registered User

Join Date: Dec 2005
Location: WNA
Boat: Dufour 35
Posts: 3,247
Re: Linux configuration - must be root?

Quote:
Originally Posted by sdowney717 View Post
on ubuntu 12.04, right now libgps is not working when run with opencpn.
hopefully it will get fixed soon.

EDIT, it looks like it is working! I just downloaded the latest beta and it connected using libgps. The nmea data stream window still shows blank, but the program locked on my location.

With gpsd, the nmea data stream window will always be blank, as there is no nmea data-stream from gpsd.

I had to install it from terminal window using



as the ubuntu package manager gives errors on the install.


For the boat, I have opencpn running a previous version of ubuntu and it is fine. Connects with libgps.



I tried that and it will never work for me.
GPSD is a daemon program that allows many other gps programs to get data from the gps. So that is a good thing. Perhaps using /dev/ttyUSB0 creates a conflict with GPSD also trying to get hold of it.

gpsd - Wikipedia, the free encyclopedia
Exactly. To use /dev/ttyUSB0 directly, un-install the package gpsd (easiest way on 12.04), and restart opencpn. Also do " sudo klllall gpsd", to be sure gpsd isn't running in the background.
For reports regarding 2.6.178 use this thread OpenCPN Version 2.6 Beta Build 1718

Thomas
__________________
cagney is offline   Reply With Quote
Old 19-05-2012, 06:37   #10
Registered User

Join Date: Apr 2010
Location: Newport News VA
Boat: Egg Harbor sedan cruiser 1970
Posts: 829
Re: Linux configuration - must be root?

I downloaded the latest beta and did an install using Ubuntu software center.
It gave me a crash apport-gtk type error. I had seen something similar before.

I just tried to reproduce the error doing an uninstall and re-install and it is working in ubuntu software center, so I cant reproduce the error.

I had got the screen where says report error - relaunch - close.
Is there an install log?

If I cant reproduce the error It is working.
__________________
sdowney717 is offline   Reply With Quote
Old 28-07-2012, 06:59   #11
Registered User

Join Date: Jul 2012
Location: Motala , Sweden
Boat: Beneteau First 47.7
Posts: 4
Re: Linux configuration - must be root?

Hello,
I have the same problem with usbgps port.
If I do a new intallation of ubuntu 12.04 or 11.10 then I must use sudo to make gps work. But my old computer 11.04 uppgraded to 12.04 worked fine untill I just made a new install with 12.04 64 bit.

I have tried this on 4 different computers with fresh ubuntu installation and new opencpn installed with program center and no gps without sudo command.

Is it possible to solve this or is it a workoround?
__________________
kirribilli47 is offline   Reply With Quote
Old 28-07-2012, 07:16   #12
Marine Service Provider
 
bdbcat's Avatar

Join Date: Mar 2008
Posts: 4,883
Re: Linux configuration - must be root?

kirribilli47...

It must be a permissions problem on /dev/ttyS0, or whatever the port is.

Sometimes you need to make sure that the user (you) are a member of the DIALOUT group. If you are using a USB hotplug device, then you may need to modify the script that creates the device on plugin. Lots of Google juice on this subject....

Try to start gpsd with some debug output. That may be illuminating.

Anyway, not directly an OpenCPN problem....

Good Luck
Dave
__________________
bdbcat is offline   Reply With Quote
Old 28-07-2012, 07:17   #13
Registered User

Join Date: Feb 2010
Location: On the go. Not in Prague.
Posts: 4,016
Re: Linux configuration - must be root?

kirribilli47...
Welcome aboard. I suppose the solution is in post number 2 in this very thread.

Pavel
__________________
nohal is offline   Reply With Quote
Old 28-07-2012, 07:32   #14
Registered User

Join Date: Jul 2012
Location: Motala , Sweden
Boat: Beneteau First 47.7
Posts: 4
Re: Linux configuration - must be root?

Thanks
Post No. 2 worked, maybe I should read better
Now I must go to 3 friends and fix it ox so they do not have to write sudo at every boot.

As I tried on 4 computers, I think there are many who get this wrong, is there a way to help more?
__________________
kirribilli47 is offline   Reply With Quote
Old 28-07-2012, 07:42   #15
Registered User

Join Date: Feb 2010
Location: On the go. Not in Prague.
Posts: 4,016
Re: Linux configuration - must be root?

Try to talk to Canonical engineers who made Ubuntu behave this way. They will probably not listen as in "This is not a bug, it's a security feature"

Pavel
__________________

__________________
nohal is offline   Reply With Quote
Reply

Tags
linux

Thread Tools
Display Modes Rate This Thread
Rate This Thread:

Posting Rules
You may not post new threads
You may not post replies
You may not post attachments
You may not edit your posts

BB code is On
Smilies are On
[IMG] code is On
HTML code is Off
Trackbacks are Off
Pingbacks are Off
Refbacks are Off




Copyright 2002- Social Knowledge, LLC All Rights Reserved.

All times are GMT -7. The time now is 01:37.


Google+
Powered by vBulletin® Version 3.8.8 Beta 1
Copyright ©2000 - 2017, vBulletin Solutions, Inc.
Social Knowledge Networks
Powered by vBulletin® Version 3.8.8 Beta 1
Copyright ©2000 - 2017, vBulletin Solutions, Inc.

ShowCase vBulletin Plugins by Drive Thru Online, Inc.