Trouble getting Sparkfun ublox GNSS library working with LilyGO T-Beam

Hi, I recently bought this [LILYGO T-Beam. It has a u-blox NEO-6M GPS chip. The LILYGO github repository has examples that make use of Sparkfun’s older GPS library, which has been deprecated. I have a Thing Plus C that uses the newer GNSS library correctly with its u-blox chip. Here is a small example sketch that works correctly on the Thing Plus, but displays the error message on the LILYGO.

#include <Wire.h> //Needed for I2C to GPS
#include <SparkFun_u-blox_GNSS_Arduino_Library.h> //Click here to get the library:  http://librarymanager/All#SparkFun_u-blox_GNSS
SFE_UBLOX_GNSS myGNSS;

void setup() {
  Serial.begin(115200);
  Serial.println("GPS starting!");
  Wire.begin();
  if (myGNSS.begin() == false) {
    Serial.println(F("u-blox GNSS module not detected at default I2C address. Please check wiring. Freezing."));
    while (1);
  }
  myGNSS.setNMEAOutputPort(Serial);
}

void loop() {
  myGNSS.checkUblox(); //See if new data is available. Process bytes as they come in.
}

Does anyone here have experience using this LILYGO or their other Arduino boards?

Thanks for any help.](Amazon.com)

Hi Matt,

Please see: viewtopic.php?p=237263#p237263 . Sounds like the same issue?

I hope this helps,

Paul

Also, please check that it does have a genuine u-blox NEO-M6 chip on it. I’m not seeing the u-blox logo on the link you posted. If it has a cloned chip on it, it may not support the UBX protocol correctly. NMEA may be all you can get out of it…

Here’s a photo of my board.

PaulZC:
Hi Matt,

Please see: viewtopic.php?p=237263#p237263 . Sounds like the same issue?

I hope this helps,

Paul

Following that lead to see what an I2C scanner would find I have been using this sketch. It doesn’t matter if I specify values in Wire.begin() or not, it always returns the same thing.

19:03:59.733 → I2C scanner. Scanning …

19:03:59.733 → Found address: 52 (0x34)

19:03:59.766 → Done.

19:03:59.766 → Found 1 device(s).

// I2C Tester
// Written by Nick Gammon
// Date: 20th April 2011

#include <Wire.h>

void setup() {
  Serial.begin (115200);

  // Wait for serial port to connect
  while (!Serial) 
    {
    }

  Serial.println ();
  Serial.println ("I2C scanner. Scanning ...");
  byte count = 0;

  Wire.begin();  // for T-Beam pass SDA and SCL GPIO pins
  for (byte i = 8; i < 120; i++)
  {
    Wire.beginTransmission (i);
    if (Wire.endTransmission () == 0)
      {
      Serial.print ("Found address: ");
      Serial.print (i, DEC);
      Serial.print (" (0x");
      Serial.print (i, HEX);
      Serial.println (")");
      count++;
      delay (1);  // maybe unneeded?
      } // end of good response
  } // end of for loop
  Serial.println ("Done.");
  Serial.print ("Found ");
  Serial.print (count, DEC);
  Serial.println (" device(s).");
}  // end of setup

void loop() {}

Is it possible that this GPS isn’t connected to the I2C bus at all? I did manage to get [one of their examples running, but it’s using the serial pins of 34 and 12.](LilyGo-LoRa-Series/lib/TinyGPSPlus/examples/FullExample/FullExample.ino at master · Xinyuan-LilyGO/LilyGo-LoRa-Series · GitHub)

Hi Matt,

That NEO chip certainly looks genuine.

Looking at the schematic - https://github.com/Xinyuan-LilyGO/LilyG … m_V1.2.pdf - I am seeing GSCL and GSDA connections between the NEO and a 24AA32A EEPROM. But it looks like they are not connected to the microcontroller. I guess you’re stuck with Serial…

Cheers,

Paul

Thanks for confirming that, Paul. On paper this board looks almost to good to be true: LoRa, GPS, Wifi, bluetooth, and a fair amount of memory all for $43. It looks like a capable board, but my experience with it so far has been less that enjoyable.

Thanks again!

PaulZC:
Hi Matt,

That NEO chip certainly looks genuine.

Looking at the schematic - https://github.com/Xinyuan-LilyGO/LilyG … m_V1.2.pdf - I am seeing GSCL and GSDA connections between the NEO and a 24AA32A EEPROM. But it looks like they are not connected to the microcontroller. I guess you’re stuck with Serial…

Cheers,

Paul

Hi, Paul. Would you suspect that the NEO could be a clone because of the lack of I2C connections to the microcontroller?

Thanks again,

-Matt

Hi Matt,

No, I don’t think so. I think it’s purely a design choice. Google found me a copy of the NEO-6M Integration Guide. That shows how to connect an external EEPROM:

Also, the Manual says:

"u-blox 6 GPS receivers normally run in I2C slave mode. Master Mode is only supported when external EEPROM is used to store configuration. No other nodes may be connected to the bus. In this case, the receiver attempts to establish presence of such a non-volatile memory component by writing and reading from a specific location. "

So, with the EEPROM connected, you can’t communicate with the module via I2C.

It’s been a while, but the deprecated version of our library should still work OK - and does support Serial:

https://github.com/sparkfun/SparkFun_Ub … Series_6_7

Excellent! Thank you. I’ll keep experimenting with this board. I’ve read reviews that range from “This is a piece of junk with cloned parts that don’t work” to “I bought a bunch of these to use with Meshtastic and they all worked out of the box and will probably save my family’s lives when the grid fails but we can still text each other!”

Cheers,

-M@