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

A error i can't solve ([Errno 5] EIO) #9

Open
Maikelengelo opened this issue Sep 2, 2022 · 2 comments
Open

A error i can't solve ([Errno 5] EIO) #9

Maikelengelo opened this issue Sep 2, 2022 · 2 comments

Comments

@Maikelengelo
Copy link

I connected the DS3231 to my Pico: SDA to pin 16, SCL to pin 17, GND to GND and VCC to VSYS.
I copied the example code in main.py and put the RTC_DS3231.py in a my_lib folder. I didn't change any code.

When i tried to run the code I got the error: ([Errno 5] EIO) and when i tried Settime() in the example code I got:
Traceback (most recent call last):
File "", line 13, in
File "my_lib/RTC_DS3231.py", line 26, in DS3231_SetTime
OSError: [Errno 5] EIO

I tried to run a I2C address scan and got 0x57, but when a changed the address it still got the same error massages.

Does someone know how to solve this problem and make it work like intended?

@JoelGodin
Copy link

JoelGodin commented Sep 3, 2022

That address don't sound right. Try
def init(self, sda_pin=16, scl_pin=17, port=1, speed=100000, address=0x68, register=0x00):

Also, I loaded RTC_DS3231.py into the PICO via Thonny. No my_lib folder

@mrgcms01
Copy link

mrgcms01 commented Dec 6, 2022

Pretty sure the pin numbers refer to GPIO pin numbers. I've got mine connected up to device pins 11 and 12, GPIO 8 and 9 and I use this to initialize the RTC

rtc = RTC_DS3231.RTC(8,9,0,400000)

Try connecting to device pins 21 and 22 which are GPIO 16 and 17.

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

3 participants