Help with the GPS module and M5Stack for AWS

  • 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 =;



    What I am doing wrong?

  • 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.


  • @felmue it worked flawless, thank you so much!