🤖Have you ever tried Chat.M5Stack.com before asking??😎
    M5Stack Community
    • Categories
    • Recent
    • Tags
    • Popular
    • Users
    • Groups
    • Search
    • Register
    • Login

    Invalid values on GPS unit

    Scheduled Pinned Locked Moved Units
    5 Posts 3 Posters 8.5k Views
    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.
    • O Offline
      oktawianito
      last edited by

      Hello, I am looking for some help here.

      I am using M5Stack Core 2 AWS - my problem is basicly no data recived form GPS unit conected on port C (13,14). For now i get only invalid values on port monitor and also by displaying on stack screen. I tried to use Arduino for programming this unit. Really i have no idea how to solve this problem - tryed many times.

      Thanks for any help in this topic

      1 Reply Last reply Reply Quote 0
      • felmueF Offline
        felmue
        last edited by

        Hello @oktawianito

        I think the M5Core2 example for the GPS unit has not been fully adapted from M5Stack to M5Core2. It seems that by default HardwareSerial for ESP32 uses GPIO16 and GPIO17 but as you already mentioned on M5Core2 GPIO13 and GPIO14 should be used.
        Try changing this line:

        ss.begin(GPSBaud);
        

        to

        ss.begin(GPSBaud, SERIAL_8N1, 13, 14);
        

        Thanks
        Felix

        GPIO translation table M5Stack / M5Core2
        Information about various M5Stack products.
        Code examples

        O 1 Reply Last reply Reply Quote 2
        • O Offline
          oktawianito @felmue
          last edited by

          Hello @felmue

          Thanks for your tips. After using them everything works correctly ;)

          1 Reply Last reply Reply Quote 1
          • F Offline
            falbriard
            last edited by falbriard

            M5Stack Core2 and GPS Module (my solution with UIFlow)

            I'm using a stackable GPS unit with external antenna. Under UIFLow I've configured it to TX=14 and RX=13 and its working.

            In order to get decimal return values for location data, which I need to transport into a MQTT publisher protocol, I wrote a conversion function in a “blockly” execute statement interpreted as MicroPython. Yes, yet missing some support for Altitude. Ideas for improvement of the logic are welcome.

            Hope this is helpful (see the code below):

            # GPS location conversion 
            # convert into decimal
            def conversion(inp):
                minus = False
                parts = inp.split('.')
                ddmm = parts[0]
                ss = parts[1]
                last_char = ss[-1]
                if (last_char == 'W') or (last_char == 'S'):
                    minus = True
                    # remove last character 
                    ss = ss[:-1]
                last_two_char = ddmm[-2:]
                mm = last_two_char
                if len(ddmm) == 3:
                    dd = ddmm[:1]
                if len(ddmm) == 4:
                    dd = ddmm[:2]        
                if len(ddmm) == 5:
                    dd = ddmm[:3]
                if minus:  
                    dd = int(dd) * -1  
                minf = float(mm + '.' + ss)
                secsmm = minf / 60
                # case South, or West invert 
                if minus: 
                    deci = float(dd - secsmm)
                else:
                    deci = float(dd + secsmm)
                
                return deci
            
            1 Reply Last reply Reply Quote 2
            • felmueF Offline
              felmue
              last edited by

              Hello @oktawianito

              good to hear. Thank you for reporting back. I appreciate it.

              Thanks
              Felix

              GPIO translation table M5Stack / M5Core2
              Information about various M5Stack products.
              Code examples

              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
              • First post
                Last post