Re: [weewx-user] WeeWx database differs from system log

2021-11-11 Thread gjr80
On Friday, 12 November 2021 at 06:10:36 UTC+10 jonatha...@gmail.com wrote:

>
>
> Which did you intend? 5 or 30 minutes.
>
> I intend every 5 minutes, and am considering every minute.  Any advice?
>
> Yes, if you go down to a minute make sure you monitor your logs to ensure 
you are not overloading WeeWX. If your report cycle is taking longer than a 
minute to complete at best you will have some report cycles being skipped 
(will be noted in the log), at worst strange things may start happening.

Gary

-- 
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+unsubscr...@googlegroups.com.
To view this discussion on the web visit 
https://groups.google.com/d/msgid/weewx-user/e4ba598e-c503-4edb-bd59-050d67ff50bfn%40googlegroups.com.


Re: [weewx-user] WeeWx database differs from system log

2021-11-11 Thread Jonathan Ryshpan
On Wed, 2021-11-10 at 12:23 -0800, Tom Keffer wrote:
> The times in the log are a month later than the times you are showing
> from the database. I'll bet if you looked later in the database, you
> would see that the records are arriving every 30 minutes.
You are correct; the database shows records arriving every 30 minutes.

> 
> Which did you intend? 5 or 30 minutes.
I intend every 5 minutes, and am considering every minute.  Any advice?

Thanks for your help.

-- 
Sincerely Jonathan Ryshpan 

 "Never try to teach a pig to sing.
 It wastes time and annoys the pig."

-- 
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+unsubscr...@googlegroups.com.
To view this discussion on the web visit 
https://groups.google.com/d/msgid/weewx-user/f19de3436d9b2a29e6576411a28d5a6d86ef3859.camel%40pacbell.net.


Re: [weewx-user] WeeWx database differs from system log

2021-11-10 Thread Tom Keffer
The times in the log are a month later than the times you are showing from
the database. I'll bet if you looked later in the database, you would see
that the records are arriving every 30 minutes.

Which did you intend? 5 or 30 minutes.

On Wed, Nov 10, 2021 at 12:07 PM Jonathan Ryshpan 
wrote:

> I'm trying to set up weewx on a new system.  (weewx is also new to me.)
>  The system log shows records being added to the database every half hour,
> but the database (weewx.sdb) seems to show records being added every 5
> minutes.  Is one of these wrong?  Or does weewx add a number or records (6
> exactly) to the database every half hours?  I'm perplexed.
>
> Here's an extract from the system log (*emphasis* added):
>
> $ journalctl --since today | grep 'weewx.*Added record.*database'
> Nov 10 *00:00:16*  OaklandWeather.localdomain python3[1902]: weewx[1902]
> INFO weewx.manager: Added record 2021-11-10 00:00:00 PST (1636531200) to
> database 'weewx.sdb'
> Nov 10 *00:30:16*  OaklandWeather.localdomain python3[1902]: weewx[1902]
> INFO weewx.manager: Added record 2021-11-10 00:30:00 PST (1636533000) to
> database 'weewx.sdb'
> Nov 10 *01:00:16*  OaklandWeather.localdomain python3[1902]: weewx[1902]
> INFO weewx.manager: Added record 2021-11-10 01:00:00 PST (1636534800) to
> database 'weewx.sdb'
> Nov 10 *01:30:16*  OaklandWeather.localdomain python3[1902]: weewx[1902]
> INFO weewx.manager: Added record 2021-11-10 01:30:00 PST (1636536600) to
> database 'weewx.sdb'
> Nov 10 *02:00:16*  OaklandWeather.localdomain python3[1902]: weewx[1902]
> INFO weewx.manager: Added record 2021-11-10 02:00:00 PST (1636538400) to
> database 'weewx.sdb'
>
> But here is an extract from the database (weewx.sdb) converted to a
> spreadsheet, covering the same period:
>
> --
>
> Sincerely Jonathan Ryshpan 
>
>   They know that it is human nature to take up
>   causes whereby a man may oppress his neighbor,
>   no matter how unjustly. ... Hence they have had
>   no trouble in finding men who would preach the
>   damnability and heresy of the new doctrine from
>   the very pulpit...  -- Galileo Galilei, 1615
>
> --
> 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+unsubscr...@googlegroups.com.
> To view this discussion on the web visit
> https://groups.google.com/d/msgid/weewx-user/0289f0eea330723c6ca0b963cc2a65bf141aebde.camel%40pacbell.net
> 
> .
>

-- 
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+unsubscr...@googlegroups.com.
To view this discussion on the web visit 
https://groups.google.com/d/msgid/weewx-user/CAPq0zEAwjf6UCJPXLf2NWoMBOqDM2o2uHfR6XHYo_jsrMDLhVg%40mail.gmail.com.


Re: [weewx-user] WeeWx Database

2020-05-29 Thread Tom Keffer
1. Log?
2. Not all images and HTML files get replaced with every reporting cycle.
Try deleting them all and then running wee_reports again.

On Fri, May 29, 2020 at 6:55 AM Ron Sell  wrote:

