element14 Community
element14 Community
    Register Log In
  • Site
  • Search
  • Log In Register
  • About Us
  • Community Hub
    Community Hub
    • What's New on element14
    • Feedback and Support
    • Benefits of Membership
    • Personal Blogs
    • Members Area
    • Achievement Levels
  • Learn
    Learn
    • Ask an Expert
    • eBooks
    • element14 presents
    • Learning Center
    • Tech Spotlight
    • STEM Academy
    • Webinars, Training and Events
    • Learning Groups
  • Technologies
    Technologies
    • 3D Printing
    • FPGA
    • Industrial Automation
    • Internet of Things
    • Power & Energy
    • Sensors
    • Technology Groups
  • Challenges & Projects
    Challenges & Projects
    • Design Challenges
    • element14 presents Projects
    • Project14
    • Arduino Projects
    • Raspberry Pi Projects
    • Project Groups
  • Products
    Products
    • Arduino
    • Avnet Boards Community
    • Dev Tools
    • Manufacturers
    • Multicomp Pro
    • Product Groups
    • Raspberry Pi
    • RoadTests & Reviews
  • Store
    Store
    • Visit Your Store
    • Choose another store...
      • Europe
      •  Austria (German)
      •  Belgium (Dutch, French)
      •  Bulgaria (Bulgarian)
      •  Czech Republic (Czech)
      •  Denmark (Danish)
      •  Estonia (Estonian)
      •  Finland (Finnish)
      •  France (French)
      •  Germany (German)
      •  Hungary (Hungarian)
      •  Ireland
      •  Israel
      •  Italy (Italian)
      •  Latvia (Latvian)
      •  
      •  Lithuania (Lithuanian)
      •  Netherlands (Dutch)
      •  Norway (Norwegian)
      •  Poland (Polish)
      •  Portugal (Portuguese)
      •  Romania (Romanian)
      •  Russia (Russian)
      •  Slovakia (Slovak)
      •  Slovenia (Slovenian)
      •  Spain (Spanish)
      •  Sweden (Swedish)
      •  Switzerland(German, French)
      •  Turkey (Turkish)
      •  United Kingdom
      • Asia Pacific
      •  Australia
      •  China
      •  Hong Kong
      •  India
      •  Korea (Korean)
      •  Malaysia
      •  New Zealand
      •  Philippines
      •  Singapore
      •  Taiwan
      •  Thailand (Thai)
      • Americas
      •  Brazil (Portuguese)
      •  Canada
      •  Mexico (Spanish)
      •  United States
      Can't find the country/region you're looking for? Visit our export site or find a local distributor.
  • Translate
  • Profile
  • Settings
Raspberry Pi
  • Products
  • More
Raspberry Pi
Raspberry Pi Forum Difficulties using NTP with a GPS + Raspberry Pi (HELP!)
  • Blog
  • Forum
  • Documents
  • Quiz
  • Events
  • Polls
  • Files
  • Members
  • Mentions
  • Sub-Groups
  • Tags
  • More
  • Cancel
  • New
Join Raspberry Pi to participate - click to join for free!
Featured Articles
Announcing Pi
Technical Specifications
Raspberry Pi FAQs
Win a Pi
Raspberry Pi Wishlist
Actions
  • Share
  • More
  • Cancel
Forum Thread Details
  • Replies 7 replies
  • Subscribers 666 subscribers
  • Views 2239 views
  • Users 0 members are here
  • raspberry_pi
Related

Difficulties using NTP with a GPS + Raspberry Pi (HELP!)

vk3pb
vk3pb over 12 years ago

Hi all

 

I have been asking around for help on other forums with this problem but noone has come up with a solution thus far. I hope that someone out there can help.

 

I am trying to get my model B pi to work with a bu-353 GPS. I have achieved some success but I can't get ntp to automatically fetch the time on boot.

 

I followed the instructions here

 

http://blog.retep.org/2012/06/18/getting-gps-to-work-on-a-raspberry-pi/

 

but found that I needed to make a few modifications to get cgps working

 

Here's what I did

 

sudo apt-get install gpsd gpsd-clients python-gps

 

I then ran

 

sudo dpkg-reconfigure /etc/gpsd

 

