Welcome to the Pycom forum Forum
    • \[\[global:header.categories\]\]
    • \[\[global:header.recent\]\]
    • \[\[global:header.tags\]\]
    • \[\[global:header.popular\]\]
    • Login

    Explore Pybytes | Official Documentation | Report a Firmware Bug/Issue | GitHub

    PyTrack slow parsing NMEA

    Scheduled Pinned Locked Moved Discussion
    5 Posts 2 Posters 50 Views 2 Watching
    Loading More Posts
    • Oldest to Newest
    • Newest to Oldest
    • Most Votes
    Reply
    • Reply as topic
    Log in to reply
    This topic has been deleted. Only users with topic management privileges can see it.
    • A Offline
      Alex Dew
      last edited by

      I have been using the gps library L76GNSV4.py from @andrethemac. I am running

      L76.get_location()
      L76.getUTCDateTime()
      L76.get_speed()
      

      in my 'while True:' loop, and it takes between 5 and 20 seconds to run each loop. Looking at the library, I can't figure out why it takes that long for those three things to parse.

      Also, I'm not sure if this delay is causing a bad connection, because I struggle to get more than 3 or 4 satellites when the unit is by the window (with the Adafruit gps next to it getting 10 satellites in the same spot).

      J 1 Reply Last reply Reply Quote 0
      • J Offline
        jcaron @Alex Dew
        last edited by

        @Alex-Dew That library does not cache any data, so anytime you call any of the functions, it has to wait for the next update sent by the chip. I believe the default rate is 1 Hz, so it should take about 3 seconds to go through the loop (depends on the relative order of the messages required by those calls and the messages send by the chip). It can take longer if there's no "fix" yet.

        Can you set debug to true when you instantiate L76GNSS?

        A 1 Reply Last reply Reply Quote 0
        • A Offline
          Alex Dew
          last edited by

          @jcaron Ok, thanks. I tried running them in threads but they weren't updating (even if I gave my main loop a 0.25 second sleep). Is there any way to update them without interfering with my sensors and other calculations?

          If I can get the unit to report just rmc and gga: PMTK314,0,1,0,1,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0 and just try to parse the info at the same time, it would only be waiting on two updates I guess, but that would still be too much time to see if there was a ~300ms action happening from a sensor/input.

          Yeah, I can turn on the debug. What should I be looking for?

          1 Reply Last reply Reply Quote 0
          • A Offline
            Alex Dew @jcaron
            last edited by

            @jcaron Thanks for pointing out that each of those calls waits for a new sentence. I switched to just calling the RMC and GGA sentences and parsing all at once.

            My problem with connection I have narrowed down to what must be an issue with the antenna. Even when Glonass and Galileo satellites are closer than GPS satellites that I'm locked on, they won't lock, so I only ever have between 4 and 6 satellites, all from the GPS constellation. I have set the PMTK353 to show all, but still only get GPS.

            J 1 Reply Last reply Reply Quote 0
            • J Offline
              jcaron @Alex Dew
              last edited by

              @Alex-Dew note that the L76-L only supports GPS and Glonass, not Galileo.

              1 Reply Last reply Reply Quote 0

              Hello! It looks like you're interested in this conversation, but you don't have an account yet.

              Getting fed up of having to scroll through the same posts each visit? When you register for an account, you'll always come back to exactly where you were before, and choose to be notified of new replies (either via email, or push notification). You'll also be able to save bookmarks and upvote posts to show your appreciation to other community members.

              With your input, this post could be even better 💗

              Register Login
              • 1 / 1
              • First post
                Last post

              Pycom on Twitter

              Pycom