piface / PiFace-Real-Time-Clock

Installation script for PiFace Real Time Clock.
MIT License
13 stars 13 forks source link

New direction to run PiFace #20

Open solsticedhiver opened 1 year ago

solsticedhiver commented 1 year ago

As of 2022, if anyone is reading this, this is what I am running on archlinuxarm for a rpi2.

First of all, you have to enable the load of i2c-dev module automatically by adding it to the /etc/modules-load.d/raspberrypi.conf

Secondly, you can configure it in /boot/config.txt with:

dtparam=i2c_arm=on
dtoverlay=i2c-rtc,mcp7941x=0x6f

You have to change the value passed to mcp7941x parameter. This usually done by checking the ouput of i2detect -y 1

This way, you don't have to run a script or service at boot to run command like echo <param> <value> > /sys/class/i2c-dev/i2c-$i/device/new_device

And you don't have to run the calibration command at every boot (i2cset -y 1 0x6f 0x08 0x47) because it will wipe the RTC clock and remove the time stored in it. This calibration has to be done only once, when you put the battery inside it.

That's all.