read out System Timestamp

Applications, development tools, FPGA, C, WEB
Post Reply
GeorgB613
Posts: 13
Joined: Tue Mar 24, 2015 10:00 am
Location: Graz, Austria

read out System Timestamp

Post by GeorgB613 » Tue Mar 24, 2015 10:28 am

Hi everyone
In my application I require a continuous timestamp appended to my scope data. I planned to read out the RTC value and append this to the JSON packets in my Web App (maybe at least as sort of a header information).
In this respect, my question is how to read out the system time and where do I find it?

However, I noticed when updating files via SSH that no file property date is updated correctly.
The initial date remains January 1st, 1980 01:00:00
In this case, I will also have to set the RTC.

Best regards
Georg B.

Nils Roos
Posts: 1441
Joined: Sat Jun 07, 2014 12:49 pm
Location: Königswinter

Re: read out System Timestamp

Post by Nils Roos » Tue Mar 24, 2015 9:34 pm

I hate to break this to you, but the Red Pitaya doesn't have an RTC. That's why it always boots with the time set to unix epoch (1/1/1970 0:00 UTC).
It may be possible to set the system time from an NTP server in the startscripts, provided your RP has internet access.

Once the system time is set, you can use the usual APIs for time, like gettimeofday()

GeorgB613
Posts: 13
Joined: Tue Mar 24, 2015 10:00 am
Location: Graz, Austria

Re: read out System Timestamp

Post by GeorgB613 » Wed Mar 25, 2015 8:40 am

Hi Nils

Thank you for your quick reply! I was a little afraid in advance to hear this.
Will the setting of the system time work also with the standard APIs?
Say ... settimeofday()

I don't know what the time.h library does in the background, but I guess the linux OS provides this anyway.

Georg

Post Reply
jadalnie klasyczne ekskluzywne meble wypoczynkowe do salonu ekskluzywne meble tapicerowane ekskluzywne meble do sypialni ekskluzywne meble włoskie

Who is online

Users browsing this forum: No registered users and 17 guests