SetTime problem

For issues with communication ports, protocols, etc.
Post Reply
Dinosaur
Posts: 1494
Joined: Jul 24, 2005 1:13
Location: Hervey Bay (.au)

SetTime problem

Post by Dinosaur »

Hi All

Don't know if this is a problem purely on the Rpi that I am using.
When I use the command as such;

Code: Select all

SetTime "00:00:00"
Sleep 5
Print Time
Sleep
This results is a time of 10:00:00

The device is not connected to the Internet to get time, so I tried the same on a BBB and on it the command was totally ignored.
On the BeagleBone Black I use SerialTime to decide when to reboot.But setting the time to the actual time does work.
On the Rpi I wanted to use it as a Run time as it doesn't have a battery backed RTC.

In both cases using:
FBC 1.09.0
Linux-arm , arm v7.a

I guess not many people would use the command to set the time to Zero, so I wonder if this is across other platforms.

Regards
EDIT: Debian 11 on Desktop also ignores the command
badidea
Posts: 2594
Joined: May 24, 2007 22:10
Location: The Netherlands

Re: SetTime problem

Post by badidea »

I assume that you tried with superuser rights (sudo)?
Here (on Ubuntu) I have to disconnect/disable the network link to make it work, else it keeps syncing the time with an internet time server.
Dinosaur
Posts: 1494
Joined: Jul 24, 2005 1:13
Location: Hervey Bay (.au)

Re: SetTime problem

Post by Dinosaur »

Hi All
Yes I have tried BUT
If I use Linux as
date -s "31 Mar 2023 00:00:00"
it accepts but sets the the time s 12:00:00 am

I guess there really is no 00:00:01
according to Linux it is 12:00:01 am

Regards
EDIT:
In my BBB code that runs at the Museum;

Code: Select all

        .TimeSerial = (Val(Left(Time,2)) * 3600) + (Val(Mid(Time,4,2)) * 60) + (Val(Mid(Time,7,2)))
        If .TimeSerial = 0 Then
            Reboot(Null)                                                ''At midnight reboot PC.
        EndIf
Works perfectly every night ??
So Linux puts onto the screen something different than what FB gets when it asks for Time.

EDIT2:
Shelling out from the Rpi program and setting the date / time to 00:00:00 in Linux works.
From that point on in, the time increments from 00:00:00 upwards. (Gede debugger didn't like a Time of 0, so had to put a sleep of 1 sec in )

My conclusion is that there is a problem in the FB SetTime.
Post Reply