Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

Bug when use with RTClib of adafruit #6

Open
DevDavisNunez opened this issue May 20, 2022 · 4 comments
Open

Bug when use with RTClib of adafruit #6

DevDavisNunez opened this issue May 20, 2022 · 4 comments

Comments

@DevDavisNunez
Copy link

Hello, I am trying to use this library in conjunction with the RTClib library, both use i2c, I have both devices connected in SDA and SCL, if I use them in the code separately there is no problem, but if I insert them in the code together Both libs and I try to use them have an error, the device address of this lib is 0x58 and of the rtc is 0x68, so I do not see an address conflict, could you support me, maybe I missed something.

` ioexp.begin();
Serial.println( "IO Expander: " + String(CNanoI2CIOExpander::initOk?"Ready":"Error") );
for(i = 0; i <= 10; i++){
ioexp.pinMode(i, OUTPUT);
}

if(!rtc.begin()){ // Init rtc module
	Serial.println("Error Couldn't find RTC Module");
	Serial.flush();
	//while (1) delay(10);
}  `
@DevDavisNunez
Copy link
Author

I don't know how but I made it work, I don't know what caused it, but it worked correctly again after disconnecting and reconnecting the rtc module, maybe the module was blocked.

@MajorLee95
Copy link
Owner

MajorLee95 commented May 20, 2022 via email

@DevDavisNunez
Copy link
Author

DevDavisNunez commented May 21, 2022

Hello I allready have this pb with DS3231 RTC clock. Sometimes it freezes and as it have a battery, chip can stays in this state when we do a power off followed by a power on. I find a bypass method on the web, bellow i2cRecovery function (source : https://forum.arduino.cc/t/ds3231-and-i2c-problem/576700/5 ):

Hello dear,
The solution he proposed was successful, after placing said function when losing communication with the rtc when starting, it runs and allows the program to work without problems, the strange thing is that the error is intermittent, during some reboots it works without blocking and in some others it does require the use of i2c_recovery();, but here the important thing is that now it always works on every start with that function,
Thank you very much, I'm still curious about what really generates this lock, maybe something at the hw level?

`if(!rtc.begin()){ // Init rtc module

Serial.println("Error Couldn't find RTC Module");

i2c_recovery(); // This maybe solved the bug of RTC Hold Cold

}`

@MajorLee95
Copy link
Owner

MajorLee95 commented May 21, 2022 via email

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
None yet
Projects
None yet
Development

No branches or pull requests

2 participants