#include <SparkFun_u-blox_GNSS_v3.h>
SFE_UBLOX_GNSS_SERIAL myGNSS;
#define gpsSerial Serial2
void setup() {
Serial.begin(115200);
delay(1000);
Serial.println("Starting GPS...");
gpsSerial.begin(38400);
myGNSS.enableDebugging();
myGNSS.connectedToUART2();
while (myGNSS.begin(gpsSerial) == false) //Connect to the u-blox module using mySerial (defined above)
{
Serial.println(F("u-blox GNSS not detected"));
Serial.println(F("Attempting to enable the UBX protocol for output"));
myGNSS.setUART2Output(COM_TYPE_UBX); // Enable UBX output. Disable NMEA output
Serial.println(F("Retrying..."));
delay (1000);
}
}
//... loop code, but never reached here dus to not being able to communicate...
What I physically see; No blinking led for the fix (I do see power). I connected the RX and TX at the side of the module (so not at the opposit side of the SMA connector).
There is an external antenna connected to the module and has a clear sky view. The uBlox module has been bought 3 days ago.
I think you are getting your code examples mixed up?
Basics/Example12_UseUart will work on the MAX-M10S. Afterwards, the MAX-M10S UART1 baud rate will be set to 38400 baud and it will only output UBX messages. That example disables NMEA output on UART1.
The code you posted seems to be based on Example5_CustomSerial. That won’t work on the MAX-M10S. As Clive says, it has no UART2. From that example: “UART2 is only available on modules like the ZED-F9P/R/T/K etc… It is not available on the MAX-M10.”
Regarding the ESP32 serial port, please check you have the correct board and port selected. Are you using the Arduino IDE? Are you using the Espressif arduino-esp32 board package? Which version? Which “board” have you selected? I’m seeing some references to the “NodeMCU” TX2 and RX2 being pins 17 and 16. But “Serial2” will only work correctly if you have the correct board, port and pins selected. You may have to define the pins manually:
// In globals
HardwareSerial mySerial(1); // Use ESP32 UART1
int8_t myTxPin = 17; // GPIO pin for UART TX
int8_t myRxPin = 16; // GPIO pin for UART RX
// In setup
mySerial.begin(9600, SERIAL_8N1, myRxPin, myTxPin);
while (myGNSS.begin(mySerial) == false) //Connect to the u-blox module using mySerial
{
Serial.println(F("u-blox GNSS not detected"));
}
Thanks for the super fast answer, yep, now I see that I’ve been wrong and mixing up things (programming on a sunday evening isn’t the best idea lol)
The fix issue is I think due to the used antenna indeed, it’s a random chineese thing I had laying around, only things on it;
‘module: GPS-001’
‘voltage: 3v-5v’
‘frequency: 157.42MHz’
the antenna is placed next to a window (also placed it outside already, same result)
‘frequency: 157.42MHz’ makes no sense… 1575.42 would be correct for the L1 band.
Maybe that antenna is drawing too much current? The MAX-M10S breakout antenna power circuit includes a current-limit resistor, to prevent damage if the antenna cable is shorted. If your antenna is drawing more than 10mA, the voltage drop will be too high and will stop the active antenna from working. Maybe try a passive antenna, if you have one?
Hmm, well I also have an ANT-555 (mounted in my car) So that is a little bit more difficult to test with lol.
However I’ll try it out.
Do you have any kind of suggestion of external antenna atherwise? I’m looking for one on my car (thus magnetic base with protective feet) and around 3-5m cable.
The only real issue I see with the ANT-555 is it’s 1575.42 MHz only. It will give you GPS, SBAS, GALILEO, BEIDOU (B1C on M10’s), QZSS
GLONASS buys you perhaps another half-dozen satellites