> I added all of the Data to my new database. It imported usinf the .SQL.
>
> I rn a query on the archive table
> SQLite: select count(*) from archive and all 80,000 records are in there.
>
> None of my reports reflect it. ran sudo wee_reports
>
> On Sunday, 17 May 2020 11:06:12 UTC-4, Tom Keffer wrote:
>>
>> How about doing a dump of the v3.9 database, then delete the CREATE TABLE
>> statement. Then import into the V4 database.
>>
>> Something like:
>>
>> # Create a dump, then strip out the CREATE TABLE
>> echo ".dump" | sqlite3 weewx3.92.sdb | sed -e 's/^CREATE TABLE//' >
>> weewx3.92.sql
>> # Use the results to insert into the V4.0 table
>> sqlite3 weewx4.0.sdb < weewx3.92.sql
>>
>> One thing I want to stress is that there is no difference between a V3.9
>> database and a V4.0 database. The only difference is that V4.0 offers a
>> new, extended schema.
>>
>> -tk
>>
>> On Sun, May 17, 2020 at 6:55 AM Ron Sell  wrote:
>>
>>> I upgraded to a new Pi and weewx 4.0.
>>>
>>> Old Pi
>>> weexwx 3.9.2
>>> Database extended for more observations
>>> 58 columns
>>> Running for a year
>>>
>>> New Pi
>>> Weewx 4.0
>>> Database not extended Included all of the observstions i needed in the
>>> new version.'
>>> 113 columns
>>>
>>> What is the best way to keep all my old data?
>>>
>>>
>>> I can't just copy the old database 1 for 1 since they are different.
>>>
>>> thanks
>>>
>>>
>>> --
>>> 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...@googlegroups.com.
>>> To view this discussion on the web visit
>>> https://groups.google.com/d/msgid/weewx-user/378b9004-78d2-4a80-bccb-27b35ecdc64c%40googlegroups.com
>>> 
>>> .
>>>
>> --
> 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+unsubscr...@googlegroups.com.
> To view this discussion on the web visit
> https://groups.google.com/d/msgid/weewx-user/cebbe173-4337-4cde-8af6-94eb809a83f3%40googlegroups.com
> 
> .
>

-- 
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+unsubscr...@googlegroups.com.
To view this discussion on the web visit 
https://groups.google.com/d/msgid/weewx-user/CAPq0zECxUe%2B-SyQGpGOsByCz_8P0C_Ut4%3DfH0vQ-TGkdvHtb6Q%40mail.gmail.com.


Re: [weewx-user] WeeWx Database

2020-05-29 Thread Ron Sell
I added all of the Data to my new database. It imported usinf the .SQL.

I rn a query on the archive table
SQLite: select count(*) from archive and all 80,000 records are in there.

None of my reports reflect it. ran sudo wee_reports 

On Sunday, 17 May 2020 11:06:12 UTC-4, Tom Keffer wrote:
>
> How about doing a dump of the v3.9 database, then delete the CREATE TABLE 
> statement. Then import into the V4 database.
>
> Something like:
>
> # Create a dump, then strip out the CREATE TABLE
> echo ".dump" | sqlite3 weewx3.92.sdb | sed -e 's/^CREATE TABLE//' > 
> weewx3.92.sql
> # Use the results to insert into the V4.0 table
> sqlite3 weewx4.0.sdb < weewx3.92.sql
>
> One thing I want to stress is that there is no difference between a V3.9 
> database and a V4.0 database. The only difference is that V4.0 offers a 
> new, extended schema. 
>
> -tk
>
> On Sun, May 17, 2020 at 6:55 AM Ron Sell > 
> wrote:
>
>> I upgraded to a new Pi and weewx 4.0.
>>
>> Old Pi 
>> weexwx 3.9.2
>> Database extended for more observations
>> 58 columns
>> Running for a year
>>
>> New Pi 
>> Weewx 4.0
>> Database not extended Included all of the observstions i needed in the 
>> new version.'
>> 113 columns
>>
>> What is the best way to keep all my old data?
>>
>>
>> I can't just copy the old database 1 for 1 since they are different.
>>
>> thanks
>>
>>
>> -- 
>> 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...@googlegroups.com .
>> To view this discussion on the web visit 
>> https://groups.google.com/d/msgid/weewx-user/378b9004-78d2-4a80-bccb-27b35ecdc64c%40googlegroups.com
>>  
>> 
>> .
>>
>

-- 
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+unsubscr...@googlegroups.com.
To view this discussion on the web visit 
https://groups.google.com/d/msgid/weewx-user/cebbe173-4337-4cde-8af6-94eb809a83f3%40googlegroups.com.


Re: [weewx-user] WeeWx Database

2020-05-18 Thread Ron Sell
Thanks , that what I am doing now. I appreciate all the help.

Easiest way :
Uninstall 4.0
Install 3.9
Configure Weewx
Done

On Mon, May 18, 2020 at 8:35 AM Tom Keffer  wrote:

> I don't know how many different ways I can say it, but I'll try again: *there
> is no difference between a V3.9 database and a V4.0 database!*
>
> Just keep using your old database. Copy it over into your new installation
> and restart weewx. Done.
>
> -tk
>
> On Mon, May 18, 2020 at 5:24 AM Ron Sell  wrote:
>
>> I upgraded to Pi4,
>> when I started installing everything I just went with the latest version.
>> I guess i could uninstall weewx4 and go with 3.9.
>>
>> On Mon, May 18, 2020 at 8:17 AM Tom Keffer  wrote:
>>
>>> Yeah, I guess that strategy won't work, at least not with a
>>> simple ".dump" command.
>>>
>>> Can we pause for a second and ask why you are doing this? What was wrong
>>> with your old database?
>>>
>>> On Sun, May 17, 2020 at 7:01 PM Ron Sell  wrote:
>>>
 Thanks.

 Got the script working but now i get this\:
 Error: near line 38817: table archive has 114 columns but 59 values
 were supplied

 do i need to modify the .sql to provide the difference in values?


 On Sun, May 17, 2020 at 8:47 PM Tom Keffer  wrote:

> It's in the commands I suggested. Make a backup first.
>
> On Sun, May 17, 2020 at 5:41 PM Ron Sell  wrote:
>
>> Thanks,
>> I did the data dump. Its now an SQL file. How do I get it into the
>> weewx4.0 database?
>>
>> thanks
>>
>>
>> On Sun, May 17, 2020 at 11:06 AM Tom Keffer 
>> wrote:
>>
>>> How about doing a dump of the v3.9 database, then delete the CREATE
>>> TABLE statement. Then import into the V4 database.
>>>
>>> Something like:
>>>
>>> # Create a dump, then strip out the CREATE TABLE
>>> echo ".dump" | sqlite3 weewx3.92.sdb | sed -e 's/^CREATE TABLE//' >
>>> weewx3.92.sql
>>> # Use the results to insert into the V4.0 table
>>> sqlite3 weewx4.0.sdb < weewx3.92.sql
>>>
>>> One thing I want to stress is that there is no difference between a
>>> V3.9 database and a V4.0 database. The only difference is that V4.0 
>>> offers
>>> a new, extended schema.
>>>
>>> -tk
>>>
>>> On Sun, May 17, 2020 at 6:55 AM Ron Sell 
>>> wrote:
>>>
 I upgraded to a new Pi and weewx 4.0.

 Old Pi
 weexwx 3.9.2
 Database extended for more observations
 58 columns
 Running for a year

 New Pi
 Weewx 4.0
 Database not extended Included all of the observstions i needed in
 the new version.'
 113 columns

 What is the best way to keep all my old data?


 I can't just copy the old database 1 for 1 since they are different.

 thanks


 --
 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+unsubscr...@googlegroups.com.
 To view this discussion on the web visit
 https://groups.google.com/d/msgid/weewx-user/378b9004-78d2-4a80-bccb-27b35ecdc64c%40googlegroups.com
 
 .

