For putting raw c.q. loop data in a local MySQL database you need MesoWx's raw.py module. Unfortunately this module isn't working anymore in weewx version 3.0 and higher.
Contents of http://<YOUR-WEB-SERVER>/web/meso\/nclude/Config.json
{
/*
* Define your database connection(s). Multiple can be defined separated by a comman.
* The key is the data source ID and is used to reference the it elsewhere in the config. The
* ID must be unique. Each data source must define a 'type' property; the only supported type
* currently is 'mysql'. The rest of the properties required depend on the type
* (see examples below).
*/
"dataSource" : {
"weewx_mysql" : { // the data source ID
"type" : "mysql",
"host" : "localhost",
"user" : "your database user",
"password" : "your database password",
"database" : "meso"
},
},
/*
* Define your data entities. Entities are effectively database tables containing columns
* of your data. The key is the ID of the entity which is used to reference the entity in
* the HTTP API. Each entity must define a 'type' property; the only supported type is
* currently 'table' (see examples below).
*/
"entity" : {
// This example shows a configuration with a retention policy
"weewx_raw" : {
"type" : "table",
"dataSource" : "weewx_mysql",
"tableName" : "raw",
"accessControl" : {
"update" : {
"allow" : true,
"securityKey" : ""
}
},
// The retention policy defines how this data is retained over time. It is only really
// revevant when allowing this entity to be updated. Curently the only supported
// policy type is "window" which will retain data within the specified time window.
"retentionPolicy" : {
"type" : "window",
// The trigger defines when the policy is applied. Currently only "update" is
// supported, which means each time the entity is updated.
"trigger" : "update",
// The amount of time in seconds since the current date/time to retain. All records
// before this time window will be permanently deleted!
"windowSize" : 86400 // 24 hours
},
"columns" : {
"dateTime" : {"type" : "number", "unit" : "s"},
"barometer" : {"unit" : "hPa"},
"outTemp" : {"unit" : "c"},
"outHumidity" : {"unit" : "perc"},
"windSpeed" : {"unit" : "kph"},
"windDir" : {"unit" : "deg"},
"windGust" : {"unit" : "kph"},
"windGustDir" : {"unit" : "deg"},
"rainRate" : {"unit" : "cmHr"},
"rain" : {"unit" : "cm"},
"dewpoint" : {"unit" : "c"},
"windchill" : {"unit" : "c"},
"heatindex" : {"unit" : "c"}
},
"constraints" : {
"primaryKey" : "dateTime"
}
},
}
}
...
Change / set the following in weewx.conf:
[DataBindings]
[[raw_binding]]
database = raw_mysql
table_name = raw
manager = weewx.manager.Manager
schema = user.raw.schema
...
[Databases]
[[raw_mysql]]
database_type = MySQL
database_name = meso
...
[Raw]
#
# This section is for configuration of the raw plugin. This plugin stores the raw
# data off of the station.
#
# The database binding to persist the raw data.
# This should match a section under the [DataBindings] section.
data_binding = raw_binding
#
# The max amount of raw data to retain specified in hours (set to 0 to retain all data)
# This will in effect keep a rolling window of the data removing old data based on
# the time of the most recent record. It is recommended to set this to at least 24.
#
# NOTE: if increasing this value (or setting to unlimited), keep in mind that raw data
# may consume VERY large amounts of space!
data_limit = 72 # 3 days
...
[Engine]
[[Services]]
archive_services = weewx.engine.StdArchive, user.forecast.ZambrettiForecast, user.forecast.WUForecast, user.raw.RawService
...