The first command instructs the I2C adapter that there is a device at address 0x68 and to match it with an I2C driver “ds1307”. When the driver loads, it creates a new /dev/rtcX device (and also a new /sys/class/rtc/rtcX device). The beaglebone kernel includes the driver for this device. Which pins are you using? Have you set the pin mux for I2C? Can you read any of the files at /sys/class/rtc/rtc1/* ?
If the driver is loading, it’s very unlikely the hardware is setup incorrectly. I will tell you from hands on, if you manually load your RTC driver like this. You may have to write to the RTC, before reading from it. Otherwise you’ll experience that error, or one similar to it.
your thoughts and hints helped me a bit and I think it´s running fine now.
@David:
I2C was setup correctly. I can read and write all the registers manualy with the i2c tools.
@Willian:
Just as you thought, after I wrote to the RTC I don´t get the error when reading anymore, thanks.
When i wrote the time to the RTC for the first time with
hwclock -w -f /dev/rtc1
I got the same error although it´s working fine.
hwclock: ioctl(RTC_RD_TIME) to /dev/rtc1 to read the time failed: Invalid argument