HAL, FUSE, and serial port GPSs
C.Mueller
christian.mueller.konstanz at gmail.com
Sat Jan 17 10:42:08 PST 2009
hi i wanted to add generic GPS support to HAL but no one responded on this
list.
i got the same type of model (usb to serial converter) , by looking the
usbID up in google,
there almost only seem gps devices build with it, not not 100% :-(
i want to write a daemon for kde, where you can configure the behaviour
after the device is inserted , and emit signal to the other running
applications (like routing/globes or location aware social program's)
first thing, the detection with communication activly is not really nice -
any idea ?
chris
On Sat, Jan 17, 2009 at 7:21 PM, Tom Payne <twpayne at gmail.com> wrote:
> Hi,
>
> I'm trying to use HAL to automount a fuse filesystem when I plug my
> GPS in. It's a bit weird and I don't know if HAL can handle it.
>
> I have a GPS (actually a combined GPS/variometer/altimeter for
> paraglider and hang glider pilots) with a USB Serial interface. I've
> written a fuse interface to this device that allows you browse and
> edit the tracklogs, waypoints, routes, etc. stored on the device,
> automatically uploading them to and downloading them from the device
> as appropriate. I'd now like to have this userspace filesystem
> automount when the device is plugged in. The sequence of events is
> fairly convoluted:
>
> 1. The device has a built-in USB-to-serial converter so when the
> device is initially inserted it appears as a standard Prolific PL-2303
> USB-to-serial converter. HAL's Device Manager signals DeviceAdded when
> it is inserted.
> 2. You must communicate with the device over the serial port to
> determine whether it is indeed a GPS (rather than, say, anything else
> that has a serial interface). This detection can take some time
> (several minutes) because the user must press a button on the GPS
> before it will respond on the serial port. Assuming it can be
> identified as a GPS then you determine the make, model, serial number
> and owner's name.
> 3. Now you have enough information to choose a nice mountpoint (e.g.
> including the owner's name) and can call fuse to mount the device.
>
> My current "solution" is to use a daemon that communicates with HAL's
> Device Manager via DBUS listening for DeviceAdded signals. When a
> serial device is inserted I test it to see if it is a GPS and if it is
> I launch fuse. However, this solution feels ugly and I'm sure that
> it's possible to achieve the automounting behaviour entirely within
> HAL with a carefully crafted FDI file.
>
> I'd be very grateful for an indication as to whether this is possible
> in HAL or if I'm trying to do something that should be handled by
> something other than HAL. Troublesome aspects are:
> - GPS appears as a standard USB-to-serial converter
> - the device is a serial device but ends up acting more like a storage
> device
> - the device must be interrogated to detect whether it is a GPS, this
> can take several minutes
> - the mount command is unusual (e.g. "flytecfs -o device=/dev/ttyUSB0
> mountpoint")
> - the mountpoint is a function of parameters read from the device
> - the unmount command is unusual (i.e. "fusermount -u mountpoint")
> - unmount should be called when the device is unplugged
>
> If you're interested, the code itself, written in Python is here:
> http://github.com/twpayne/flytecfs
>
> Many thanks for any help,
> --
> Tom
> _______________________________________________
> hal mailing list
> hal at lists.freedesktop.org
> http://lists.freedesktop.org/mailman/listinfo/hal
>
-------------- next part --------------
An HTML attachment was scrubbed...
URL: http://lists.freedesktop.org/archives/hal/attachments/20090117/8956bb0b/attachment.htm
More information about the hal
mailing list