If the returned date and time is not correct, or “hwclock” returns an error, use the “-w”
option to set the hardware clock to the current time:
$ sudo hwclock -w
Then recheck the time stored in the hardware clock to ensure it matches. Linux may have
failed to automatically update the hardware clock after the last reboot if its internal
registers contained invalid values.
If the RTC still doesn’t work, you should check if the Pi sees the RTC chip on the I2C bus.
Run these two commands:
$ sudo modprobe -r rtc_ds1307
$ sudo i2cdetect 1
WARNING! This program can confuse your I2C bus, cause data loss and worse!
I will probe file /dev/i2c-1.
I will probe address range 0x03-0x77.
Continue? [Y/n]
0 1 2 3 4 5 6 7 8 9 a b c d e f
00: -- -- -- -- -- -- -- -- -- -- -- -- --
10: -- -- -- -- -- -- -- -- -- -- -- -- -- -- -- --
20: -- -- -- -- -- -- -- -- -- -- -- -- -- -- -- --
30: -- -- -- -- -- -- -- -- -- -- -- -- -- -- -- --
40: -- -- -- -- -- -- -- -- -- -- -- -- -- -- -- --
50: -- -- -- -- -- -- -- 57 -- -- -- -- -- -- -- --
60: 60 -- -- -- -- -- -- -- -- -- -- -- -- -- -- 6f
70: -- -- -- -- -- -- -- —
You should see “6f” in the address list. This is the address of the RTC.
If the RTC address is detected, double check your software installation for issues at the
Linux modules level.
Run the “lsmod” command to list the loaded modules and check that “i2c_dev” and
“i2c_bcm2708” are both listed.
If the RTC address is not detected, the cause could be a hardware problem, on the Strato
board or the Raspberry Pi. If you have another Pi or Strato board, try swapping them to
isolate the faulty board.
CAN Bus
The CAN interface is based on the Microchip MCP2515 stand-alone Controller Area
Network (CAN) controller that implements the CAN specification version 2.0B. It is capable
of transmitting and receiving both standard and extended data and remote frames.
The MCP2515 has two acceptance masks and six acceptance filters that are used to filter
out unwanted messages, thereby reducing the host MCU’s overhead.
The MCP2515 interfaces with the Raspberry Pi via its Serial Peripheral Interface (SPI).
You should enable SPI and configure kernel support for the MCP2515.
To enable SPI, run the “raspi-config” configuration utility:
$ sudo raspi-config
Go to “Advanced Options”, “SPI” and select “yes” to enable the SPI interface, then edit
/boot/config.txt and add this line at the end of the file:
dtoverlay=mcp2515-can0,oscillator=16000000,interrupt=25
dtoverlay=spi-bcm2835-overlay