Browse Source

Updated to do ; added very very very rough notes on i2c rtc support

master
KemoNine 2 years ago
parent
commit
6deaa1e5ec
2 changed files with 73 additions and 2 deletions
  1. +4
    -2
      TODO.md
  2. +69
    -0
      docs/armbian/rtc.md

+ 4
- 2
TODO.md View File

@@ -4,5 +4,7 @@ A bunch of stuff that really should be addressed and/or figured out. These items
## Future
- TT-RSS
- Radicale + InfCloud
- Look into TiddlyWiki as alternative to NextCloud notes add-on
- https://play.google.com/store/apps/details?id=de.mgsimon.android.andtidwiki&hl=en
- https://tiddlywiki.com/static/GettingStarted%2520-%2520Android.html
- https://tiddlywiki.com/

+ 69
- 0
docs/armbian/rtc.md View File

@@ -0,0 +1,69 @@
RTC

- most common
- high power
- most compatible
- most precise
- expensive
- same power as cheapest
- cheapest
- cheap
- same overall accuracy as most common
- lower power than most common


- super portable : most precise or cheapest
- most precise if no gps on build
- cheapest if using gps

- semi portable : most precise or cheapest
- most precise if no gps on build
- cheapest if using gps

- rv/permanent : most common or cheapest
- most common preferred for compatibility
- cheapest good enough if going with gps and/or persistent wan connection

# Setup / first run
armbian-config # enable i2c busses
systemctl reboot # reboot to enable bus(es)
apt install i2c-tools # install tools
i2cdetect -l # check to ensure busses are present
i2cdetect -y 0 # 0 for orange pi zero ; 1 for recent pi's
modprobe rtc-pcf8523 # load the proper rtc module
echo pcf8523 0x68 > /sys/class/i2c-adapter/i2c-0/new_device # setup device so it's seen
dmesg | grep rtc # verify the kernel sees the rtc
ls /dev/rtc* # should have rtc1
hwclock -f /dev/rtc1 --systohc -D --noadjfile --utc # set / init the rtc
hwclock -r -f /dev/rtc1 # read the value from the rtc
hwclock -w -f /dev/rtc1 # write the current time to the rtc
echo rtc-pfc8523 >> /etc/modules # auto-load module on boot
apt remove --purge fake-hwclock # purge the fake hwclock as we have a real one now

nano /etc/rc.local # setup the necessary bits on boot
# Init i2c rtc (this goes BEFORE exit)
echo pcf8523 0x68 > /sys/class/i2c-adapter/i2c-0/new_device
hwclock -s
# End rtc init

# setup udev rule to setup the new rtc as the primary for the board
# `udevadm info -a -p /sys/class/rtc/rtc1` gets the details for the below entries
cat > /etc/udev/rules.d/99-rtc1.rules <<EOF
KERNEL=="rtc1", SUBSYSTEM=="rtc", DRIVER=="", ATTR{name}=="rtc-pcf8523 0-0068", SYMLINK="rtc", MODE="0666"
EOF

https://learn.adafruit.com/adding-a-real-time-clock-to-raspberry-pi?view=all

https://www.raspberrypi.org/forums/viewtopic.php?t=20619

https://www.raspberrypi-spy.co.uk/2015/05/adding-a-ds3231-real-time-clock-to-the-raspberry-pi/

https://unix.stackexchange.com/questions/246605/how-can-the-link-target-of-dev-rtc-be-changed

https://www.adafruit.com/product/3296

https://www.adafruit.com/product/3295

https://www.adafruit.com/product/3013

https://www.raspberrypi.org/forums/viewtopic.php?t=85683

Loading…
Cancel
Save