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

    Help with the GPS module and M5Stack for AWS

    Scheduled Pinned Locked Moved Modules
    3 Posts 2 Posters 2.3k 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.
    • S Offline
      skhaz
      last edited by

      I have an M5Stack for AWS, and I have a GPS module connected to its port C. What is the index of the HardwareSerial I should use?

      I tried from 0 to 6, but I had no luck reading the data.

      HardwareSerial GPSRaw(2);
      
      void loop() {
        if (GPSRaw.available())
        {
          int ch = GPSRaw.read();
          Serial.write(ch);
        }
      }
      

      Connection

      0_1689279562359_cca83b01-1be3-489c-90d9-b56ed0be219a-telegram-cloud-photo-size-1-5008453422650862428-y.jpg

      What I am doing wrong?

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

        Hello @skhaz

        have a look at the M5Core2 GPS example. M5Core2 UART uses GPIO 13/14 whereas M5Stack uses GPIO 16/17. If GPSRaw.begin() is called w/o parameters then GPIO 16/17 are used by default. Try something like below to change the GPIOs:

        GPSRaw.begin(9600, SERIAL_8N1, 13, 14);
        

        BTW: Index 2 is fine.

        Thanks
        Felix

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

        1 Reply Last reply Reply Quote 0
        • S Offline
          skhaz
          last edited by

          @felmue it worked flawless, thank you so much!

          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