I2C not working with RTClib using DS3231
twiereng opened this issue · comments
Hardware:
Board: ESP32 Dev Module and ESP32 Nodemcu CP2102 Module and
HiLetgo ESP-WROOM-32 ESP32 ESP-32S
Core Installation/update date: ?11/jul/2017?
IDE name: Arduino IDE
Flash Frequency: 80Mhz
Upload Speed: 921600
Description:
Doesn't appear to communicate with DS3231
Sketch:
// Init and get the time
configTime(gmtOffset_sec, daylightOffset_sec, ntpServer);
getLocalTime(&timeinfo);
Serial.print("In Setup - Time from Internet ");
Serial.print(timeinfo.tm_hour);
Serial.print(" : ");
Serial.print(timeinfo.tm_min);
Serial.print(" : ");
Serial.println(timeinfo.tm_sec);
iyear = timeinfo.tm_year;
bmonth = timeinfo.tm_mon;
bdayOfMonth = timeinfo.tm_mday;
bhour = timeinfo.tm_hour;
bminute = timeinfo.tm_min;
bsecond = timeinfo.tm_sec;
rtc.adjust(DateTime(iyear, bmonth, bdayOfMonth, bhour, bminute, bsecond));
// rtc.adjust(DateTime(F(DATE), F(TIME)));
// rtc.adjust(DateTime(2019, 1, 25, 20, 33, 30));
delay(10);
now_time = rtc.now();
bhour = now_time.hour();
bminute = now_time.minute();
last_sec = now_time.second();
Serial.print("In Setup - Time from RTC ");
Serial.print(bhour);
Serial.print(" : ");
Serial.print(bminute);
Serial.print(" : ");
Serial.println(last_sec);
Code above returns correct time from Internet and all 0's from DS3231. Added the 5 files from the patch - no different.
Thanks, Theron Wierenga
//Change the code below by your sketch
#include <Arduino.h>
void setup() {
}
void loop() {
}
### Debug Messages:
Enable Core debug level: Debug on tools menu of Arduino IDE, then put the serial output here
@twiereng This fork is out of date. Use the official repo. V1.0.1
There are some incompatibilities with standard Arduino libraries with this fork.
I am working on a new version with multithread and slave support. It will be base on the V1.0.1 release.
Chuck.
Ok, had a loose wire, tried again and it's working. Added BME280 also on I2C, seems to be working but I get this: [E][esp32-hal-i2c.c:1127] i2cProcQueue(): I2C exitCode=0x112
Not sure what it means.
Thanks, Theron Wierenga