Page 3 of 3 FirstFirst 123
Results 21 to 30 of 30

Thread: wake from suspend issue with GPS and an already running gps client program

  1. #21
    Join Date
    Dec 2006
    Beans
    Hidden!

    Re: wake from suspend issue with GPS and an already running gps client program

    inexplicably, today when I awoke the PC from sleeping overnight gpsd is apparently not working at all.

    Now I find on a reboot gpsd works on the old setting not linking the new symbolic liked gps????
    And if I sleep, everything regarding gpsd which worked yesterday is a failure.

    after a sleep, now xgps cant even find any gps

  2. #22
    Join Date
    Dec 2006
    Beans
    Hidden!

    Re: wake from suspend issue with GPS and an already running gps client program

    I purged out gpsd and gpsd-clients (xgps is in there)

    I reinstalled and checked it was working on ttyUSB0, it is.
    Then did same thing I did yesterday, dpkg-reconfigure gpsd, pointing it to the symbolic linked ttyGPS-lt20, gpsd still shows it using ttyUSB0, so you have to killall gpsd, then reboot, because simply trying gpsd /dev/ttyGPS-lt20 fails to do a thing.
    So this gpsd must be very buggy implementation with ubuntu and only works on a very basic level which is difficult to customize. So I will have to undo everything and just hotplug because nothing works like they say.

    in etc/default is this file which tells gpsd what to do when it starts up I suppose.
    Code:
    # Default settings for gpsd.
    # Please do not edit this file directly - use `dpkg-reconfigure gpsd' to
    # change the options.
    START_DAEMON="true"
    GPSD_OPTIONS=""
    DEVICES="/dev/ttyGPS-lt20"
    USBAUTO="true"
    GPSD_SOCKET="/var/run/gpsd.sock"
    There are udev file rules that gpsd uses by default and maybe that is messing up on awaken from sleep.
    Because I think all these guides are from the past and no longer will work today, not being updated to keep up with all the changes.

    40-gpsd.rules file contents

    Code:
    # udev rules for gpsd
    #
    # This file is Copyright (c) 2010 by the GPSD project
    # BSD terms apply: see the file COPYING in the distribution root for details.
    #
    # GPSes don't have their own USB device class.  They're serial-over-USB
    # devices, so what you see is actually the ID of the serial-over-USB chip.
    # Fortunately, just two of these account for over 80% of consumer-grade
    # GPS sensors.  The gpsd.hotplug wrapper script will tell a running gpsd
    # that it should look at the device that just went active, because it
    # might be a GPS.
    #
    # The following setup works on Debian and Ubuntu - something similar
    # will apply on other distributions:
    # 
    #   /lib/udev/rules.d/25-gpsd.rules
    #   /lib/udev/gpsd.hotplug
    # 
    # Setting the link in /lib/udev/rules.d activates the rule and determines
    # when to run it on boot (similar to init.d processing).
    
    SUBSYSTEM!="tty", GOTO="gpsd_rules_end"
    
    # Prolific Technology, Inc. PL2303 Serial Port [linux module: pl2303]
    ATTRS{idVendor}=="067b", ATTRS{idProduct}=="2303", SYMLINK+="gps%n", RUN+="/lib/udev/gpsd.hotplug"
    # ATEN International Co., Ltd UC-232A Serial Port [linux module: pl2303]
    ATTRS{idVendor}=="0557", ATTRS{idProduct}=="2008", SYMLINK+="gps%n", RUN+="/lib/udev/gpsd.hotplug"
    # PS-360 OEM (GPS sold with MS Street and Trips 2005) [linux module: pl2303]
    ATTRS{idVendor}=="067b", ATTRS{idProduct}=="aaa0", SYMLINK+="gps%n", RUN+="/lib/udev/gpsd.hotplug"
    # FTDI 8U232AM / FT232 [linux module: ftdi_sio]
    ATTRS{idVendor}=="0403", ATTRS{idProduct}=="6001", SYMLINK+="gps%n", RUN+="/lib/udev/gpsd.hotplug"
    # Cypress M8/CY7C64013 (Delorme uses these) [linux module: cypress_m8]
    ATTRS{idVendor}=="1163", ATTRS{idProduct}=="0100", SYMLINK+="gps%n", RUN+="/lib/udev/gpsd.hotplug"
    # Cypress M8/CY7C64013 (DeLorme LT-40)
    ATTRS{idVendor}=="1163", ATTRS{idProduct}=="0200", SYMLINK+="gps%n", RUN+="/lib/udev/gpsd.hotplug" 
    # Garmin International GPSmap, various models (tested with Garmin GPS 18 USB)  [linux module: garmin_gps]
    ATTRS{idVendor}=="091e", ATTRS{idProduct}=="0003", SYMLINK+="gps%n", RUN+="/lib/udev/gpsd.hotplug"
    # Cygnal Integrated Products, Inc. CP210x Composite Device (Used by Holux m241 and Wintec grays2 wbt-201) [linux module: cp210x]
    ATTRS{idVendor}=="10c4", ATTRS{idProduct}=="ea60", SYMLINK+="gps%n", RUN+="/lib/udev/gpsd.hotplug"
    # Cygnal Integrated Products, Inc. [linux module: cp210x]
    ATTRS{idVendor}=="10c4", ATTRS{idProduct}=="ea71", SYMLINK="gps%n", RUN+="/lib/udev/gpsd.hotplug"
    # u-blox AG, u-blox 5 (tested with Navilock NL-402U) [linux module: cdc_acm]
    ATTRS{idVendor}=="1546", ATTRS{idProduct}=="01a5", SYMLINK="gps%n", RUN+="/lib/udev/gpsd.hotplug"
    # u-blox AG, u-blox 6 (tested with GNSS Evaluation Kit TCXO) [linux module: cdc_acm]
    ATTRS{idVendor}=="1546", ATTRS{idProduct}=="01a6", SYMLINK="gps%n", RUN+="/lib/udev/gpsd.hotplug"
    # MediaTek (tested with HOLUX M-1200E) [linux module: cdc_acm]
    ATTRS{idVendor}=="0e8d", ATTRS{idProduct}=="3329", SYMLINK="gps%n", RUN+="/lib/udev/gpsd.hotplug"
    
    ACTION=="remove", RUN+="/lib/udev/gpsd.hotplug"
    
    LABEL="gpsd_rules_end"

  3. #23
    Join Date
    Dec 2006
    Beans
    Hidden!

    Re: wake from suspend issue with GPS and an already running gps client program

    I wonder if this line
    # Cypress M8/CY7C64013 (DeLorme LT-40)
    ATTRS{idVendor}=="1163", ATTRS{idProduct}=="0200", SYMLINK+="gps%n", RUN+="/lib/udev/gpsd.hotplug"
    which is same as my usb is causing mischief on awaken, because it is running "/lib/udev/gpsd.hotplug" file?

  4. #24
    Join Date
    Dec 2006
    Beans
    Hidden!

    Re: wake from suspend issue with GPS and an already running gps client program

    nope commenting out that line did nothing helpful, i think made it worse.

    I completely undid everything including the symbolic link gps rule creating a fixed device called ttyGPS-lt20, because also I noticed sudo reboot or from the menu failed to work anymore.

    So it is back to original condition where you must hot unplug-plug in the usb gps device after sleep. sad, anyway I could not figure it out.

    So why can the usb mouse work after sleep? But the usb gps can not without unplugging and replugging?

  5. #25
    Join Date
    Dec 2006
    Beans
    Hidden!

    Re: wake from suspend issue with GPS and an already running gps client program

    I was also wondering maybe should SYMLINK+="gps%n" be changed to SYMLINK+="ttyGPS-lt20", and keep my symbolic link file

    current line in gpsd.rules that would apply to my usb gps
    Code:
    # Cypress M8/CY7C64013 (DeLorme LT-40)
    ATTRS{idVendor}=="1163", ATTRS{idProduct}=="0200", SYMLINK+="gps%n", RUN+="/lib/udev/gpsd.hotplug"
    I also wonder if the web page here is ignorant about the original purpose of this file to create a fixed symbolic link to the gps,
    so awaken from sleep, linux will keep the original name of the gps instead of making up a new name.
    http://code.ohloh.net/file?fid=lDt0s...lected=true#L0

    says
    Code:
    #
    # ## This file is obselete, and kept for historical records
    # ## only.  It documents alternate ways to use the (then) new
    # ## udev facility.
    #
    # ##  See the file   gpsd.rules   in the source for updated rules
    #

  6. #26
    Join Date
    Dec 2006
    Beans
    Hidden!

    Re: wake from suspend issue with GPS and an already running gps client program

    back at it, making progress.

    I was thinking about /lib/udev/rules.d/gpsd.rules conflicting with the rule file I created to create a fixed gps name.

    So I deleted /lib/udev/rules.d/gpsd.rules
    recreated my symbolic link file /etc/udev/rules.d/70-persistent-usb-gps.rules

    then
    sudo killall gpsd
    sudo dpkg-reconfigure gpsd

    point gpsd to use /dev/ttyGPS-lt20

    powered off and on and an improvement.
    I can start opencpn, sleep, awake, start xgps, and opencpn and xgps are getting data from gpsd


    I have a script i can put into suspend that will start xgps after awaken from sleep.

    BUT, still, putting the file /etc/udev/rules.d/70-persistent-usb-gps.rules, prevents sudo reboot from working.

    Any thoughts? should 70-persistent-usb-gps.rules, go into /lib/udev/rules.d ?

  7. #27
    Join Date
    Dec 2006
    Beans
    Hidden!

    Re: wake from suspend issue with GPS and an already running gps client program

    ok I moved my symbolic gps linked file 70-persistent-usb-gps.rules, into /lib/udev/rules.d

    put this file to start xgps after resume from sleep
    Code:
    #!/bin/bash
    # put in /etc/pm/sleep.d/xgps_awake_start
    
    USERID=boat
    SCRIPT="/usr/bin/xgps"
    
    case "$1" in
      suspend|hibernate)
         ;;
      resume|thaw)
        export DISPLAY=":0"
        export XAUTHORITY="/home/$USERID/.Xauthority"
        su $USERID -c "$SCRIPT"
         ;;
      *) exit $NA
         ;;  
    esac
    And it works!!!!!
    I suspend, I awake, xgps loads and gpsd starts sending gps data

    BUT BUT, doing this kills my LAN leaving it unconfigured.
    WHY??
    putting this file into either /etc/udev/rules.d/ or /lib/udev/rules.d/ kills my wired LAN so not networking.


    Any help would be nice as to why and what to do....
    Code:
    # 
    # Author: Fulup Ar Foll
    # Date:   26-jun-09
    # Object: make sure GPS dev (ex: /dev/gps-usb) dont change name on sleep/wakeup
    # -----------------------------------------------------------------------------
    #
    # 1) place this file in /etc/udev/rules.d
    # 2) use default config or update with your own vendor:product ID (use "lsusb" to find them)
    # 3) reload udev with "/etc/init.d/udev reload"
    #
    # Device alias can be:
    #  (default) - by path  ==> SYMLINK="serial-$env(ID_PATH)"   /dev/gps-pci-0000:00:1d.1-usb-0:1:1.0
    #            - static   ==> SYMLINK="gps-usb"                /dev/gps-usb
    #            - custom   ==> RUN+="/usr/local/bin/myscript"   /dev/any-thingk-you-want
    #
    # DEFAULT CONFIG: you can use this file "as it is", you should then see a /dev/gps-pci* 
    # that will be created for any of the serial/usb you hot-plug. The name is fixe but
    # depend on the USB port you use. As a result the name is fix until you keep the same socket.
    #
    # -----------------------------------------------------------------------
    # check "man 7 udev" for forther syntax. (search for %n)
    # -----------------------------------------------------------------------
    
    # Examples
    # -----------------------------------------------------------------------
    # Your own script:     SUBSYSTEM=="tty", ATTRS{idVendor}=="xxxx", ATTRS{idProduct}=="yyyy", RUN+="/usr/local/bin/myscript"
    # Static device name:  SUBSYSTEM=="tty", ATTRS{idVendor}=="xxxx", ATTRS{idProduct}=="yyyy", SYMLINK="gps-usb"
    # Path dependent name: SUBSYSTEM=="tty", ATTRS{idVendor}=="xxxx", ATTRS{idProduct}=="yyyy", SYMLINK="gps-$env{ID_PATH}"
    # In first case you do what ever you want, script receive the information about context in environement variables
    # In second case you name is fixe (ex: /dev/gps-usb) this is working if your usb/serial ID(vendor:product) is unique
    # In third case your device name depend on the port it is plugged in.
    
    
    # ========================================================================================
    #                          update YOUR CONFIG here after
    # ========================================================================================
    
    # Default rules is applied for any unspecified vendor:product devices
    # -----------------------------------------------------------------------------------------
    #SUBSYSTEM=="tty", ATTRS{idVendor}=="1163", ATTRS{idProduct}=="0200", SYMLINK="gps-$env{ID_PATH}"
    
    # Well known device may get a static device name 
    # -----------------------------------------------------------------------
    SUBSYSTEM=="tty", ATTRS{idVendor}=="10c4", ATTRS{idProduct}=="ea60", SYMLINK="ttyGPS-usb"
    SUBSYSTEM=="tty", ATTRS{idVendor}=="067b", ATTRS{idProduct}=="2303", SYMLINK="ttyGPS-rt650"
    SUBSYSTEM=="tty", ATTRS{idVendor}=="0483", ATTRS{idProduct}=="5740", SYMLINK="ttyGPS-ait2000"
    SUBSYSTEM=="tty", ATTRS{idVendor}=="1163", ATTRS{idProduct}=="0200", SYMLINK="ttyGPS-lt20"
    
    # ************************************************************************************
    # WARNING: on Ubuntu version version 13 and more. Standard user does not have acces
    #          to dialout group. In order to enable opencpn to access usb devices you
    #          should enter following command in a terminal:
    #       
    #          sudo usermod -a -G dialout $LOGNAME 
    #
    # ***************************************************************************************

  8. #28
    Join Date
    Dec 2006
    Beans
    Hidden!

    Re: wake from suspend issue with GPS and an already running gps client program

    I tried a solution from 2009, but that did not work.
    my lan driver is r8169
    http://ubuntuforums.org/showthread.php?t=1160802

    so still cant sudo reboot, and after i did this suggestion in the above thread, it will not power off shut down

  9. #29
    Join Date
    Dec 2006
    Beans
    Hidden!

    Re: wake from suspend issue with GPS and an already running gps client program

    running
    sudo service network-manger restart

    will bring up networking again.

    BUT, I found this gps solution has a time problem.
    If you sleep long time, then on awaken, gpsd is not sending any data.
    Crazy stuff going on I think!
    When was my last post? that is too long. It was one hour.
    Hotplugging will bring it up again. so what is going to sleep after an hour and not waking up?

  10. #30
    Join Date
    Dec 2006
    Beans
    Hidden!

    Re: wake from suspend issue with GPS and an already running gps client program

    Solution eventually fails inexplicably.
    Eventually stops suspending everytime in gnome to a complete failure to suspend.

    So I switch to ubuntu unity, and it works again for a while, then fails just like in gnome.
    It is doing some kind of checking and I think it eventually hits a threshhold of unexpected configuration and says that is is it, no more going to work for you.

    Frankly I dont have a clue. Looking at gpsd.rules that file always runs a linked udev hotplug script which I interupt with my rule/ I tried adding into my rule to run that hotplug rule but no help at all.

Page 3 of 3 FirstFirst 123

Bookmarks

Posting Permissions

  • You may not post new threads
  • You may not post replies
  • You may not post attachments
  • You may not edit your posts
  •