Modification of the code for station id.

65 views
Skip to first unread message

jose riaño

unread,
Sep 21, 2021, 11:41:04 AM9/21/21
to weewx-user
Good morning friends and colleagues I want to ask you What happens is that I have more than 20 stations online in a department of Colombia I would like to know how I could use the same Mysql table to store the data of all the stations by modifying the central code I want to find a identifier for each station and that all the data is inserted in the same table of all the stations, how I have it now, it is a My sql table per station, it makes me more complex for the queries and the web software that I have.

In summary, what I want is to insert the data of those 20 stations in the same mysql table. Thank you very much

Tom Keffer

unread,
Sep 21, 2021, 12:24:49 PM9/21/21
to weewx-user
Hello, Jose.

It is not very clear what you are trying to do. Will the data be collected by WeeWX? Or, something else? 

WeeWX is not designed to handle many different stations. First, there is no way to identify each station (although that would not be hard to add). The bigger problem is that weewxd blocks, waiting for data from a station. It does not have a "select" statement that allows it to wait for data from any one of 20 different stations. It can wait for only one station.

Finally, the reporting engine does not have a way of saying that you want to display data from only a particular station.

Hope that helps.

-tk

On Tue, Sep 21, 2021 at 8:41 AM jose riaño <juak...@gmail.com> wrote:
Good morning friends and colleagues I want to ask you What happens is that I have more than 20 stations online in a department of Colombia I would like to know how I could use the same Mysql table to store the data of all the stations by modifying the central code I want to find a identifier for each station and that all the data is inserted in the same table of all the stations, how I have it now, it is a My sql table per station, it makes me more complex for the queries and the web software that I have.

In summary, what I want is to insert the data of those 20 stations in the same mysql table. Thank you very much

--
You received this message because you are subscribed to the Google Groups "weewx-user" group.
To unsubscribe from this group and stop receiving emails from it, send an email to weewx-user+...@googlegroups.com.
To view this discussion on the web visit https://groups.google.com/d/msgid/weewx-user/27051542-3e2c-44a9-9274-577fa88870b5n%40googlegroups.com.

p q

unread,
Sep 21, 2021, 1:06:54 PM9/21/21
to weewx...@googlegroups.com
I don't understand the requirement completely either, but I have some thoughts. Rather than modifying weewx, perhaps you could use a union query across all the mysql tables to aggregate your data. You would probably want some station ID in the table to keep the records straight. I would also consider using a tool like Grafana to visualize the aggregated data outside of Weewx. 



--
Peter Quinn
(415)794-2264

jose riaño

unread,
Sep 22, 2021, 2:17:32 PM9/22/21
to weewx-user
Comrades Good afternoon I understand that the content is not very clear but if what I want is that each Station with its weewx software is programmed to insert the data in the same table of the Mysql database, that is, the query I am not very clear about data union I do not know if you can help me but what I want is in each station to program the same table of the database of the other stations and to be able to identify them, 

 It is a single database, all the stations are programmed to insert the data in the same database. Only that each station has a table, what I want is for all of them to insert the data in a table with a different identifier so that when they are consulted, it is easier 

 I don't know if there is a way to Modify the weewx code to insert the identifier of each station and thus give the same table to all of them. Where do I do it?

Tom Keffer

unread,
Sep 22, 2021, 2:45:42 PM9/22/21
to weewx-user
There are many major problems standing in the way of what you want.

You could run 20 instances of weewxd, each inserting into the same database table, each with its own station ID. The problem is the daily summaries. While you may have only one main archive table, you would need 20 different sets of daily summaries, one for each station. Alternatively, have a single set of daily summaries, keyed by the station ID. Either way, it's a big project.

The second problem is that WeeWX reporting has no way of specifying which station(s) you wish to include in the reports. So, this would have to be added. Also a big project.

Personally, if I was faced with this problem, I would run 20 instances of weewxd, inserting into 20 different MySQL databases. Then use something like Grafana to display them, possibly by using SQL UNIONs.

I sympathize, but you'll have to figure this out yourself. It's just not a priority for the development team.

-tk



Reply all
Reply to author
Forward
0 new messages