DS1307 Weird Behavior after removing INA219

I have a arduino uno r3 connected to a microsd writer + ds1307 RTC (wemos d1 mini datalogger), as well as a INA219 current/voltage sensor. They were working flawlessly until my INA219 died.

When I removed the INA219 lines from the code, the DS1307 stopped working properly (if I put those lines back, DS1307 works. Here is my code:

#include <Wire.h>
#include <RTClib.h> //INCLUSÃO DA BIBLIOTECA
#include <SD.h>
#include <SPI.h>
#include <Adafruit_INA219.h>

RTC_DS1307 rtc; //OBJETO DO TIPO RTC_DS1307
Adafruit_INA219 ina219;

const int OnHour = 5; //SET TIME TO ON RELAY (24 HOUR FORMAT)
const int OnMin = 30;
const int OffHour = 18; //SET TIME TO OFF RELAY
const int OffMin = 45;
File sdcard_file;
int CS_pin = 10; // Pin 10 on Arduino 
int Relay = 4;
long interval = 600; // Intervalo do LOG em segundos
long antes = 0;
long agora = 0;
float Vout = 0.0;
int voltageSensor = A3;
int value = 0;

void setup () {
  Serial.begin(9600); //INICIALIZA A SERIAL
  pinMode(Relay, OUTPUT);
  pinMode(8, OUTPUT);
  pinMode(9, OUTPUT);
  digitalWrite(Relay, LOW);
  ina219.begin();
    if (SD.begin())
  {
    Serial.println("SD card is ready to use.");
  } else
  {
    Serial.println("SD card initialization failed");
    return;
  }
  }

In the above code, I am referring to lines “#include <Adafruit_INA219.h>”, “Adafruit_INA219 ina219;” and “ina219.begin();”.

When I remove, arduino simply cannot get the time from DS1307, but the sd reader keeps working.

As my wemos d1 minidatalogger does not have pull up resistors onboard, my guess is that that part of the code somehow solve the pull up problem.

I would like to remove that part of the code and have everything working. Any help?

RTC_DS1307 rtc;

Try adding rtc.begin() to setup. Wire.begin() is called there. The wire library most likely enables the internal pullups of the Wemos i/o pins. You can also set the i2c bus pins using INPUT_PULLUP.

If the Wire library does not work properly from within RTCLib, try using and explicit call to Wired.begin() with the i2c bus pins of the D1 mini.

Thanks! rtc.begin() solved right away...my bad.