[USRP-users] GPSDO on usrp2

Dario Lombardo dario.lombardo.ml at gmail.com
Tue Jun 5 03:39:00 EDT 2012


Ryan

it compiles and runs perfectly. There's the output

$ ./test_gpsdo
linux; GNU C++ version 4.5.1 20100924 (Red Hat 4.5.1-4); Boost_104400;
UHD_003.004.002-128-g12f7a5c9


Creating the usrp device with: ...
-- Opening a USRP2/N-Series device...
-- Current recv frame size: 1472 bytes
-- Current send frame size: 1472 bytes
-- Found a Jackson Labs GPS
-- Setting references to the internal GPSDO
-- Initializing time to the internal GPSDO
Using Device: Single USRP:
  Device: USRP2 / N-Series Device
  Mboard 0: N210r4
  RX Channel: 0
    RX DSP: 0
    RX Dboard: A
    RX Subdev: RFX900 RX
  TX Channel: 0
    TX DSP: 0
    TX Dboard: A
    TX Subdev: RFX900 TX


Querying gps_time sensor...
Sensor output: GPS epoch time: 1338881388 seconds


Querying gps_locked sensor...
Sensor output: GPS lock status: locked


Querying ref_locked sensor...
Sensor output: Ref: unlocked


Querying gps_gpgga sensor...
 ensor output: GPS_GPGGA:
$GPGGA,072949.00,4506.7212,N,0740.3228,E,2,09,1.1,271.7,M,47.2,M,,*5C


Querying gps_gprmc sensor...
 ensor output: GPS_GPRMC:
$GPRMC,072950.00,A,4506.7212,N,0740.3228,E,1.1,0.0,050612,,*03


Querying gps_gpgsa sensor...
Error: LookupError: Path not found in tree: /mboards/0/sensors/gps_gpgsa

Which output should be taken into account, gps_locked, or ref_locked?
If ref_locked, I think that the "clear view of the sky" should be
improved... since a small roof out of my window could partially hide the
sky. I can try to move my equipment to the courtyard. Should it be useful?

On Mon, Jun 4, 2012 at 8:57 PM, Ryan Connelly
<ryan.connelly.6742 at gmail.com>wrote:

