[prev in list] [next in list] [prev in thread] [next in thread] 

List:       usrp-users
Subject:    [USRP-users]  Getting GPSDO NMEA sentences once per second
From:       Andy Walls via USRP-users <usrp-users () lists ! ettus ! com>
Date:       2014-08-25 19:09:19
Message-ID: 1408993759.10671.82.camel () localhost
[Download RAW message or body]

Hi Michael and Sean,

I've found myself fighting with the UHD NMEA string caching with the
X310.

I didn't change the UHD algorithms at all, but I have to fight with it
something like this in a loop triggered by the PPS:

            // Measuring with an oscilloscope, we know that the X310's GPSDO has finished
            // outputting its NMEA sentences over its serial port by 13 msec after the PPS edge.
            // Let's wait at least twice as long to be sure the X310 has received it internally.
            boost::this_thread::sleep(boost::posix_time::milliseconds(13 * 2));

            // Getting "gps_time" fetches a new GPRMC sensor string if last one was older
            // than 10 msec, and it forces an update of the GPGGA sensor string as well.
            // gps_time is a decoding of the text date and UTC fields in $GPRMC.
            uhd::sensor_value_t gps_time   = d_uhd_dev->get_mboard_sensor("gps_time",  0);
            uhd::sensor_value_t rmc_string = d_uhd_dev->get_mboard_sensor("gps_gprmc", 0);
            uhd::sensor_value_t gga_string = d_uhd_dev->get_mboard_sensor("gps_gpgga", 0);


(I have the PPS signal fed to my host PC's serial port DCD line.)

It would be really nice, if the caller could tell the UHD *not* to use
cached values when fetching the NMEA strings.  A $GPRMC collected late
in the last second could remain "fresh" until well into the next second,
IIRC.

BTW, the X310 transferring one NMEA string character per UDP packet
makes retrieving the NMEA strings take a bit of time. 

Regards,
Andy

Michael West wrote:
> Hi Sean,
> 
> I do believe you may be on to something, but simply reducing the
> GPS_NMEA_NORMAL_FRESHNESS may not be the right solution.  I think we may
> need a change to the algorithm.  The algorithm should be to check for new
> NMEA strings multiple times within the freshness period, but limit the
> number of checks per freshness period to avoid excessive communication with
> the device, and fall back on cached values if they are still fresh enough.
> An empty string should only be returned if the freshness period expires
> completely.  I have attached a (untested) patch for you to try.  Give it a
> shot and let me know if it solves your problem.  If so, we will see what we
> can do to merge it into UHD.
> 
> Best regards,
> Michael E. West
> Senior Software Design Engineer
> Ettus Research
> www.ettus.com
> 
> 
> On Sat, Jul 19, 2014 at 11:08 PM, Nowlan, Sean via USRP-users <
> usrp-users at lists.ettus.com> wrote:
> 
> >  ​Is there anybody at Ettus that can comment on reducing the
> > GPS_NMEA_NORMAL_FRESHNESS threshold to 750 ms from 1000 ms to allow 1 Hz
> > NMEA sentence collection?
> >
> >  ------------------------------
> > *From:* USRP-users <usrp-users-bounces at lists.ettus.com> on behalf of
> > Nowlan, Sean via USRP-users <usrp-users at lists.ettus.com>
> > *Sent:* Tuesday, July 15, 2014 2:04 PM
> > *To:* USRP-users at lists.ettus.com
> > *Subject:* [USRP-users] Getting GPSDO NMEA sentences once per second
> >
> >
> > Hi all,
> >
> >
> >
> > I'm trying to write a routine that can fetch GPGGA and GPRMC NMEA
> > sentences once per second from the Firefly 1-A device on an N200. I notice
> > that GPS sensor caching has been implemented in UHD
> > (uhd/host/lib/usrp/gps_ctrl.cpp) to reduce the blocking effects of
> > get_mboard_sensor calls for GPS sensors. I have a loop that fetches both
> > sensors once per second. Example code is here:
> > https://gist.github.com/anonymous/ba86a35acc54fefd84b5
> >
> >
> >
> > Every 4 seconds the NMEA timestamps skip one second. I think this is due
> > to GPS_NMEA_NORMAL_FRESHNESS = 1000 milliseconds in
> > uhd/host/lib/usrp/gps_ctrl.cpp. When I changed this to 750 milliseconds and
> > recompiled UHD, I was able to reliably get GPGGA and GPRMC sentences once
> > per second. I think this change should be made in UHD mainline. Do the UHD
> > developers have any reason not to make this change?
> >
> >
> >
> > Thanks,
> >
> > Sean
> >
> > _______________________________________________
> > USRP-users mailing list
> > USRP-users at lists.ettus.com
> > http://lists.ettus.com/mailman/listinfo/usrp-users_lists.ettus.com
> >
> >



_______________________________________________
USRP-users mailing list
USRP-users@lists.ettus.com
http://lists.ettus.com/mailman/listinfo/usrp-users_lists.ettus.com

[prev in list] [next in list] [prev in thread] [next in thread] 

Configure | About | News | Add a list | Sponsored by KoreLogic