Errors while fetching and pushing pressure data to MySQL database. **solved**
Posted: Sun Apr 03, 2022 11:49 pm
Hi all,
Recently I bought a Meteobridge NANOSD for my Davis Vantage Pro2 weather station. Currently I'm setting up a MySQL (or actually MariaDB...) database to store the measured data. Fetching and storing every sensor data is working fine, but for some reason I cannot get the barometric pressures to work.
First of all, this SQL script defines the table I have created:
With the following INSERT statement I try to update the database:
And specific the template variables for pressure:
This doesn't work. I tried several template with different settings, converters, selectors and such, but every time I get an error something like this:
The only time I got it working was when I converted to pressures to psi like [thb0seapress-act=psi.1]
To be honest I have no clue why it works for psi and not for other units. Probably I'm doing something wrong but I have no idea what
. Someone here that can help me?
Thanks in advance!
Mark
PS: the pressures are fetched by the Meteobridge just fine, I can create graphs and tables with those variables.
Recently I bought a Meteobridge NANOSD for my Davis Vantage Pro2 weather station. Currently I'm setting up a MySQL (or actually MariaDB...) database to store the measured data. Fetching and storing every sensor data is working fine, but for some reason I cannot get the barometric pressures to work.
First of all, this SQL script defines the table I have created:
Code: Select all
CREATE TABLE IF NOT EXISTS `tableName` (
`Id` INT NOT NULL AUTO_INCREMENT PRIMARY KEY COMMENT 'ID / Primary key',
`DateTime` datetime NOT NULL COMMENT 'Date and Time of Readings',
`TempOutCur` decimal(4,1) NOT NULL COMMENT 'Current Outdoor Temperature',
`HumOutCur` int(11) NOT NULL COMMENT 'Current Outdoor Humidity',
`PressCur` decimal(4,1) NOT NULL COMMENT 'Current Barometric Pressure',
`PressSeaCur` decimal(4,1) NOT NULL COMMENT 'Current Barometric Pressure at sealevel',
`DewCur` decimal(4,1) NOT NULL COMMENT 'Current Dew Point',
`HeatIdxCur` decimal(4,1) NOT NULL COMMENT 'Current Heat Index',
`WindChillCur` decimal(4,1) NOT NULL COMMENT 'Current Wind Chill',
`TempInCur` decimal(4,1) NOT NULL COMMENT 'Current Indoor Temperature',
`HumInCur` int(11) NOT NULL COMMENT 'Current Indoor Humidity',
`WindSpeedCur` decimal(4,1) NOT NULL COMMENT 'Current Wind Speed',
`WindAvgSpeedCur` decimal(4,1) NOT NULL COMMENT 'Current Average Wind Speed',
`WindDirCur` int(11) NOT NULL COMMENT 'Current Wind Direction (Degrees)',
`WindDirCurEng` varchar(3) NOT NULL COMMENT 'Current Wind Direction (English)',
`WindGust10` decimal(4,1) NOT NULL COMMENT 'Max Wind Gust for Past 10 Mins',
`WindDirAvg10` int(11) NOT NULL COMMENT 'Average Wind Direction (Degrees) for Past 10 Mins',
`WindDirAvg10Eng` varchar(3) NOT NULL COMMENT 'Average Wind Direction (English) for Past 10 Mins',
`RainRateCur` decimal(5,2) NOT NULL COMMENT 'Current Rain Rate',
`RainDay` decimal(4,2) NOT NULL COMMENT 'Total Rain for Today',
`RainYest` decimal(4,2) NOT NULL COMMENT 'Total Rain for Yesterday',
`RainMonth` decimal(5,2) NOT NULL COMMENT 'Total Rain this Month',
`RainYear` decimal(5,2) NOT NULL COMMENT 'Total Rain this Year'
) ENGINE=InnoDB AUTO_INCREMENT=1 DEFAULT CHARSET=latin1;
Code: Select all
INSERT INTO `dbName`.`tableName` (`DateTime`, `TempOutCur`, `HumOutCur`, `PressCur`, `PressSeaCur`, `DewCur`, `HeatIdxCur`, `WindChillCur`, `TempInCur`, `HumInCur`, `WindSpeedCur`, `WindAvgSpeedCur`, `WindDirCur`, `WindDirCurEng`, `WindGust10`, `WindDirAvg10`, `WindDirAvg10Eng`, `RainRateCur`, `RainDay`, `RainYest`, `RainMonth`, `RainYear`) VALUES ('[YYYY]-[MM]-[DD] [hh]:[mm]:[ss]', '[th0temp-act]', '[th0hum-act]', '[thb0press-act]' , '[thb0seapress-act]', '[th0dew-act]', '[th0heatindex-act]', '[wind0chill-act]', '[thb0temp-act]', '[thb0hum-act]', '[wind0wind-act]', '[wind0avgwind-act]', '[wind0dir-act]', '[wind0dir-act=endir]', '[wind0wind-max10]', '[wind0dir-avg10]', '[wind0dir-avg10=endir]', '[rain0rate-act=.2]', '[rain0total-daysum=.2]', '[rain0total-ydaysum=.2]', '[rain0total-monthsum=.2]', '[rain0total-yearsum=.2]')
Code: Select all
'[thb0press-act]' , '[thb0seapress-act]
Code: Select all
dDirCur`, `WindDirCurEng`, `WindGust10`, `WindDirAvg10`, `WindDirAvg10Eng`, `RainRateCur`, `RainDay`, `RainYest`, `RainMonth`, `RainYear`) VALUES ('2022-04-03 23:36:33', '3.8', '80.0', '1020.8' , '1020.8', '0.7', '3.8', '3.8', '23.6', '51.0', '0.0', '0.0', '155.0', 'SSE', '0.9', '155.0', 'SSE', '0.00', '0.00', '0.00', '4.20', '10.00')' failed: Out of range value for column 'PressCur' at row 1 (no more tries): <BR>')">
To be honest I have no clue why it works for psi and not for other units. Probably I'm doing something wrong but I have no idea what

Thanks in advance!
Mark
PS: the pressures are fetched by the Meteobridge just fine, I can create graphs and tables with those variables.