Question regarding data output

This section covers the Meteobridge PRO, PRO2, NANO SD, Raspberry Pi and VM platforms exclusively

Moderator: Mattk

Post Reply
RoostWeather
Junior Boarder
Junior Boarder
Posts: 37
Joined: Sat Dec 16, 2023 7:22 pm

Question regarding data output

Post by RoostWeather »

Hello,

I have an event which outputs a line of SQL "on every started minute", with a time stamp defined using the internal template - eg:

values ('[UYYYY]-[UMM]-[UDD] [Uhh]:[Umm]:00',...etc

I also have an event which exports data (via a template I created) at minute resolution to a csv file every hour, to produce a text based log of some of the quantities in the database.

I have noticed that the SQL output, and the data exported, appear to differ by 1-minute, so for example just now the temperature (as defined by [th0temp-avg1] in the SQL, or [th0temp-avg] in the data export at minute resolution) just now changed from 9.7 to 9.8 Celsius on the obs timestamped 14:57:00 and 14:58:00 in the SQL database, but in the text file this change occurs between the 14:56:00 and 14:57:00 lines in the exported csv.

If anyone can shed any light on this discrepancy I'd be most grateful!

Many thanks
RoostWeather
Junior Boarder
Junior Boarder
Posts: 37
Joined: Sat Dec 16, 2023 7:22 pm

Re: Question regarding data output

Post by RoostWeather »

Anyone? Thanks.
Mattk
Platinum Boarder
Platinum Boarder
Posts: 1387
Joined: Mon Sep 22, 2014 3:24 am

Re: Question regarding data output

Post by Mattk »

Changes with 1 minute data and within a point of a degree tends to be marginal? Avg1 and avg in the context would have different meanings and probably don't relate to each other when worrying about maybe a few seconds difference?
RoostWeather
Junior Boarder
Junior Boarder
Posts: 37
Joined: Sat Dec 16, 2023 7:22 pm

Re: Question regarding data output

Post by RoostWeather »

Yes, it is marginal, but it is important to me to get it exactly right, and moreover, it may expose a bug within meteobridge to be examined. Over the past few weeks I have found this to be persistent, the data exported to a log is always 1-minute out from the data inserted via SQL.
Mattk
Platinum Boarder
Platinum Boarder
Posts: 1387
Joined: Mon Sep 22, 2014 3:24 am

Re: Question regarding data output

Post by Mattk »

My way of understanding is there is no guarantee way of knowing things are falling on the exact minute as there is no sequential line by line 1 second data. The age of the readings would obviously have inconsistent gaps in the time line. Avg1 is the average over the past minute (60 seconds) and that doesn't imply it is necessarily a whole absolute time frame, it could be from say 35 seconds past a minute to 25 second past the next minute.

This 1 minute stuff tends to become a little flaky unless one is absolutely dealing with perfect 1 second records between absolve minutes and that is not going to happen?
User avatar
admin
Platinum Boarder
Platinum Boarder
Posts: 7854
Joined: Mon Oct 01, 2007 10:51 pm

Re: Question regarding data output

Post by admin »

The SQL will get the current sensor data at the start of the minute. It is a snapshot. The export reports the min/max/average of sensor data that showed up from the start to the end of the minute.
Post Reply