Skip to content

Instantly share code, notes, and snippets.


solsTiCe d'Hiver solsticedhiver

View GitHub Profile
solsticedhiver /
Created Jan 31, 2019 — forked from Lahorde/
Initialize an external I2C RTC module on raspberry using udev and systemd


Enable i2c RTC using systemd. A udev rules triggers an I2C systemd service on I2C kernel module adding. Service then loads I2C driver adding a new I2C device to /sys Then kernel loads I2C RTC driver and adds an RTC device It triggers a udev rules that updates hardware clock

Application on raspberry pi

Enable I2C

  • enable I2C in config.txt, adding device_tree_param=i2c1=on
set -e
export IFS='
# that's a dangerous script to run because it removes all your snaps. Don't do that
function echo_cmd() {
echo "$@"
You can’t perform that action at this time.