gpsd-dev
[Top][All Lists]
Advanced

[Date Prev][Date Next][Thread Prev][Thread Next][Date Index][Thread Index]

Re: [gpsd-dev] Another release seems called for


From: Fulup Le Foll
Subject: Re: [gpsd-dev] Another release seems called for
Date: Wed, 24 Jul 2013 21:37:12 +0200
User-agent: Mozilla/5.0 (X11; Linux i686; rv:17.0) Gecko/20130510 Thunderbird/17.0.6

Gary

Naming of device is not a question of timeout but a question of availability of the path. Typically this is what's happen and why behaviour may seems to depend on timeout.
  • gpsd is running is keep open /dev/ttyUSB0
  • you unplug the device
  • gpsd fail and retry opening /dev/ttyUSB0  (some other program like opencpn keeps it open for ever)
  • you plug USB device again
    • shift of luck gpsd is still retrying to open /dev/ttyUSB0. As path is busy udev take the next available one
    • you're lucky gpsd stop trying to reopen and /dev/ttyUSB0 is available.
It is very easy to trace with tree windows running following commands.
  1. gpsd in debug mode
  2. udev in debug mode
  3. lsof /dev/ttyUSB0 running in loop

The only system I found to bypass this issue is to provide fix alias name with a udev script. Creating a device with a name base on its USB slot with "SYMLINK="gps-$env{ID_PATH}" work pretty well on any distribution. This method works even if you have multiple USB/serial adaptors with the same vendor/product id.

One possible alternative could be for gpsd to check if /dev/ttyUSB0 exist before trying to open it. I never check this, but file existence API may only impact directory and thus not lock the path.

Fulup


Le 24/07/2013 19:32, Gary E. Miller a écrit :
Yo Fulup!

On Wed, 24 Jul 2013 10:22:47 +0200
Fulup Le Foll <address@hidden> wrote:

If you plug/unplug an active USB device on Linux. Usually the device 
change name and move for example from ttyUSB0 to ttyUSB1.
Depends on how long.  For me if I wait more than about 30 seconds I'll
get ttyUSB0 again.  I depend on that behavior.

I commented this Linux feature long time ago on 
http://lists.berlios.de/pipermail/gpsd-users/2009-June/003785.html

Might also be useful to highlight that by default last versions of 
Ubuntu does not grant "dialout" group to basic users, when acces to 
/dev/tty* require access to "dialout" group.
Ouch.  So ubuntu is 'dialout' and not the conventional 'uucp' group?

I'd like to add a configure option to allow forcing the group 
gpsd uses after dropping priviledges, then I could completely sidestep 
udev which is non-portable.

RGDS
GARY
---------------------------------------------------------------------------
Gary E. Miller Rellim 109 NW Wilmington Ave., Suite E, Bend, OR 97701
	address@hidden  Tel:+1(541)382-8588

Fulup


Le 23/07/2013 19:42, Jeroen Massar a écrit :
On 2013-07-23 19:37 , Gary E. Miller wrote:
Yo Eric!

On Tue, 23 Jul 2013 08:24:01 -0400 (EDT)
address@hidden  (Eric S. Raymond) wrote:

I'd like to ship a bugfix release next week.
Maybe another bug to look at before a release:

If I unplug a USB GPS, then plug it back in, then gpsd can no
longer access the device:

gpsd:INFO: reconnection attempt on device 0
gpsd:INFO: opening GPS data source type 3 at '/dev/ttyUSB0'
gpsd:ERROR: device open failed: Permission denied - retrying
read-only gpsd:ERROR: read-only device open failed: Permission
denied gpsd:ERROR: /dev/ttyUSB0: device activation failed.

I assume because priviledges dropped.
Depending on platform, if on Linux you can teach udev to set the
permissions so that gpsd can access it.

Greets,
  Jeroen







-- 
Tel:  0972.235.723
Mail: address@hidden
http://www.sinagot.net

reply via email to

[Prev in Thread] Current Thread [Next in Thread]