>>> --
>>> 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+unsubscr...@googlegroups.com.
>>> To view this discussion on the web visit
>>> https://groups.google.com/d/msgid/weewx-user/CAPq0zEAL8auPoQODgMaMgepLgt9HLGDdMb-0goiLESJdt%2BEQvw%40mail.gmail.com
>>> 
>>> .
>>>
>> --
>> 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+unsubscr...@googlegroups.com.
>> To view this discussion on the web visit
>> https://groups.google.com/d/msgid/weewx-user/CABn15dYbjnGtZ%3DaNSCqrYhCBpw56uN%3DAfKYWPuxhQ7ZVF2i48Q%40mail.gmail.com
>> 
>> .
>>
> --
> 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+unsubscr...@googlegroups.com.
> To view this 

Re: [weewx-user] WeeWx Database

2020-05-18 Thread Tom Keffer
I don't know how many different ways I can say it, but I'll try again: *there
is no difference between a V3.9 database and a V4.0 database!*

Just keep using your old database. Copy it over into your new installation
and restart weewx. Done.

-tk

On Mon, May 18, 2020 at 5:24 AM Ron Sell  wrote:

> I upgraded to Pi4,
> when I started installing everything I just went with the latest version.
> I guess i could uninstall weewx4 and go with 3.9.
>
> On Mon, May 18, 2020 at 8:17 AM Tom Keffer  wrote:
>
>> Yeah, I guess that strategy won't work, at least not with a
>> simple ".dump" command.
>>
>> Can we pause for a second and ask why you are doing this? What was wrong
>> with your old database?
>>
>> On Sun, May 17, 2020 at 7:01 PM Ron Sell  wrote:
>>
>>> Thanks.
>>>
>>> Got the script working but now i get this\:
>>> Error: near line 38817: table archive has 114 columns but 59 values were
>>> supplied
>>>
>>> do i need to modify the .sql to provide the difference in values?
>>>
>>>
>>> On Sun, May 17, 2020 at 8:47 PM Tom Keffer  wrote:
>>>
 It's in the commands I suggested. Make a backup first.

 On Sun, May 17, 2020 at 5:41 PM Ron Sell  wrote:

> Thanks,
> I did the data dump. Its now an SQL file. How do I get it into the
> weewx4.0 database?
>
> thanks
>
>
> On Sun, May 17, 2020 at 11:06 AM Tom Keffer  wrote:
>
>> How about doing a dump of the v3.9 database, then delete the CREATE
>> TABLE statement. Then import into the V4 database.
>>
>> Something like:
>>
>> # Create a dump, then strip out the CREATE TABLE
>> echo ".dump" | sqlite3 weewx3.92.sdb | sed -e 's/^CREATE TABLE//' >
>> weewx3.92.sql
>> # Use the results to insert into the V4.0 table
>> sqlite3 weewx4.0.sdb < weewx3.92.sql
>>
>> One thing I want to stress is that there is no difference between a
>> V3.9 database and a V4.0 database. The only difference is that V4.0 
>> offers
>> a new, extended schema.
>>
>> -tk
>>
>> On Sun, May 17, 2020 at 6:55 AM Ron Sell  wrote:
>>
>>> I upgraded to a new Pi and weewx 4.0.
>>>
>>> Old Pi
>>> weexwx 3.9.2
>>> Database extended for more observations
>>> 58 columns
>>> Running for a year
>>>
>>> New Pi
>>> Weewx 4.0
>>> Database not extended Included all of the observstions i needed in
>>> the new version.'
>>> 113 columns
>>>
>>> What is the best way to keep all my old data?
>>>
>>>
>>> I can't just copy the old database 1 for 1 since they are different.
>>>
>>> thanks
>>>
>>>
>>> --
>>> 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+unsubscr...@googlegroups.com.
>>> To view this discussion on the web visit
>>> https://groups.google.com/d/msgid/weewx-user/378b9004-78d2-4a80-bccb-27b35ecdc64c%40googlegroups.com
>>> 
>>> .
>>>
>> --
>> 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+unsubscr...@googlegroups.com.
>> To view this discussion on the web visit
>> https://groups.google.com/d/msgid/weewx-user/CAPq0zEAL8auPoQODgMaMgepLgt9HLGDdMb-0goiLESJdt%2BEQvw%40mail.gmail.com
>> 
>> .
>>
> --
> 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+unsubscr...@googlegroups.com.
> To view this discussion on the web visit
> https://groups.google.com/d/msgid/weewx-user/CABn15dYbjnGtZ%3DaNSCqrYhCBpw56uN%3DAfKYWPuxhQ7ZVF2i48Q%40mail.gmail.com
> 
> .
>
 --
 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+unsubscr...@googlegroups.com.
 To view this discussion on the web visit
 https://groups.google.com/d/msgid/weewx-user/CAPq0zEBQAYkbKek3Gt-mMzEYb8AFBv3twPfCMFDnWu1LZsgrwg%40mail.gmail.com
 
 .

>>> --
>>> You 

Re: [weewx-user] WeeWx Database

2020-05-18 Thread Ron Sell
I upgraded to Pi4,
when I started installing everything I just went with the latest version. I
guess i could uninstall weewx4 and go with 3.9.

On Mon, May 18, 2020 at 8:17 AM Tom Keffer  wrote:

