-
Notifications
You must be signed in to change notification settings - Fork 5.2k
(ds1307/ds3231) hwclock: ioctl(3, RTC_UIE_ON, 0): Invalid argument #3282
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
Comments
The error is caused by the lack of an interrupt signal from the RTC - the I and the E in RTC_UIE stand for Interrupt Enable. As you've discovered, that shouldn't stop the basic RTC functions working. |
I had the same error, and for me the cause was that the initial value for the month was 0x1f, which is neither BCD (as it is supposed to) nor a value somewhere within the proper range 8yes it is accidentaly decimal 31, but it was the month field). I finally took a python script that could write the system date and time via /dev/i2c, from this moment on everything worked as expected. |
@qjayjayp thanks for posting your note, as I was concerned about the same. What data is it that you're sending via i2c? Would you mind linking to your python script? |
@thraser Yes I looked it up, I used this old script from, 2013 (@XiErCh): https://gist.github.com/sorz/6049584 and commented in the 'write now' line 208. I've seen the code may got some improvements, it is mentioned here (https://www.switchdoc.com/2014/07/python-driver-ds1307-real-time-clock/) and put into a lib here (https://github.com/switchdoclabs/RTC_SDL_DS1307), but you can still use it the same way (ds1307.write_now()). |
Why has this been closed? This is an issue when using Chrony, for example: |
Answering in the Forums - please don't cross-post. |
This comment was marked as abuse.
This comment was marked as abuse.
When compiling a customer kernel with CONFIG_RTC_INTF_DEV_UIE_EMUL, the error 'hwclock: ioctl(3, RTC_UIE_ON, 0): Invalid argument' is gone. |
That could also be |
has this ever been solved? I have the exact same issue with an uputronics gps hat with rv3028. I couldn't find a follow-up discussion on the forums... |
I closed it because in my case, the RTC module I was using did not have an interrupt output connected - and as pelwell explained, the error message was effectively a warning about that being the case (albeit not a very obvious way of saying it). |
Thanks a lot. I compiled 6.1.11 and it worked perfectly. I can finally use chrony RTC drift monitoring functionality. |
Uh oh!
There was an error while loading. Please reload this page.
Describe the bug
When running hwclock on a Pi 4 with a DS3231 RTC, an "invalid argument" error occurs
Waiting for clock tick...
`ioctl(3, RTC_UIE_ON, 0): Invalid argument'
Additional context
Ultimately my problem with reading the clock was being caused by noise on the ground connection between the R-Pi and the clock chip.
The 'Invalid argment' is still occurring, but is non-fatal - many thanks to pelwell for the explanation below.
The text was updated successfully, but these errors were encountered: