BlueWave Studio forum
  • Login
  • Register
  • Login Register
    Login
    Username:
    Password:
  • Home
  • Help
  • View Today's Post
  • More
    • BlueWave Studio
    • Shop
User Links
  • Login
  • Register
  • Login Register
    Login
    Username:
    Password:

    Quick Links Home Help View Today's Post
    More
    • BlueWave Studio
    • Shop
    BlueWave Studio forum OpenAuto Pro Real Time Clock (RTC) Syncing time with USB GPS (ublox 7020)

    Syncing time with USB GPS (ublox 7020)
    DSdavidDS
    Offline

    Junior Member

    Posts: 4
    Threads: 2
    Joined: Jan 2022
    Reputation: 0
    #1
    02-13-2022, 07:38 PM
    I know this isn't exactly RTC but I belive it is a solid alternative for those who have a GPS module. A lot of these steps are from the original blog post on photobyte.org referenced below but condensed down exactly what I needed to do.

    Prerequisite:
    - USB GPS Module (mine was from Amazon)
    - Open Auto Pro 5 (I used 14.0)
    - gpsd (OAP came with 3.17)
    - Access to pi's console. Most likely through SSH or keyboard.

    Step 1.
    Edit gpsd's configuration in /etc/default/gpsd. Not sure why but the line containing START_DAEMON="TRUE" needs to be commented out. I scoured the web for an explanation on why but I didn't find an answer. Maybe the OS just needs to update to the latest version of gpsd. Regardless, here are the lines your config should contain:

    #START_DAEMON=”true”
    USBAUTO=”true”
    DEVICES=”/dev/ttyACM0″
    GPSD_OPTIONS=”-n” 


    Note: Your "Devices" option might not be /dev/ttyACM0. You can find what it is after you plug in the GPS module and run "dmesg" in console.

    Step 2.
    Install Chrony. This is the better NTP service that works with gpsd (default timedatectl does not).
    $ sudo apt install -y chrony

    Step 3.
    Configure chrony to use the right gpsd interface (SHM0 in this case). Append "refclock SHM 0 offset 0.5 delay 0.2 refid " to the bottom of /etc/chrony/chrony.conf. 
    $ echo "refclock SHM 0 offset 0.5 delay 0.2 refid NMEA" | sudo tee -a /etc/chrony/chrony.conf

    Step 4.
    Restart chrony and gpsd. Easiest way to do this is to restart the pi but you should be able to just restart the services
    $ sudo systemcttl restart chrony
    $ sudo systemcttl restart gpsd
    OR 
    $ sudo reboot

    Step 5.
    Check for a gps lock. Depending on your location and view with thet sky, it my take some time to get a fix. You can use gpsmon or cgps
    $ cgps -s
    OR 
    $ gpsmon

    Step 6. 
    Verify chrony is using the correct GPSD interface. You should see "NMEA" on the list.
    $ chronyc sources -v


    References:
    - Best reference google could find regarding the gpsd issue with a simple addition to chrony's config: https://photobyte.org/raspberry-pi-stret...medatectl/
    - Official gpsd instructions (more in-depth and complicated but good information): https://gpsd.gitlab.io/gpsd/gpsd-time-se..._from_gpsd
    wkl3968
    Offline

    Member

    Posts: 111
    Threads: 18
    Joined: Jun 2021
    Reputation: 1
    #2
    02-14-2022, 02:35 PM
    thanks for the instructions. I'm still learning about RTC and I don't understand what is it for and what is the advantages for setting up RTC. can you anyone explain in simplest manner the benefit of RTC?
    DSdavidDS
    Offline

    Junior Member

    Posts: 4
    Threads: 2
    Joined: Jan 2022
    Reputation: 0
    #3
    02-17-2022, 06:29 AM
    (02-14-2022, 02:35 PM)wkl3968 Wrote: thanks for the instructions. I'm still learning about RTC and I don't understand what is it for and what is the advantages for setting up RTC. can you anyone explain in simplest manner the benefit of RTC?

    After computer turns off, there is no way for it to know how much time has passed since it last turned on. One hardware way to approach is to add a "Real Time Clock" which is essentially a piece of hardware that holds just enough power (either a capacitor or a battery) to time how much time has passed since losing power. Once the computer boots up, it can see how much time passed and add the difference since it last booted.

    My GPS approach is not RTC. Instead of dedicated hardware to time a clock, it is getting a GPS fix and getting time information from satelllites (in the same way a computer can get time information by connecting to the internet).
    « Next Oldest | Next Newest »

    Users browsing this thread: 1 Guest(s)



    • View a Printable Version
    • Subscribe to this thread
    Forum Jump:

    Home · Help · BlueWave Studio · Shop

    Copyright © bluewavestudio.io. All rights reserved.

    Linear Mode
    Threaded Mode