NEO M9N connection to ESP32 WROOM problem (I2C)

Hello, I have NEO M9N module and ESP32 WROOM board. I am trying to create communication via I2C using library:

sparkfun/SparkFun u-blox Arduino Library@^1.8.11.

The problem is that ESP32 with default Wire-lib settings (pins 21,22 SDA,SCL) cannot detect GPS module in I2C bus.

However, if I set these settings:

TwoWire I2C_1 = TwoWire(0);
  I2C_1.begin(22, 21, 400000);
  Wire=I2C_1;

The i2scanner detects GPS module using address 66 (0x42)

Then initializing u-blox library:

gps = myGPS.begin();

using the default Wire-settings, I get runtime error and cannot get communication.

The begin() method has 2 parameters, I am trying to set the TwoWire object;

gps = myGPS.begin(&I2C_1,66);

But this gives the following compilation error:

src/gps.h:81:36: error: conversion to non-const reference type ‘class TwoWire&’ from rvalue of type ‘TwoWire’ [-fpermissive]

gps = myGPS.begin(&I2C_1,66);

This line without the &-sign in I2C_1 compiles but I get run time error:

[ 2313][E][Wire.cpp:416] beginTransmission(): Unfinished Repeated Start transaction! Expected requestFrom, not beginTransmission! Clearing…

So my question is, how to set the u-blox library to use my custom I2C-settings ?

Kindly check your whole code A to Z. Here somebody saw the same error message. https://github.com/espressif/arduino-esp32/issues/5810

Hi, I managed to solve this problem ! I was using Sparkfun u-blox Arduino Library@^1.8.11.

But there is a new version with different name SparkFun u-blox GNSS Arduino Library @ ^2.2.21

Here

gps = myGPS.begin(&I2C_1,66);

compiles without errors and NEO M9 works as expected with my modified I2C settings !

Hi, I encountered the same issues as you as my expressif esp32 board cannot serial communicate with the neo m9n. My esp is saying that it cannot detect the gps module, mind sharing ur code to let me try out?