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

    M5Stack core does not recognize the GPS module

    PRODUCTS
    2
    3
    7.7k
    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.
    • M
      mawg
      last edited by

      Just getting started with M5Stack, so I connected the Core & the GPS module, and loaded the demo from the Arduino IDE.

      I saw no GPS reading on the display, so added some 'else' clauses (see code below) and see that the serial port is not available (nor is the GPS, naturally).

      Any idea what I am doing wrongly?

      (and, how do I post formetted code to this forum?)

      What does that HardwareSerial GPSRaw(2); mean?


      #include <M5Stack.h>

      HardwareSerial GPSRaw(2);

      void setup() {

      M5.begin();
      GPSRaw.begin(9600);

      Serial.println("hello");
      termInit();
      M5.Lcd.setTextFont(4);
      M5.Lcd.setCursor(50, 100, 4);
      M5.Lcd.println(("GPS Raw Example"));
      }

      void loop() {
      // put your main code here, to run repeatedly:
      if(Serial.available()) {
      int ch = Serial.read();
      GPSRaw.write(ch);
      }
      else
      {
      M5.Lcd.setCursor(50, 130, 4);
      M5.Lcd.println(("Serial not available"));
      }

      if(GPSRaw.available()) {
      int ch = GPSRaw.read();
      Serial.write(ch);
      termPutchar(ch);
      }
      else
      {
      M5.Lcd.setCursor(50, 160, 4);
      M5.Lcd.println(("GPS not available"));
      }
      }

      J 1 Reply Last reply Reply Quote 0
      • J
        jpk @mawg
        last edited by

        Hello,

        @mawg said in M5Stack core does not recognize the GPS module:

        Any idea what I am doing wrongly?

        If you use a M5Stack Fire, maybe you have enabled the PSRAM in the compile options of the arduino IDE (Tools ==> PSRAM)?
        As written here, this does not work with the GPS module:
        https://docs.m5stack.com/#/en/module/gps

        I have a M5Stack Fire & GPS Module (see also here: http://forum.m5stack.com/topic/1131/base-m5go-bottom-issues-with-uart-port-c) and your sketch works for me (= I see the GPS raw data).

        What does that HardwareSerial GPSRaw(2); mean?

        Google directly delivers information for this topic. Try to dig into it yourself, it seems you have some basic knowledge in coding. If you are still in trouble after some hours, come back to us :)

        BR
        jpk

        1 Reply Last reply Reply Quote 1
        • M
          mawg
          last edited by

          Thanx a 1,000,000 for taking the time to help me.

          Oops, my bad! I had also been playing with a Heltec 32 WiFi kit, and forgot to change the board (how embarrassing).

          I am still indoors, so will either need to use a battery or, perhaps, sit by the window to test GPS.

          At the moment, after a few seconds the software reports "Brownout detector was triggered" over serial, then reboots. I will investigate that & ask a new question if I can't solve it. Sorry to have taken your time.

          1 Reply Last reply Reply Quote 0
          • First post
            Last post