> Yeah, I guess that strategy won't work, at least not with a simple ".dump"
> command.
>
> Can we pause for a second and ask why you are doing this? What was wrong
> with your old database?
>
> On Sun, May 17, 2020 at 7:01 PM Ron Sell  wrote:
>
>> Thanks.
>>
>> Got the script working but now i get this\:
>> Error: near line 38817: table archive has 114 columns but 59 values were
>> supplied
>>
>> do i need to modify the .sql to provide the difference in values?
>>
>>
>> On Sun, May 17, 2020 at 8:47 PM Tom Keffer  wrote:
>>
>>> It's in the commands I suggested. Make a backup first.
>>>
>>> On Sun, May 17, 2020 at 5:41 PM Ron Sell  wrote:
>>>
 Thanks,
 I did the data dump. Its now an SQL file. How do I get it into the
 weewx4.0 database?

 thanks


 On Sun, May 17, 2020 at 11:06 AM Tom Keffer  wrote:

> How about doing a dump of the v3.9 database, then delete the CREATE
> TABLE statement. Then import into the V4 database.
>
> Something like:
>
> # Create a dump, then strip out the CREATE TABLE
> echo ".dump" | sqlite3 weewx3.92.sdb | sed -e 's/^CREATE TABLE//' >
> weewx3.92.sql
> # Use the results to insert into the V4.0 table
> sqlite3 weewx4.0.sdb < weewx3.92.sql
>
> One thing I want to stress is that there is no difference between a
> V3.9 database and a V4.0 database. The only difference is that V4.0 offers
> a new, extended schema.
>
> -tk
>
> On Sun, May 17, 2020 at 6:55 AM Ron Sell  wrote:
>
>> I upgraded to a new Pi and weewx 4.0.
>>
>> Old Pi
>> weexwx 3.9.2
>> Database extended for more observations
>> 58 columns
>> Running for a year
>>
>> New Pi
>> Weewx 4.0
>> Database not extended Included all of the observstions i needed in
>> the new version.'
>> 113 columns
>>
>> What is the best way to keep all my old data?
>>
>>
>> I can't just copy the old database 1 for 1 since they are different.
>>
>> thanks
>>
>>
>> --
>> 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+unsubscr...@googlegroups.com.
>> To view this discussion on the web visit
>> https://groups.google.com/d/msgid/weewx-user/378b9004-78d2-4a80-bccb-27b35ecdc64c%40googlegroups.com
>> 
>> .
>>
> --
> 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+unsubscr...@googlegroups.com.
> To view this discussion on the web visit
> https://groups.google.com/d/msgid/weewx-user/CAPq0zEAL8auPoQODgMaMgepLgt9HLGDdMb-0goiLESJdt%2BEQvw%40mail.gmail.com
> 
> .
>
 --
 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+unsubscr...@googlegroups.com.
 To view this discussion on the web visit
 https://groups.google.com/d/msgid/weewx-user/CABn15dYbjnGtZ%3DaNSCqrYhCBpw56uN%3DAfKYWPuxhQ7ZVF2i48Q%40mail.gmail.com
 
 .

>>> --
>>> 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+unsubscr...@googlegroups.com.
>>> To view this discussion on the web visit
>>> https://groups.google.com/d/msgid/weewx-user/CAPq0zEBQAYkbKek3Gt-mMzEYb8AFBv3twPfCMFDnWu1LZsgrwg%40mail.gmail.com
>>> 
>>> .
>>>
>> --
>> 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+unsubscr...@googlegroups.com.
>> To view this discussion on the web visit
>> https://groups.google.com/d/msgid/weewx-user/CABn15dbU-yaVfDiXk03CW-f-BhVqb%3DmYGzArKKi6VbWn2EQ5_A%40mail.gmail.com
>> 

Re: [weewx-user] WeeWx Database

2020-05-18 Thread Tom Keffer
Yeah, I guess that strategy won't work, at least not with a simple ".dump"
command.

Can we pause for a second and ask why you are doing this? What was wrong
with your old database?

On Sun, May 17, 2020 at 7:01 PM Ron Sell  wrote:

> Thanks.
>
> Got the script working but now i get this\:
> Error: near line 38817: table archive has 114 columns but 59 values were
> supplied
>
> do i need to modify the .sql to provide the difference in values?
>
>
> On Sun, May 17, 2020 at 8:47 PM Tom Keffer  wrote:
>
>> It's in the commands I suggested. Make a backup first.
>>
>> On Sun, May 17, 2020 at 5:41 PM Ron Sell  wrote:
>>
>>> Thanks,
>>> I did the data dump. Its now an SQL file. How do I get it into the
>>> weewx4.0 database?
>>>
>>> thanks
>>>
>>>
>>> On Sun, May 17, 2020 at 11:06 AM Tom Keffer  wrote:
>>>
 How about doing a dump of the v3.9 database, then delete the CREATE
 TABLE statement. Then import into the V4 database.

 Something like:

 # Create a dump, then strip out the CREATE TABLE
 echo ".dump" | sqlite3 weewx3.92.sdb | sed -e 's/^CREATE TABLE//' >
 weewx3.92.sql
 # Use the results to insert into the V4.0 table
 sqlite3 weewx4.0.sdb < weewx3.92.sql

 One thing I want to stress is that there is no difference between a
 V3.9 database and a V4.0 database. The only difference is that V4.0 offers
 a new, extended schema.

 -tk

 On Sun, May 17, 2020 at 6:55 AM Ron Sell  wrote:

> I upgraded to a new Pi and weewx 4.0.
>
> Old Pi
> weexwx 3.9.2
> Database extended for more observations
> 58 columns
> Running for a year
>
> New Pi
> Weewx 4.0
> Database not extended Included all of the observstions i needed in the
> new version.'
> 113 columns
>
> What is the best way to keep all my old data?
>
>
> I can't just copy the old database 1 for 1 since they are different.
>
> thanks
>
>
> --
> 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+unsubscr...@googlegroups.com.
> To view this discussion on the web visit
> https://groups.google.com/d/msgid/weewx-user/378b9004-78d2-4a80-bccb-27b35ecdc64c%40googlegroups.com
> 
> .
>
 --
 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+unsubscr...@googlegroups.com.
 To view this discussion on the web visit
 https://groups.google.com/d/msgid/weewx-user/CAPq0zEAL8auPoQODgMaMgepLgt9HLGDdMb-0goiLESJdt%2BEQvw%40mail.gmail.com
 
 .

