M5Stack core does not recognize the GPS module
-
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"));
}
} -
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/gpsI 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 -
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.