to set gpsd to automatically boot. I added -n in the options but didn't put in  /dev/ttyUSB0 as the port but rather left it to automatically find the USB plug.

 

I then manually edited GPSD and added in

 

chmod a+rw /dev/ttyUSB0

 

The reason for these two tweaks is that the gps was not loading up properly and cgps -s just waited a few seconds and went back to the command line. The tweaks seem to have fixed that.

 

Now if I start my pi and then put in the comamnd line

 

cgps -s

 

I can see what the gps is seeing, location information sats etc all in text format. If I run xgps I can see a graphical version of this. This works every time although can take a coupel of seconds to get a fix.

 

So far so good.

 

Per the web page I now proceed to try and set up ntp

 

sudo apt-get install ntp

Installation is probably unnecessary as ntp is already installed.

 

Now I go to the /etc directory and sudo nano ntp.conf and add in the following lines

 

# gps ntp
server 127.127.28.0 minpoll 4
fudge  127.127.28.0 time1 0.183 refid NMEA
server 127.127.28.1 minpoll 4 prefer
fudge  127.127.28.1 refid PPS

 

and then type

 

sudo service ntp restart

 

Ntp restarts. cgps-s continues to work ok but my time does not update like it should. Although I can get a fix on satellites and can see the time in cgps it doesn;t get picked up by NTP like it should.

 

How can I get NTP to load up the time from satellites at boot properly with the above setup? I would be grateful for some help as I am a beginner at Linux and I think a lot of people out there would like to know how to set up a cheap gps like this with the Pi.

 

Thanking you

  

Peter

  • Sign in to reply
  • Cancel
Parents
  • Former Member
    Former Member over 12 years ago

    Perhaps you may find something useful in my own notes about getting NTP working:

     

      http://www.satsignal.eu/ntp/Raspberry-Pi-NTP.html

     

    I see you mention PPS, but it's not clear how you are getting the PPS signal into your device.


    David

    • Cancel
    • Vote Up 0 Vote Down
    • Sign in to reply
    • Cancel
  • vk3pb
    vk3pb over 12 years ago in reply to Former Member

    Thanks all

     

    I have seen all these pages.

     

    The good news is that I can now set my system clock from my gps but I do so using a python module called gps-time I found.In due course I'll publish how I got it working.

     

    In the meantime I'm working on getting my gps to pass variables to python for use in steering my boat. I tried to run Peter Mount's code on my Pi but ran into problems. I have just got a reply to my a post I put on the main Raspberry Pi forums and it appears that I have fallen into teh 'naming trap' whatevr that is and i just need to rename my code.

     

    Once I have ironed out this all I'll put a post up on both forums explaining how I was able to get it all working so that others dont have as much difficulty.

    • Cancel
    • Vote Up 0 Vote Down
    • Sign in to reply
    • Cancel
Reply
  • vk3pb
    vk3pb over 12 years ago in reply to Former Member

    Thanks all

     

    I have seen all these pages.

     

    The good news is that I can now set my system clock from my gps but I do so using a python module called gps-time I found.In due course I'll publish how I got it working.

     

    In the meantime I'm working on getting my gps to pass variables to python for use in steering my boat. I tried to run Peter Mount's code on my Pi but ran into problems. I have just got a reply to my a post I put on the main Raspberry Pi forums and it appears that I have fallen into teh 'naming trap' whatevr that is and i just need to rename my code.

     

    Once I have ironed out this all I'll put a post up on both forums explaining how I was able to get it all working so that others dont have as much difficulty.

    • Cancel
    • Vote Up 0 Vote Down
    • Sign in to reply
    • Cancel
Children
No Data
element14 Community

element14 is the first online community specifically for engineers. Connect with your peers and get expert answers to your questions.

  • Members
  • Learn
  • Technologies
  • Challenges & Projects
  • Products
  • Store
  • About Us
  • Feedback & Support
  • FAQs
  • Terms of Use
  • Privacy Policy
  • Legal and Copyright Notices
  • Sitemap
  • Cookies

An Avnet Company © 2025 Premier Farnell Limited. All Rights Reserved.

Premier Farnell Ltd, registered in England and Wales (no 00876412), registered office: Farnell House, Forge Lane, Leeds LS12 2NE.

ICP 备案号 10220084.

Follow element14

  • X
  • Facebook
  • linkedin
  • YouTube