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 ?