Skip to content

Instantly share code, notes, and snippets.

View solsticedhiver's full-sized avatar

solsTiCe d'Hiver solsticedhiver

View GitHub Profile
@solsticedhiver
solsticedhiver / 0_README.md
Created January 31, 2019 14:30 — forked from Lahorde/0_README.md
Initialize an external I2C RTC module on raspberry using udev and systemd

Description

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
#!/bin/bash
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 "$@"
#$@
}