>>> --
>>> 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+unsubscr...@googlegroups.com.
>>> To view this discussion on the web visit
>>> https://groups.google.com/d/msgid/weewx-user/CABn15dYbjnGtZ%3DaNSCqrYhCBpw56uN%3DAfKYWPuxhQ7ZVF2i48Q%40mail.gmail.com
>>> 
>>> .
>>>
>> --
>> 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+unsubscr...@googlegroups.com.
>> To view this discussion on the web visit
>> https://groups.google.com/d/msgid/weewx-user/CAPq0zEBQAYkbKek3Gt-mMzEYb8AFBv3twPfCMFDnWu1LZsgrwg%40mail.gmail.com
>> 
>> .
>>
> --
> 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+unsubscr...@googlegroups.com.
> To view this discussion on the web visit
> https://groups.google.com/d/msgid/weewx-user/CABn15dbU-yaVfDiXk03CW-f-BhVqb%3DmYGzArKKi6VbWn2EQ5_A%40mail.gmail.com
> 
> .
>

-- 
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 

Re: [weewx-user] WeeWx Database

2020-05-17 Thread Ron Sell
Thanks.

Got the script working but now i get this\:
Error: near line 38817: table archive has 114 columns but 59 values were
supplied

do i need to modify the .sql to provide the difference in values?


On Sun, May 17, 2020 at 8:47 PM Tom Keffer  wrote:

> It's in the commands I suggested. Make a backup first.
>
> On Sun, May 17, 2020 at 5:41 PM Ron Sell  wrote:
>
>> Thanks,
>> I did the data dump. Its now an SQL file. How do I get it into the
>> weewx4.0 database?
>>
>> thanks
>>
>>
>> On Sun, May 17, 2020 at 11:06 AM Tom Keffer  wrote:
>>
>>> How about doing a dump of the v3.9 database, then delete the CREATE
>>> TABLE statement. Then import into the V4 database.
>>>
>>> Something like:
>>>
>>> # Create a dump, then strip out the CREATE TABLE
>>> echo ".dump" | sqlite3 weewx3.92.sdb | sed -e 's/^CREATE TABLE//' >
>>> weewx3.92.sql
>>> # Use the results to insert into the V4.0 table
>>> sqlite3 weewx4.0.sdb < weewx3.92.sql
>>>
>>> One thing I want to stress is that there is no difference between a V3.9
>>> database and a V4.0 database. The only difference is that V4.0 offers a
>>> new, extended schema.
>>>
>>> -tk
>>>
>>> On Sun, May 17, 2020 at 6:55 AM Ron Sell  wrote:
>>>
 I upgraded to a new Pi and weewx 4.0.

 Old Pi
 weexwx 3.9.2
 Database extended for more observations
 58 columns
 Running for a year

 New Pi
 Weewx 4.0
 Database not extended Included all of the observstions i needed in the
 new version.'
 113 columns

 What is the best way to keep all my old data?


 I can't just copy the old database 1 for 1 since they are different.

 thanks


 --
 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+unsubscr...@googlegroups.com.
 To view this discussion on the web visit
 https://groups.google.com/d/msgid/weewx-user/378b9004-78d2-4a80-bccb-27b35ecdc64c%40googlegroups.com
 
 .

>>> --
>>> 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+unsubscr...@googlegroups.com.
>>> To view this discussion on the web visit
>>> https://groups.google.com/d/msgid/weewx-user/CAPq0zEAL8auPoQODgMaMgepLgt9HLGDdMb-0goiLESJdt%2BEQvw%40mail.gmail.com
>>> 
>>> .
>>>
>> --
>> 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+unsubscr...@googlegroups.com.
>> To view this discussion on the web visit
>> https://groups.google.com/d/msgid/weewx-user/CABn15dYbjnGtZ%3DaNSCqrYhCBpw56uN%3DAfKYWPuxhQ7ZVF2i48Q%40mail.gmail.com
>> 
>> .
>>
> --
> 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+unsubscr...@googlegroups.com.
> To view this discussion on the web visit
> https://groups.google.com/d/msgid/weewx-user/CAPq0zEBQAYkbKek3Gt-mMzEYb8AFBv3twPfCMFDnWu1LZsgrwg%40mail.gmail.com
> 
> .
>

-- 
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+unsubscr...@googlegroups.com.
To view this discussion on the web visit 
https://groups.google.com/d/msgid/weewx-user/CABn15dbU-yaVfDiXk03CW-f-BhVqb%3DmYGzArKKi6VbWn2EQ5_A%40mail.gmail.com.


Re: [weewx-user] WeeWx Database

2020-05-17 Thread Tom Keffer
It's in the commands I suggested. Make a backup first.

On Sun, May 17, 2020 at 5:41 PM Ron Sell  wrote:

