esera automation 19200-1 Manual - Página 5
Procurar online ou descarregar pdf Manual para Equipamento de gravação esera automation 19200-1. esera automation 19200-1 9 páginas.
Também para esera automation 19200-1: Manual do utilizador (5 páginas)
Art. Nr. 19200 Linux
8.4
System clock Installation
The following system configurations are necessary to integrate the ESERA-Station System Clock (type
DS1307) into the Raspian.
Please note that the system clock is already installed at delivery.
Add Hardware Clock DS1307
Start the LX Terminal and enter he following commands:.
sudo apt-get update && sudo apt-get upgrade --yes
sudo apt-get install i2c-tools
Afterwards the I2C bus must be activated, if not already done:
sudo raspi-config
Under "Advanced Options" > "I2C" activate everything (just confirm with Yes). A restart may be necessary.
Now we edit the modules file:
sudo nano /etc/modules
and add the non-existent entries at the end:
i2c-bcm2708
i2c-dev
rtc-ds1307
To save and quit, press CTRL+O, CTRL+X
To activate the modules, they must be loaded:
sudo modprobe i2c_bcm2708
sudo modprobe i2c_dev
sudo modprobe rtc-ds1307
We can now see if the RTC module was recognized by I2C (the parameter -y 1 indicates that it is Rev.2 of
the embedded computer (Raspberry Pi).
i2cdetect -y 1
You should see the following output:
pi@raspberrypi:~ $ i2cdetect -y 1
0 1 2 3 4 5 6 7 8 9 a b c d e f
00: -- -- -- -- -- -- -- -- -- -- -- -- --
10: -- -- -- -- -- -- -- -- -- -- -- -- -- -- -- --
20: -- -- -- -- -- -- -- -- -- -- -- -- -- -- -- --
30: -- -- -- -- -- -- -- -- -- -- -- -- -- -- -- --
40: -- -- -- -- -- -- -- -- -- -- -- -- -- -- -- --
50: 50 -- -- -- -- -- -- -- -- -- -- -- -- -- -- --
60: -- -- -- -- -- -- -- -- 68 -- -- -- -- -- -- --
70: -- -- -- -- -- -- -- --
So the module is recognized and can be queried with i2cget -y 1 0x68. Because a hex code is hard to read,
we enter the module as a new I2C device:
sudo bash
echo ds1307 0x68 > /sys/class/i2c-adapter/i2c-1/new_device
exit
Then we can simply read the time with
sudo hwclock -r
The local time of the system is displayed with "date". Possibly the system clock is not yet set correctly. The
default setting is January 1, 2000. Since the local system time is correct (automatically taken from an NTP
server), you can synchronize as follows
sudo hwclock --set --date="$(date "+%m/%d/%y %H:%M:%S")"
All rights reserved. Reproduction as well as electronic duplication of this user guide, complete or in part, requires the written consent of
ESERA GmbH. Errors and technical modification subject to change. ESERA GmbH, ESERA-Automation 2020
www.esera.de
19200 V1.0 R1.0 Commissioning II
Page 5 of 9