<?xml version="1.0"?>
<feed xmlns="http://www.w3.org/2005/Atom" xml:lang="en">
	<id>https://wiki.alpinelinux.org/w/api.php?action=feedcontributions&amp;feedformat=atom&amp;user=Holesond</id>
	<title>Alpine Linux - User contributions [en]</title>
	<link rel="self" type="application/atom+xml" href="https://wiki.alpinelinux.org/w/api.php?action=feedcontributions&amp;feedformat=atom&amp;user=Holesond"/>
	<link rel="alternate" type="text/html" href="https://wiki.alpinelinux.org/wiki/Special:Contributions/Holesond"/>
	<updated>2026-05-10T02:59:38Z</updated>
	<subtitle>User contributions</subtitle>
	<generator>MediaWiki 1.40.0</generator>
	<entry>
		<id>https://wiki.alpinelinux.org/w/index.php?title=Setup_Hardware_Clock_(RTC)_Module_on_a_Raspberry_Pi&amp;diff=22966</id>
		<title>Setup Hardware Clock (RTC) Module on a Raspberry Pi</title>
		<link rel="alternate" type="text/html" href="https://wiki.alpinelinux.org/w/index.php?title=Setup_Hardware_Clock_(RTC)_Module_on_a_Raspberry_Pi&amp;diff=22966"/>
		<updated>2023-02-04T14:45:37Z</updated>

		<summary type="html">&lt;p&gt;Holesond: /* Install Software */&lt;/p&gt;
&lt;hr /&gt;
&lt;div&gt;= Install Hardware =&lt;br /&gt;
&lt;br /&gt;
I used a [http://www.piface.org.uk/products/piface_clock PiFace Real Time Clock]. After installing the CR1220 battery and correctly mounting on the board, [http://www.piface.org.uk/assets/piface_clock/PiFaceClockguide.pdf see manual] for that.&lt;br /&gt;
&lt;br /&gt;
= Install Software =&lt;br /&gt;
Add the modules from the kernel&lt;br /&gt;
&lt;br /&gt;
== /etc/modules/ ==&lt;br /&gt;
Add these modules so they&#039;re loaded on boot. You can modprobe each one individually if you don&#039;t want to reboot.&lt;br /&gt;
&lt;br /&gt;
&amp;lt;pre&amp;gt;i2c_dev&lt;br /&gt;
i2c_bcm2708&lt;br /&gt;
i2c:mcp7941x&amp;lt;/pre&amp;gt;&lt;br /&gt;
&lt;br /&gt;
== /media/mmcblk0p1/config.txt ==&lt;br /&gt;
You will need to mount this as read-write&lt;br /&gt;
&lt;br /&gt;
{{cmd|mount -o remount,rw /media/mmcblk0p1}}&lt;br /&gt;
&lt;br /&gt;
Add these two parameters to the bottom&lt;br /&gt;
&lt;br /&gt;
&amp;lt;pre&amp;gt;dtparam=i2c1=on&lt;br /&gt;
dtparam=i2c_arm=on&amp;lt;/pre&amp;gt;&lt;br /&gt;
&lt;br /&gt;
{{cmd|mount -o remount,ro /media/mmcblk0p1}}&lt;br /&gt;
&lt;br /&gt;
Then you will need to reboot.&lt;br /&gt;
&lt;br /&gt;
== Binding the hardware clock device ==&lt;br /&gt;
&lt;br /&gt;
You will want to make sure the device is created when hwclock starts, if it isn&#039;t already created. To the bottom of /etc/conf.d/hwclock add this:&lt;br /&gt;
&lt;br /&gt;
&amp;lt;pre&amp;gt;start_pre() {&lt;br /&gt;
    if [ -d &amp;quot;/sys/class/i2c-adapter/i2c-1/i2c-dev/i2c-1&amp;quot; ]; then&lt;br /&gt;
        einfo &amp;quot;Creating RTC device&amp;quot;;&lt;br /&gt;
        echo mcp7941x 0x6f &amp;gt; /sys/class/i2c-adapter/i2c-1/new_device&lt;br /&gt;
    fi&lt;br /&gt;
}&amp;lt;/pre&amp;gt;&lt;br /&gt;
&lt;br /&gt;
For the time being this is necessary but in the future when [https://github.com/raspberrypi/linux/issues/1032 issue 1032] you should be able to just add&lt;br /&gt;
&lt;br /&gt;
&amp;lt;pre&amp;gt;dtparam=i2c-rtc,mcp7941x&amp;lt;/pre&amp;gt; &lt;br /&gt;
&lt;br /&gt;
to /media/mmcblk0p1/config.txt&lt;br /&gt;
&lt;br /&gt;
== Starting hwclock on boot ==&lt;br /&gt;
The hwclock service needs to be started for the hardware clock device to actually do anything. Check if hwclock has been started by running this command:&lt;br /&gt;
&lt;br /&gt;
{{cmd|rc-status {{!}} grep hwclock}}&lt;br /&gt;
&lt;br /&gt;
If it outputs&lt;br /&gt;
&lt;br /&gt;
&amp;lt;pre&amp;gt; hwclock                                                           [  started  ]&amp;lt;/pre&amp;gt;&lt;br /&gt;
&lt;br /&gt;
hwclock has already started. Otherwise start it manually and add it to the default init.d runlevel, so that it starts at boot time:&lt;br /&gt;
&lt;br /&gt;
{{cmd|sudo rc-service hwclock start}}&lt;br /&gt;
{{cmd|sudo rc-update add hwclock default}}&lt;br /&gt;
&lt;br /&gt;
If you are running Alpine Linux in the diskless mode (non-persistent root filesystem), save the configuration by:&lt;br /&gt;
&lt;br /&gt;
{{cmd|sudo lbu commit -d}}&lt;br /&gt;
&lt;br /&gt;
[[Category:Hardware]]&lt;br /&gt;
[[Category:System Administration]]&lt;br /&gt;
[[Category:Raspberry]]&lt;/div&gt;</summary>
		<author><name>Holesond</name></author>
	</entry>
</feed>