> Thanks,
> I did the data dump. Its now an SQL file. How do I get it into the
> weewx4.0 database?
>
> thanks
>
>
> On Sun, May 17, 2020 at 11:06 AM Tom Keffer  wrote:
>
>> How about doing a dump of the v3.9 database, then delete the CREATE TABLE
>> statement. Then import into the V4 database.
>>
>> Something like:
>>
>> # Create a dump, then strip out the CREATE TABLE
>> echo ".dump" | sqlite3 weewx3.92.sdb | sed -e 's/^CREATE TABLE//' >
>> weewx3.92.sql
>> # Use the results to insert into the V4.0 table
>> sqlite3 weewx4.0.sdb < weewx3.92.sql
>>
>> One thing I want to stress is that there is no difference between a V3.9
>> database and a V4.0 database. The only difference is that V4.0 offers a
>> new, extended schema.
>>
>> -tk
>>
>> On Sun, May 17, 2020 at 6:55 AM Ron Sell  wrote:
>>
>>> I upgraded to a new Pi and weewx 4.0.
>>>
>>> Old Pi
>>> weexwx 3.9.2
>>> Database extended for more observations
>>> 58 columns
>>> Running for a year
>>>
>>> New Pi
>>> Weewx 4.0
>>> Database not extended Included all of the observstions i needed in the
>>> new version.'
>>> 113 columns
>>>
>>> What is the best way to keep all my old data?
>>>
>>>
>>> I can't just copy the old database 1 for 1 since they are different.
>>>
>>> thanks
>>>
>>>
>>> --
>>> 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+unsubscr...@googlegroups.com.
>>> To view this discussion on the web visit
>>> https://groups.google.com/d/msgid/weewx-user/378b9004-78d2-4a80-bccb-27b35ecdc64c%40googlegroups.com
>>> 
>>> .
>>>
>> --
>> 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+unsubscr...@googlegroups.com.
>> To view this discussion on the web visit
>> https://groups.google.com/d/msgid/weewx-user/CAPq0zEAL8auPoQODgMaMgepLgt9HLGDdMb-0goiLESJdt%2BEQvw%40mail.gmail.com
>> 
>> .
>>
> --
> 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+unsubscr...@googlegroups.com.
> To view this discussion on the web visit
> https://groups.google.com/d/msgid/weewx-user/CABn15dYbjnGtZ%3DaNSCqrYhCBpw56uN%3DAfKYWPuxhQ7ZVF2i48Q%40mail.gmail.com
> 
> .
>

-- 
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+unsubscr...@googlegroups.com.
To view this discussion on the web visit 
https://groups.google.com/d/msgid/weewx-user/CAPq0zEBQAYkbKek3Gt-mMzEYb8AFBv3twPfCMFDnWu1LZsgrwg%40mail.gmail.com.


Re: [weewx-user] WeeWx Database

2020-05-17 Thread Ron Sell
Thanks,
I did the data dump. Its now an SQL file. How do I get it into the weewx4.0
database?

thanks


On Sun, May 17, 2020 at 11:06 AM Tom Keffer  wrote:

> How about doing a dump of the v3.9 database, then delete the CREATE TABLE
> statement. Then import into the V4 database.
>
> Something like:
>
> # Create a dump, then strip out the CREATE TABLE
> echo ".dump" | sqlite3 weewx3.92.sdb | sed -e 's/^CREATE TABLE//' >
> weewx3.92.sql
> # Use the results to insert into the V4.0 table
> sqlite3 weewx4.0.sdb < weewx3.92.sql
>
> One thing I want to stress is that there is no difference between a V3.9
> database and a V4.0 database. The only difference is that V4.0 offers a
> new, extended schema.
>
> -tk
>
> On Sun, May 17, 2020 at 6:55 AM Ron Sell  wrote:
>
>> I upgraded to a new Pi and weewx 4.0.
>>
>> Old Pi
>> weexwx 3.9.2
>> Database extended for more observations
>> 58 columns
>> Running for a year
>>
>> New Pi
>> Weewx 4.0
>> Database not extended Included all of the observstions i needed in the
>> new version.'
>> 113 columns
>>
>> What is the best way to keep all my old data?
>>
>>
>> I can't just copy the old database 1 for 1 since they are different.
>>
>> thanks
>>
>>
>> --
>> 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+unsubscr...@googlegroups.com.
>> To view this discussion on the web visit
>> https://groups.google.com/d/msgid/weewx-user/378b9004-78d2-4a80-bccb-27b35ecdc64c%40googlegroups.com
>> 
>> .
>>
> --
> 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+unsubscr...@googlegroups.com.
> To view this discussion on the web visit
> https://groups.google.com/d/msgid/weewx-user/CAPq0zEAL8auPoQODgMaMgepLgt9HLGDdMb-0goiLESJdt%2BEQvw%40mail.gmail.com
> 
> .
>

-- 
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+unsubscr...@googlegroups.com.
To view this discussion on the web visit 
https://groups.google.com/d/msgid/weewx-user/CABn15dYbjnGtZ%3DaNSCqrYhCBpw56uN%3DAfKYWPuxhQ7ZVF2i48Q%40mail.gmail.com.


Re: [weewx-user] WeeWx Database

2020-05-17 Thread Tom Keffer
How about doing a dump of the v3.9 database, then delete the CREATE TABLE
statement. Then import into the V4 database.

Something like:

# Create a dump, then strip out the CREATE TABLE
echo ".dump" | sqlite3 weewx3.92.sdb | sed -e 's/^CREATE TABLE//' >
weewx3.92.sql
# Use the results to insert into the V4.0 table
sqlite3 weewx4.0.sdb < weewx3.92.sql

One thing I want to stress is that there is no difference between a V3.9
database and a V4.0 database. The only difference is that V4.0 offers a
new, extended schema.

-tk

On Sun, May 17, 2020 at 6:55 AM Ron Sell  wrote:

> I upgraded to a new Pi and weewx 4.0.
>
> Old Pi
> weexwx 3.9.2
> Database extended for more observations
> 58 columns
> Running for a year
>
> New Pi
> Weewx 4.0
> Database not extended Included all of the observstions i needed in the new
> version.'
> 113 columns
>
> What is the best way to keep all my old data?
>
>
> I can't just copy the old database 1 for 1 since they are different.
>
> thanks
>
>
> --
> 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+unsubscr...@googlegroups.com.
> To view this discussion on the web visit
> https://groups.google.com/d/msgid/weewx-user/378b9004-78d2-4a80-bccb-27b35ecdc64c%40googlegroups.com
> 
> .
>

-- 
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+unsubscr...@googlegroups.com.
To view this discussion on the web visit 
https://groups.google.com/d/msgid/weewx-user/CAPq0zEAL8auPoQODgMaMgepLgt9HLGDdMb-0goiLESJdt%2BEQvw%40mail.gmail.com.


Re: [weewx-user] weewx database -> excel ?

2019-06-22 Thread Thomas Keffer
Or, just use sqlite3 to create a CSV file, which is easy enough to import
into Excel.

Here's one example on how to do this:
http://www.sqlitetutorial.net/sqlite-tutorial/sqlite-export-csv/

