<commit_before>With Raspberry: 

Setup I2C: http://www.raspberrypi-spy.co.uk/2014/11/enabling-the-i2c-interface-on-the-raspberry-pi/

sudo raspi-config -> Advanced Options -> I2C -> Yes -> Reboot

sudo apt-get update
sudo apt-get install -y python-smbus i2c-tools

Check if I2C enable: lsmod | grep i2c

Check if DS3231 detected: sudo i2cdetect -y 1 (0 for old Rpi)

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

apt-get upgrade

/etc/modules:

snd-bcm2835
i2c-bcm2835
i2c-dev
rtc-ds1307

HW setup:

DS1307	Pi GPIO
GND	P1-06
Vcc	P1-01 (3.3V)
SDA	P1-03 (I2C SDA)
SCL	P1-05 (I2C SCL)

Test: sudo i2cdetect -y 1

number 68 should be seen

Then in root (sudo bash):

echo ds1307 0x68 > /sys/class/i2c-adapter/i2c-1/new_device
ntpq -p (make sure time is sync and up to date)
hwclock -w --localtime (localtime is important)

Warning : When plugging or removing DS32321 to Rpi always do it when RPi is OFF and power removed.
<commit_msg>Added i2c commands for RPi check/set of DOW of RTC<commit_after>With Raspberry: 

Setup I2C: http://www.raspberrypi-spy.co.uk/2014/11/enabling-the-i2c-interface-on-the-raspberry-pi/

sudo raspi-config -> Advanced Options -> I2C -> Yes -> Reboot

sudo apt-get update
sudo apt-get install -y python-smbus i2c-tools

Check if I2C enable: lsmod | grep i2c

Check if DS3231 detected: sudo i2cdetect -y 1 (0 for old Rpi)

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

apt-get upgrade

/etc/modules:

snd-bcm2835
i2c-bcm2835
i2c-dev
rtc-ds1307

HW setup:

DS1307	Pi GPIO
GND	P1-06
Vcc	P1-01 (3.3V)
SDA	P1-03 (I2C SDA)
SCL	P1-05 (I2C SCL)

Test: sudo i2cdetect -y 1

number 68 should be seen

Then in root (sudo bash):

echo ds1307 0x68 > /sys/class/i2c-adapter/i2c-1/new_device
ntpq -p (make sure time is sync and up to date)
hwclock -w --localtime (localtime is important)

Warning : When plugging or removing DS32321 to Rpi always do it when RPi is OFF and power removed.

Check Reg value in DS3231: 'i2cdump -y -f -r 0-6 1 0x68 c' 
http://raspberrypi.stackexchange.com/questions/38186/how-to-install-real-time-clock-rtc-on-raspian

Check Day of Week: 'i2cget 1 0x68 0x3'

Set Day of Week: 'i2cset 1 0x68 0x3 0x$(date +%u)'
https://wiki.openbeelab.org/index.php/Ds3231_rtc_module
{'fraction_non_alphanumeric': 0.11001712328767123, 'fraction_numerical': 0.08904109589041095, 'mean_word_length': 3.573385518590998, 'pattern_counts': {'":': 0, '<': 3, '<?xml version=': 0, '>': 13, 'https://': 1, 'lorem ipsum': 0, 'www.': 4, 'xml': 0}, 'pii_count': 0, 'substrings_counts': 0, 'word_list_counts': {'cursed_substrings.json': 0, 'profanity_word_list.json': 0, 'sexual_word_list.json': 0, 'zh_pornsignals.json': 0}}
{'dir': 'git-commits-cleaned', 'id': '4469792', 'n_tokens_mistral': 1119, 'n_tokens_neox': 984, 'n_words': 288}