'Phantom' Dates

28 views
Skip to first unread message

Cycle London

unread,
Aug 21, 2018, 5:56:46 AM8/21/18
to weewx-user
Hi,

I installed my Oregon Scientific weather station on 01 January this year, but when I click on the 'monthly summary' at the bottom of the screen, I see entries for months in 2017.  If I click through to them, they're of course empty. 

But I'd like to remove those entries in the menu.   Can someone tell me how to do this? 

Thanks. 

Screen Shot 2018-08-21 at 10.53.49.png





Thomas Keffer

unread,
Aug 21, 2018, 8:12:36 AM8/21/18
to weewx-user
Most likely, you have an archive record with an early timestamp. You can check it with the tool sqlite3 (assuming you are using sqlite):

$ sqlite3 /home/weewx/archive/weewx.sdb
select dateTime, datetime(dateTime,'unixepoch','localtime') from archive order by dateTime limit 1;

Adjust path to your sqlite database as necessary.

-tk

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

The VPN Man

unread,
Aug 21, 2018, 11:57:51 AM8/21/18
to weewx...@googlegroups.com
Hi Tom,
Yep, that's it.  

[root@weather ~]# sqlite3 /home/weewx/archive/weewx.sdb
SQLite version 3.7.17 2013-05-20 00:56:22
Enter ".help" for instructions
Enter SQL statements terminated with a ";"
sqlite> select dateTime, datetime(dateTime,'unixepoch','localtime') from archive order by dateTime limit 1;
1494356520|2017-05-09 20:02:00
sqlite> 

No idea how to hose that, though. 

Is there a good, comprehensive guide to switching to MySQL?

Thank you.

To unsubscribe from this group and stop receiving emails from it, send an email to weewx-user+unsubscribe@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+unsubscribe@googlegroups.com.

vince

unread,
Aug 21, 2018, 12:42:06 PM8/21/18
to weewx-user
On Tuesday, August 21, 2018 at 8:57:51 AM UTC-7, The VPN Man wrote:
[root@weather ~]# sqlite3 /home/weewx/archive/weewx.sdb
SQLite version 3.7.17 2013-05-20 00:56:22
Enter ".help" for instructions
Enter SQL statements terminated with a ";"
sqlite> select dateTime, datetime(dateTime,'unixepoch','localtime') from archive order by dateTime limit 1;
1494356520|2017-05-09 20:02:00
sqlite> 

No idea how to hose that, though. 


'hose' that ?
 
Is there a good, comprehensive guide to switching to MySQL?


I'd probably google for "weewx mysql" and look at the first 4 links that it returns....

 

Cycle London

unread,
Aug 21, 2018, 12:51:01 PM8/21/18
to weewx...@googlegroups.com
How do I remove that/those date(s)? 

I did google, but the wiki isn't very good and none of the rest seem to be any good, either. Ah, not to worry.  

--
You received this message because you are subscribed to a topic in the Google Groups "weewx-user" group.
To unsubscribe from this topic, visit https://groups.google.com/d/topic/weewx-user/5kgytbXX5pY/unsubscribe.
To unsubscribe from this group and all its topics, send an email to weewx-user+...@googlegroups.com.

Pat

unread,
Aug 21, 2018, 1:19:52 PM8/21/18
to weewx-user
Do this at your own risk. I'm not responsible for lost data 

1) Stop weewx

2) Make a backup of the database. Adjust your path as necessary

cp /home/weewx/archive/weewx.sdb /home/weewx/archive/weewx-backup.sdb

2.1) Make sure you have a backup of your database. Verify with 

ls -al /home/weewx/archive/ 

2.2) If you feel comfortable that you have a backup of your database move to step 3.

3) Run this command. It will delete all rows where the timestamp's year is 2017. Change 2017 if you want to focus on another year. 

sqlite3 /home/weewx/archive/weewx.sdb

DELETE FROM archive WHERE strftime("%Y", datetime(dateTime, "unixepoch", "localtime")) = "2017"

4) Rebuild your daily values with the below. You can skip the drop-daily, but you may want to run it so it will drop all your daily records which should purge anything from 2017 that's lingering

sudo wee_database --drop-daily
sudo wee_database --rebuild-daily

5) Start weewx

If for some reason something get's messed up, you can stop weewx. Rename your backup database back to the primary (with cp /home/weewx/archive/weewx-backup.sdb /home/weewx/archive/weewx.sdb), start weewx. Walk away for a bit to clear your head, come back and try again from step 1. 

Cycle London

unread,
Aug 21, 2018, 4:42:57 PM8/21/18
to weewx...@googlegroups.com
That worked, thank you very much, Sir! 
Reply all
Reply to author
Forward
0 new messages