Skip to content

Instantly share code, notes, and snippets.

@xiaozhuai
Last active September 7, 2023 13:31
Show Gist options
  • Save xiaozhuai/732b9396889442ea2cd861a04ce14e61 to your computer and use it in GitHub Desktop.
Save xiaozhuai/732b9396889442ea2cd861a04ce14e61 to your computer and use it in GitHub Desktop.
Raspberry pi + Alpine + ds3231

Install the RTC module on GPIO pins 1, 3, 5, 7

  1. Add or edit usercfg.txt and add
dtparam=i2c_arm=on
dtoverlay=i2c-rtc,ds3231
  1. Edit /etc/mkinitfs/mkinitfs.conf and add a feature rpirtc, then rebuild initramfs
mkinitfs
  1. Add hwclock service
rc-update del swclock boot
rc-update add hwclock boot
  1. Write current time
hwclock -w
  1. If alpine not install as sys mode, you need save your changes
lbu commit
  1. Reboot
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment