gpsd-users
[Top][All Lists]
Advanced

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

[gpsd-users] udev/hotplug problem with gpsd


From: Victor Klein
Subject: [gpsd-users] udev/hotplug problem with gpsd
Date: Thu, 10 May 2012 14:04:27 +0200

I installed gpsd on a tp-link mr3020 router running an embedded linux
provided by openwrt.org.

I have a sirf-gps with 4800 baud and a second FTDI-USD-Serial-Converter
delivering AIS-data with 38400 baud
connected to the linux box.

I start the gpsd as a daemon with gpsd -G -b /dev/ttyUSB0  /dev/ttyUSB1 as
Eric told me in his answer to my post.

I changed the /etc/init.d/gpsd and /etc/config/gpsd so that the daemon
starts on boot time to listen to both devices 

It runs fine, it reads data from both devices.

But the hotplug does not run.

If I unplug and plugin the ftdi-Converter, I get kernel messages and also
messages from the udevadm monitor kernel , but none of the messages
described in udev hotplug troubleshooting.

if I unplug the ttyUSB1 I get from the telnet-data console)

{"class":"DEVICE","path":"/dev/ttyUSB1","activated":0}

and from root on the device (telnet console)

address@hidden:/# pgrep gpsd
889
address@hidden:/# udevadm monitor kernel property
monitor will print the received events for:
UDEV - the event which udev sends out after rule processing
KERNEL - the kernel uevent

KERNEL[1183.198892] remove
/devices/platform/ar933x-ehci/usb1/1-1/1-1.4/1-1.4:1.0/ttyUSB1/tty/ttyUSB1 (tty)
KERNEL[1183.199123] remove
/devices/platform/ar933x-ehci/usb1/1-1/1-1.4/1-1.4:1.0/ttyUSB1 (usb-serial)
KERNEL[1183.199345] remove
/devices/platform/ar933x-ehci/usb1/1-1/1-1.4/1-1.4:1.0 (usb)
KERNEL[1183.199584] remove   /devices/platform/ar933x-ehci/usb1/1-1/1-1.4 (usb)

and  from the serial console of the device

[ 1183.180000] usb 1-1.4: USB disconnect, device number 4
[ 1183.180000] ftdi_sio ttyUSB1: FTDI USB Serial Device converter now
disconnected from ttyUSB1
[ 1183.190000] ftdi_sio 1-1.4:1.0: device disconnected

This is ok, so far.

If I plug the USB-Converter in I get
from serial console
[ 1422.010000] usb 1-1.4: new full-speed USB device number 5 using ath79-ehci
[ 1422.120000] ftdi_sio 1-1.4:1.0: FTDI USB Serial Device converter detected
[ 1422.130000] usb 1-1.4: Detected FT232BM
[ 1422.130000] usb 1-1.4: Number of endpoints 2
[ 1422.140000] usb 1-1.4: Endpoint 1 MaxPacketSize 16384
[ 1422.140000] usb 1-1.4: Endpoint 2 MaxPacketSize 16384
[ 1422.150000] usb 1-1.4: Setting MaxPacketSize 64
[ 1422.160000] usb 1-1.4: FTDI USB Serial Device converter now attached to
ttyUSB1

from root (udevadm)

KERNEL[1422.125138] add      /devices/platform/ar933x-ehci/usb1/1-1/1-1.4 (usb)
KERNEL[1422.155688] add
/devices/platform/ar933x-ehci/usb1/1-1/1-1.4/1-1.4:1.0 (usb)
KERNEL[1422.155894] add
/devices/platform/ar933x-ehci/usb1/1-1/1-1.4/1-1.4:1.0/ttyUSB1 (usb-serial)
KERNEL[1422.167171] add
/devices/platform/ar933x-ehci/usb1/1-1/1-1.4/1-1.4:1.0/ttyUSB1/tty/ttyUSB1 (tty)

nothing from the data console
?WATCH=.. is not answered,

but the gpsd is running

address@hidden:/# pgrep gpsd
1246

So I think there is a problem with the udev-configuration

I add some info concerning config files from gpsd 2.94:

I wonder that there are no udev.rules !

address@hidden:/etc/udev/rules.d# ls
address@hidden:/etc/udev/rules.d# 

There is a conf file in /etc/hotplug.usb

address@hidden:/etc/hotplug.d/usb# ls
10-usb   20-gpsd
address@hidden:/etc/hotplug.d/usb# cat 20-gpsd 
case "$ACTION" in
    add)
        # start process
        # only pl2303 devices are handled
        if [ "$PRODUCT" = "67b/2303/300" ] && [ "$TYPE" = "0/0/0" ] && [
"$INTERFACE" = "255/0/0" ]; then
            sleep 3 && /etc/init.d/gpsd start
        fi
        ;;
    remove)
        # stop process
        # only pl2303 devices are handled
        if [ "$PRODUCT" = "67b/2303/300" ] && [ "$TYPE" = "0/0/0" ] && [
"$INTERFACE" = "255/0/0" ]; then
            /etc/init.d/gpsd stop
        fi
        ;;
esac
address@hidden:/etc/hotplug.d/usb# 

there is a file in etc/init.d
address@hidden:/etc/init.d# cat gpsd
#!/bin/sh /etc/rc.common
# Copyright (C) 2009 OpenWrt.org
START=50

NAME=gpsd
PIDF=/var/run/$NAME.pid
PROG=/usr/sbin/$NAME

start() {
    config_load gpsd
    config_get device core device
    config_get port core port
    config_get_bool enabled core enabled
    [ "$enabled" != "1" ] && exit
    logger -t "$NAME" "Starting..."
    [ ! -c "$device" ] && {
        logger -t "$NAME" "Unable to find device $device. Exiting."
        exit 1
    }
    echo "starting gpsd "
    $PROG -n -G -b -P $PIDF -S $port $device
}

stop() {
    logger -t "$NAME" "Stopping..."
    [ -f "$PIDF" ] && {
        read PID < "$PIDF"
        kill -9 $PID
        rm $PIDF
    }
}
address@hidden:/etc/init.d# 

I tried to follow the Udev Hotplug Troubleshooting
        
what rules should be in the /etc/udev/rules.d directory?

  I found a file gpsd.rules in the 2.94 release, but the files  referenced
there 
#   /etc/udev/gpsd.rules
#   /etc/udev/rules.d/025_gpsd.rules -> ../gpsd.rules
#   /lib/udev/gpsd.hotplug.wrapper
#   /lib/udev/gpsd.hotplug

are not in my installation on the device


address@hidden:/lib/udev/rules.d# ls
42-qemu-usb.rules                  61-accelerometer.rules
50-udev-default.rules              75-cd-aliases-generator.rules
60-cdrom_id.rules                  75-persistent-net-generator.rules
60-persistent-input.rules          75-probe_mtd.rules
60-persistent-serial.rules         80-drivers.rules
60-persistent-storage.rules        95-udev-late.rules
60-persistent-v4l.rules


address@hidden:/lib/udev# ls
accelerometer             path_id                   v4l_id
ata_id                    rule_generator.functions  write_cd_rules
cdrom_id                  rules.d                   write_net_rules
input_id                  scsi_id
mtd_probe                 usb_id
address@hidden:/lib/udev# 

So I think there is a problem in the gpsd build for the MR-3020

Yesterday I found the 3.5 release on openwrt/feeds and build a new image.
But the problem is still there.

help appreciated

yours 
Victor 





reply via email to

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