-tk

On Sat, Jun 22, 2019 at 12:28 PM p q  wrote:

> Yeah. It is possible, but it's non-trivial. You need a ODBC data source
> for SQLite. Google sqlite odbc and you'll find some instructions. It's not
> that difficult, but it will take some figuring out.
>
> Depending on what you need to do, it might be easier to use a DB Browser
> for SQLite. I use the one here: https://sqlitebrowser.org/
>
> You can view and edit the database and create a CSV if you need to get it
> to Excel.
>
> What do you need to do in Excel?
>
>
> On Sat, Jun 22, 2019 at 12:13 PM 'Ralf B' via weewx-user <
> weewx-user@googlegroups.com> wrote:
>
>> hello
>>
>> is it possible to open (import) the weewx sql database (*.sdb) in excel?
>>
>> if yes, how?
>>
>> regard
>>
>> --
>> 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+unsubscr...@googlegroups.com.
>> To view this discussion on the web visit
>> https://groups.google.com/d/msgid/weewx-user/c4e8b9a2-b5b5-4d11-a609-7dface0911ea%40googlegroups.com
>> 
>> .
>> For more options, visit https://groups.google.com/d/optout.
>>
>
>
> --
> Peter Quinn
> (415)794-2264
>
> --
> 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+unsubscr...@googlegroups.com.
> To view this discussion on the web visit
> https://groups.google.com/d/msgid/weewx-user/CAA1SM23bUPwVz3SAPuTQ%2BaAFNDpQMNU0%3Dyi9TW_KR7Sbm6c3hg%40mail.gmail.com
> 
> .
> For more options, visit https://groups.google.com/d/optout.
>

-- 
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+unsubscr...@googlegroups.com.
To view this discussion on the web visit 
https://groups.google.com/d/msgid/weewx-user/CAPq0zEDy7s0zR%3Dh%2B6kBY56iYLtoFz913b3vKtphjqweVh9Z%2BBA%40mail.gmail.com.
For more options, visit https://groups.google.com/d/optout.


Re: [weewx-user] weewx database -> excel ?

2019-06-22 Thread p q
Yeah. It is possible, but it's non-trivial. You need a ODBC data source for
SQLite. Google sqlite odbc and you'll find some instructions. It's not that
difficult, but it will take some figuring out.

Depending on what you need to do, it might be easier to use a DB Browser
for SQLite. I use the one here: https://sqlitebrowser.org/

You can view and edit the database and create a CSV if you need to get it
to Excel.

What do you need to do in Excel?


On Sat, Jun 22, 2019 at 12:13 PM 'Ralf B' via weewx-user <
weewx-user@googlegroups.com> wrote:

> hello
>
> is it possible to open (import) the weewx sql database (*.sdb) in excel?
>
> if yes, how?
>
> regard
>
> --
> 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+unsubscr...@googlegroups.com.
> To view this discussion on the web visit
> https://groups.google.com/d/msgid/weewx-user/c4e8b9a2-b5b5-4d11-a609-7dface0911ea%40googlegroups.com
> 
> .
> For more options, visit https://groups.google.com/d/optout.
>


-- 
Peter Quinn
(415)794-2264

-- 
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+unsubscr...@googlegroups.com.
To view this discussion on the web visit 
https://groups.google.com/d/msgid/weewx-user/CAA1SM23bUPwVz3SAPuTQ%2BaAFNDpQMNU0%3Dyi9TW_KR7Sbm6c3hg%40mail.gmail.com.
For more options, visit https://groups.google.com/d/optout.


Re: [weewx-user] weewx database details

2018-10-13 Thread Thomas Keffer
There are two key Python classes involved in updating the databases:
Manager and DaySummaryManager. The latter is a subclass of the former.

If you add a record to the database using class Manager and method
addRecord(), it will get added *only* to the "archive" table. The daily
summaries are not touched.

However, if you add a record using subclass DaySummaryManager and method
addRecord(), it will first call its superclass's method,
Manager.addRecord(), which adds the record to the "archive" table, then it
will update the daily summaries as well.

There is no magic here: if you manipulate / delete something in the main
archive table, it would be up to you to update the daily summaries. Usually
it's easier to just drop all the daily summaries, then rebuild them.

To answer your last question: the daily summaries are just an optimization.
To do a query such as give me the min and max temperature for the year
using the archive table takes far longer than using the daily summaries.
Looking through some old notes, it took 0.06 second to find the max
temperature of the year from the archive table, and only 0.0004 using the
daily summaries. The very early versions of WeeWX did not do this
optimization and the query times were unacceptable.

I've attached the benchmark I used.

-tk



On Sat, Oct 13, 2018 at 10:19 AM CCOR58 
wrote:

> Ok I see that the "archive" table is the master I would expect to see
> but am confused as to how/why all the other tables are created. Are
> they derived and updated from the archive table with individual update
> queries that run each time the archive table has a record added?
>
> If something in the archive table is manipulated manually will it be
> reflected in the archive sub tables or do they have to be modified /
> updated manually as well?
>
> If data from the archive table was way out of range for some
> maintenance procedure reason on the senors would deleting those records
> manually need to be done to each of the sub tables as well?
>
> Are the subtables created as child recordsets of the main archive table
> in order to allow some generated reports to access data more quickly ?
>
> Why do those reports just not run specific queries for that specific
> data selecting from the main table rather than creating extra separate
> tables?
>
>
>
>
>
> On Fri, 2018-10-12 at 16:55 -0700, Thomas Keffer wrote:
> > Did you check out the section The database in the Customizing Guide?
> > Take a look, then come back with any questions you might have.
> >
> > -tk
> >
> > On Fri, Oct 12, 2018 at 4:31 PM CCOR58 
> > wrote:
> > > Is there any big picture tech descriptives about the tables in the
> > > weewx archive database?
> > >
> > > I connect to the mysql database using LibreOffice-base as well as
> > > phpmyadmin and I see a large number of tables but each table seems
> > > to
> > > only have two columns usually.
> > >
> > > I would like to create custom reports using libreOffice base but I
> > > need
> > > to get a better handle on what I am seeing.
> > >
> > > Usually I would expect to find a table with single record
> > > containing
> > > multiple fields each holding the latest data collected from the
> > > sensors
> > > at aspecified sample date and time.
> > >
> > > The weewx database appears to be set up under a different paradigm
> > > I
> > > fail to grasp.
> > >
> > > If there is any place that has refinfo that would help me
> > > understand
> > > what was used to design the database I would appreciate it.
> > >
> > > Thanks
> > > Andy
> > >
>
> --
> 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+unsubscr...@googlegroups.com.
> For more options, visit https://groups.google.com/d/optout.
>

