Date Time issues rPi4

Yeah it will take 30 seconds, before you see a response in the SSH session.


After you entered the lines in nano, you press CTRL+o , ENTER and CTRL+x.

When nano is closed you enter the lines in the terminal and wait 30 seconds for a response.
sudo chmod 644 /lib/systemd/system/setdatetime.service && sudo systemctl daemon-reload && sudo systemctl enable setdatetime.service && sudo systemctl start setdatetime.service

A post was merged into an existing topic: [PLUGIN] Touch Display

Hello @Wheaten, could you please help me?

I connected RTC ds3231, entered everything according to the instructions and I have a problem with access to the clock.

Volumio Debian GNU/Linux comes with ABSOLUTELY NO WARRANTY, to the extent
permitted by applicable law.
Welcome to Volumio for Raspberry Pi (6.1.77-v7l+ armv7l)
Last login: Wed May 22 12:52:03 2024 from 192.168.0.115
volumio@volumio:~$ sudo hwclock -w
[sudo] password for volumio:
hwclock: Cannot access the Hardware Clock via any known method.
hwclock: Use the --verbose option to see the details of our search for an access method.
volumio@volumio:~$

The clock is connected to the RPi4 with extension cables of approximately 20 cm, the cables are functional, I have checked each one separately.

I don’t know where the error is.

please post the output of:

cat /boot/config.txt
cat /boot/userconfig.txt
1 Like
volumio@volumio:~$ cat /boot/config.txt
### DO NOT EDIT THIS FILE ###
### APPLY CUSTOM PARAMETERS TO userconfig.txt ###
initramfs volumio.initrd
gpu_mem=128
gpu_mem_256=32
gpu_mem_512=32
gpu_mem_1024=128
max_usb_current=1
[pi5]
usb_max_current_enable=1
[all]
include volumioconfig.txt
include userconfig.txt
volumio@volumio:~$ cat /boot/userconfig.txt
# Add your custom config.txt options to this file, which will be preserved during updates
dtparam=i2c_arm_baudrate=800000
dtparam=spi=on

when I type:

volumio@volumio:~$ /boot/userconfig.txt
-bash: /boot/userconfig.txt: Permission denied
volumio@volumio:~$

after entering this command I can edit config.txt

sudo nano config.txt

I know, I’m still a novice and I probably make ridiculous mistakes

small update:

volumio@volumio:~$ cat /boot/userconfig.txt
# Add your custom config.txt options to this file, which will be preserved during updates
dtparam=i2c_arm_baudrate=800000
dtparam=spi=on
dtoverlay=i2c-rtc,ds3231

RTC ds3231 is already working.
I found my mistake.
Thank you @Wheaten for directing my search

1 Like

was indeed looking for this line

1 Like

Hi Wheaten! Mind me to ask if rtc ds1302 can work with volumio?

Don’t have this one, but I think it will work.
dtoverlay=i2c-rtc,ds1302

1 Like

Thanks wheaten!
I bought ds3231, ds1302 doesn’t work maybe not compatible.

Found a new script:

nano setntpserver.sh

copy in it:

#!/bin/bash

NTPSERVER="time.google.com"
TMPCONFIG=/dev/shm/tmpconfig.conf


# timesyncd
CONFIG=/etc/systemd/timesyncd.conf
if [ -f "$CONFIG" ]
then
	cat "$CONFIG" | grep -v -e 'NTP=' > "$TMPCONFIG"
	echo "NTP=$NTPSERVER" >> "$TMPCONFIG"

	sudo chown root:root "$TMPCONFIG"
	sudo chmod 644 "$TMPCONFIG"
	sudo mv "$TMPCONFIG" "$CONFIG"

	# /usr/sbin/ntpd

	sudo service systemd-timesyncd restart
fi


# ntpd
CONFIG=/etc/ntp.conf
if [ -f "$CONFIG" ]
then
	cat "$CONFIG" | grep -v -e 'pool ' > "$TMPCONFIG"
	#echo "server $NTPSERVER" >> "$TMPCONFIG"
	echo "pool time1.google.com iburst" >> "$TMPCONFIG"
	echo "pool time2.google.com iburst" >> "$TMPCONFIG"
	echo "pool time3.google.com iburst" >> "$TMPCONFIG"
	echo "pool time4.google.com iburst" >> "$TMPCONFIG"

	sudo chown root:root "$TMPCONFIG"
	sudo chmod 644 "$TMPCONFIG"
	sudo mv "$TMPCONFIG" "$CONFIG"

	sudo service ntp restart
fi

I insert all this line in (nano setntpserver.sh)?