> The GPS antenna should have a clear unobstructed view of the sky. Also
> if the GPS antenna has a little metal dimple on one of its sides, it
> has to be facing up towards the sky.
>
> Here is a C++ program written by someone a while back to check GPS
> sensors. I don't know if it still works but that gives you an idea of
> how to query the sensor info. One of the sensors outputs the GGA info
> as an NMEA string. Here's a link to read the string:
> http://www.gpsinformation.org/dale/nmea.htm#GGA
>
>
> ---------------------file:
>
> test_gpsdo.cpp--------------------------------------------------------------------
> --------------------example compile: g++ -luhd
> -lboot_program_options-mt test_gpsdo.cpp -o test_gpsdo -------
> --------------------example usage: ./test_gpsdo --args
> "addr=192.168.10.2"-----------------------------------
>
> // author: Anonymous ( based on
> http://code.ettus.com/redmine/ettus/projects/uhd/repository/revisions
> //
> /6bd7281f83d5311675847b31746525841657c057/entry/host/examples/test_pps_input.cpp
> )
> // date: 2012/02/16
> // purpose: access gpsdo information (by querying all the gpsdo
> sensors) and output results to console
>
> #include <uhd/utils/thread_priority.hpp>
> #include <uhd/utils/safe_main.hpp>
> #include <uhd/usrp/multi_usrp.hpp>
> #include <boost/program_options.hpp>
> #include <boost/format.hpp>
> #include <boost/thread.hpp>
> #include <iostream>
> #include <complex>
>
> namespace po = boost::program_options;
> int UHD_SAFE_MAIN(int argc, char *argv[]){
>
>   uhd::set_thread_priority_safe();
>
>   //variables to be set by po
>   std::string args;
>
>   //setup the program options
>   po::options_description desc("Allowed options");
>   desc.add_options()
>       ("help", "help message")
>       ("args", po::value<std::string>(&args)->default_value(""),
> "single uhd device address args")
>   ;
>
>   po::variables_map vm;
>   po::store(po::parse_command_line(argc, argv, desc), vm);
>   po::notify(vm);
>
>   //print the help message
>   if (vm.count("help")){
>       std::cout << boost::format("UHD Test PPS Input %s") % desc <<
> std::endl;
>       return ~0;
>   }
>
>   //create a usrp device
>   std::cout << std::endl;
>   std::cout << boost::format("Creating the usrp device with: %s...")
> % args << std::endl;
>   uhd::usrp::multi_usrp::sptr usrp = uhd::usrp::multi_usrp::make(args);
>   std::cout << boost::format("Using Device: %s") %
> usrp->get_pp_string() << std::endl;
>
>       //query gpsdo sensors and output to console
>       //gps_time sensor
>       std::cout << std::endl << "Querying gps_time sensor..." << std::endl;
>       uhd::sensor_value_t val_gps_time =
> usrp->get_mboard_sensor("gps_time",0);
>       std::cout << boost::format("Sensor output: %s") %
> val_gps_time.to_pp_string() << std::endl << std::endl;
>       //gps_locked sensor
>       std::cout << std::endl << "Querying gps_locked sensor..." <<
> std::endl;
>       uhd::sensor_value_t val_gps_locked =
> usrp->get_mboard_sensor("gps_locked",0);
>       std::cout << boost::format("Sensor output: %s") %
> val_gps_locked.to_pp_string() << std::endl << std::endl;
>       //ref_locked sensor
>       std::cout << std::endl << "Querying ref_locked sensor..." <<
> std::endl;
>       uhd::sensor_value_t val_ref_locked =
> usrp->get_mboard_sensor("ref_locked",0);
>       std::cout << boost::format("Sensor output: %s") %
> val_ref_locked.to_pp_string() << std::endl << std::endl;
>       //gps_gpgga sensor
>       std::cout << std::endl << "Querying gps_gpgga sensor..." <<
> std::endl;
>       uhd::sensor_value_t val_gps_gpgga =
> usrp->get_mboard_sensor("gps_gpgga",0);
>       std::cout << boost::format("Sensor output: %s") %
> val_gps_gpgga.to_pp_string() << std::endl << std::endl;
>       //gps_gprmc sensor
>       std::cout << std::endl << "Querying gps_gprmc sensor..." <<
> std::endl;
>       uhd::sensor_value_t val_gps_gprmc =
> usrp->get_mboard_sensor("gps_gprmc",0);
>       std::cout << boost::format("Sensor output: %s") %
> val_gps_gprmc.to_pp_string() << std::endl << std::endl;
>       //gps_gpgsa sensor
>       std::cout << std::endl << "Querying gps_gpgsa sensor..." <<
> std::endl;
>       uhd::sensor_value_t val_gps_gpgsa =
> usrp->get_mboard_sensor("gps_gpgsa",0);
>       std::cout << boost::format("Sensor output: %s") %
> val_gps_gpgsa.to_pp_string() << std::endl << std::endl;
>
>       return 0;
> }
>
> -----------------------------------------------------------
>
>
> On Mon, Jun 4, 2012 at 2:19 PM, Dario Lombardo
> <dario.lombardo.ml at gmail.com> wrote:
> >
> >
> > On Mon, Jun 4, 2012 at 8:03 PM, Nick Foster <nick at ettus.com> wrote:
> >>
> >> I guess I suspect that you aren't getting a valid GPS signal.
> >
> >
> > It's what others have suggested. But I don't know how to improve it.
> >
> >>
> >> I'd suggest doing a little coding and checking the GPSDO lock status,
> >> probably easiest to modify the UHD examples.
> >
> >
> > Can you suggest one to start from?
> >
> >>
> >> What antenna are you using?
> >
> >
> > It's a GPS/GSM antenna (antennas are packed together, with separate
> cables
> > to go to the board).
> >
> >>
> >> Does it have a clear view of the sky?
> >
> >
> > More or less. I'm in a building and the usrp is in my office. Inside the
> > building I can't get the GPS signal, but I can get it close to my window
> (I
> > mean with other GPS equipments). I don't know how clean the GPS signal
> must
> > be caught.
> >
> > _______________________________________________
> > 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 at lists.ettus.com
> http://lists.ettus.com/mailman/listinfo/usrp-users_lists.ettus.com
>
-------------- next part --------------
An HTML attachment was scrubbed...
URL: <http://lists.ettus.com/pipermail/usrp-users_lists.ettus.com/attachments/20120605/5f574b0b/attachment-0002.html>


More information about the USRP-users mailing list