-- 
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+unsubscr...@googlegroups.com.
For more options, visit https://groups.google.com/d/optout.
import time
import configobj
import weewx.manager

start_tt = (2009, 1, 1, 0, 0, 0, 0, 0, -1)
stop_tt  = (2010, 1, 1, 0, 0, 0, 0, 0, -1)
start_ts = time.mktime(start_tt)
stop_ts  = time.mktime(stop_tt)

config_dict = configobj.ConfigObj('/home/weewx/weewx.conf')
database_dict = weewx.manager.get_database_dict_from_config(config_dict, 'archive_sqlite')



#
# Use the main archive table
#
# 0.29 for first run
# 0.06 for second run (presumably, after caches are filled)
#

manager = weewx.manager.Manager.open(database_dict)

sql_stmt = """SELECT dateTime, outTemp FROM archive WHERE
outTemp=(SELECT MAX(outTemp) FROM archive WHERE dateTime>? AND dateTime <= ?) AND
dateTime>? AND dateTime <= ?;"""

t1 = time.time()
result = manager.getSql(sql_stmt, (start_ts, stop_ts, start_ts, stop_ts))
t2 = time.time()
print result, "Elapsed time for 

Re: [weewx-user] weewx database details

2018-10-13 Thread vince
On Saturday, October 13, 2018 at 10:19:15 AM UTC-7, CCOR58 RADIO wrote:
>
> Ok I see that the "archive" table is the master I would expect to see 
> but am confused as to how/why all the other tables are created. Are 
> they derived and updated from the archive table with individual update 
> queries that run each time the archive table has a record added? 
>
>
yes
 

> If something in the archive table is manipulated manually will it be 
> reflected in the archive sub tables or do they have to be modified / 
> updated manually as well? 
>
>
yes
 

> If data from the archive table was way out of range for some 
> maintenance procedure reason on the senors would deleting those records 
> manually need to be done to each of the sub tables as well? 
>
>
yes - although you'd generally drop the table and weewx would regenerate 
them automatically
 

> Are the subtables created as child recordsets of the main archive table 
> in order to allow some generated reports to access data more quickly ? 
>
>
yes
 

> Why do those reports just not run specific queries for that specific 
> data selecting from the main table rather than creating extra separate 
> tables?  

  
>

you already answered that.  Speed.

-- 
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+unsubscr...@googlegroups.com.
For more options, visit https://groups.google.com/d/optout.


Re: [weewx-user] weewx database details

2018-10-13 Thread CCOR58
Ok I see that the "archive" table is the master I would expect to see
but am confused as to how/why all the other tables are created. Are
they derived and updated from the archive table with individual update
queries that run each time the archive table has a record added?

If something in the archive table is manipulated manually will it be
reflected in the archive sub tables or do they have to be modified /
updated manually as well?

If data from the archive table was way out of range for some
maintenance procedure reason on the senors would deleting those records
manually need to be done to each of the sub tables as well?

Are the subtables created as child recordsets of the main archive table
in order to allow some generated reports to access data more quickly ? 

Why do those reports just not run specific queries for that specific
data selecting from the main table rather than creating extra separate
tables?

 



On Fri, 2018-10-12 at 16:55 -0700, Thomas Keffer wrote:
> Did you check out the section The database in the Customizing Guide?
> Take a look, then come back with any questions you might have.
> 
> -tk
> 
> On Fri, Oct 12, 2018 at 4:31 PM CCOR58 
> wrote:
> > Is there any big picture tech descriptives about the tables in the
> > weewx archive database?
> > 
> > I connect to the mysql database using LibreOffice-base as well as
> > phpmyadmin and I see a large number of tables but each table seems
> > to
> > only have two columns usually.
> > 
> > I would like to create custom reports using libreOffice base but I
> > need
> > to get a better handle on what I am seeing.
> > 
> > Usually I would expect to find a table with single record
> > containing
> > multiple fields each holding the latest data collected from the
> > sensors
> > at aspecified sample date and time.
> > 
> > The weewx database appears to be set up under a different paradigm
> > I
> > fail to grasp.
> > 
> > If there is any place that has refinfo that would help me
> > understand
> > what was used to design the database I would appreciate it.
> > 
> > Thanks
> > Andy 
> > 

-- 
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+unsubscr...@googlegroups.com.
For more options, visit https://groups.google.com/d/optout.


Re: [weewx-user] weewx database details

2018-10-12 Thread Thomas Keffer
Did you check out the section *The database
* in the
Customizing Guide? Take a look, then come back with any questions you might
have.

-tk

On Fri, Oct 12, 2018 at 4:31 PM CCOR58  wrote:

> Is there any big picture tech descriptives about the tables in the
> weewx archive database?
>
> I connect to the mysql database using LibreOffice-base as well as
> phpmyadmin and I see a large number of tables but each table seems to
> only have two columns usually.
>
> I would like to create custom reports using libreOffice base but I need
> to get a better handle on what I am seeing.
>
> Usually I would expect to find a table with single record containing
> multiple fields each holding the latest data collected from the sensors
> at aspecified sample date and time.
>
> The weewx database appears to be set up under a different paradigm I
> fail to grasp.
>
> If there is any place that has refinfo that would help me understand
> what was used to design the database I would appreciate it.
>
> Thanks
> Andy
>
> --
> 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+unsubscr...@googlegroups.com.
> For more options, visit https://groups.google.com/d/optout.
>

-- 
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+unsubscr...@googlegroups.com.
For more options, visit https://groups.google.com/d/optout.