At the end of the day it doesn't matter where the weewx.sdb is located - as long as weewx and wee_database via weewx.conf and sqlite3 via the path in the command know/are told
where it is located.

You can still check with sqlitebrowser what your entry in your database for the respective EPOCH timestamp is (see my earlier mail) - and you can change it manually (provided you start it with sudo sqlitebrowser /var/lib/weewx/weewx.sdb [in your case]).
That's the pragmatic approach.

Of course you can still try to figure out why your SQL command doesn't seem to have been successful.

On 21.06.2023 13:24, Δημήτρης Βήχος wrote:
my database is on /var/lib/weewx/weewx.sdb

metfm@metfm:~$ ls -ail /var/lib/weewx
σύνολο 18692
264962 drwxr-xr-x 1 root root       18 Ιουν 21 14:20 .
   269 drwxr-xr-x 1 root root      592 Φεβ  26 18:30 ..
270727 -rwxrwxrwx 1 root root 19140608 Ιουν 21 14:20 weewx.sdb
metfm@metfm:~$

Στις Τετάρτη 21 Ιουνίου 2023 στις 11:49:35 π.μ. UTC+3, ο χρήστης gjr80 έγραψε:

    No. The default Debian based distro database is
    /var/lib/weewx/weewx.sdb. The archive directory is only used (by
    default) for setup.py installs.

    OP. Have you confirmed the location (and name) of your WeeWX
    database? What does the following command show:

    $ ls -ail /var/lib/weewx

    Gary

    On Wednesday, 21 June 2023 at 09:28:58 UTC+1 [email protected]
    wrote:

        It should be /var/lib/weewx/archive/weewx.sdb

        Can you give us a screenshot where the weewx.sdb is??

        Στις Τετ, 21 Ιουν 2023, 11:03 ο χρήστης Δημήτρης Βήχος
        <[email protected]> έγραψε:

            debian installed. also triyng with sudo sqlite3
            /var/lib/weewx/weewx.sdb same thing.

            Στις Τετάρτη 21 Ιουνίου 2023 στις 9:55:34 π.μ. UTC+3, ο
            χρήστης gjr80 έγραψε:

                Have you customised your WeeWX install? You appear to
                be using a package install so unless you have changed
                it your WeeWX database should be in /var/lib/weewx not
                /var/weewx.

                Gary

                On Wednesday, 21 June 2023 at 05:48:19 UTC+1
                [email protected] wrote:

                    the commands with semi-colons. send me (with sudo
                    also and with suo su )

                    metfm@metfm:~$ sudo sqlite3 /var/weewx/weewx.sdb
                    SQLite version 3.34.1 2021-01-20 14:10:07
                    Enter ".help" for usage hints.
                    sqlite> SELECT dateTime, datetime(dateTime,
                    'unixepoch','localtime'), usUnits, rain FROM
                    archive WHERE dateTime > 1686881600 AND dateTime
                    <= 1686981600;
                    Error: unable to open database
                    "/var/weewx/weewx.sdb": unable to open database file
                    metfm@metfm:~$

                    without semi-colons database open

                    metfm@metfm:~$ sudo sqlite3 /var/weewx/weewx.sdb
                    [sudo] password for metfm:
                    SQLite version 3.34.1 2021-01-20 14:10:07
                    Enter ".help" for usage hints.
                    sqlite> select datetime, datetime(dateTime,
                    'unixepoch','localtime'), rain from archive where
                    dateTime > 1686881600 and dateTime <= 1686981600
                       ...> update archive set rain=12.6 where
                    dateTime = 1686975900
                       ...> .quit
                       ...>
                    metfm@metfm:~$ sudo wee_database --rebuild-daily
                    --from=2023-06-17 --to=2023-06-17
                    [sudo] password for metfm:
                    Using configuration file /etc/weewx/weewx.conf
                    Using database binding 'wx_binding', which is
                    bound to database 'archive_sqlite'
                    Daily summary for 2023-06-17 will be rebuilt.
                    Proceed (y/n)? y
                    Rebuilding daily summaries in database 'weewx.sdb' ...
                    Processed 276 records to rebuild 1 daily summary
                    in 0.12 seconds
                    Rebuild of daily summaries in database 'weewx.sdb'
                    complete
                    metfm@metfm:~$ sudo /etc/init.d/weewx start
                    Starting weewx (via systemctl): weewx.service.
                    metfm@metfm:~$
                      but after restarting weewx no change in
                    database. no 12.6 plus mm who i needs
                    Στις Τρίτη 20 Ιουνίου 2023 στις 2:10:28 μ.μ.
                    UTC+3, ο χρήστης gjr80 έγραψε:

                        At a guess I would say your sqlite3 commands
                        were never executed due to missing semi-colons
                        at the end of each sqlite3 command line. Your
                        commands are basically fine, but you need to
                        be careful with the datetime/dateTime case in
                        the commands. No need for commits as your are
                        not processing multiple commands as a
                        transaction. When editing the database you do
                        need to be mindful of your database units and
                        make sure you use the same units in your
                        update queries. If using sqlite command line
                        the easiest thing to do is to look at the
                        usUnits field. 1=US customary=inches,
                        16=Metric=cm, 17=MetricWX=mm. Whether you use
                        sqlite3 or a gui tool like sqlitebrowser does
                        not really matter, just check that your data
                        was changed after you make the change and if
                        using a gui be very careful to not leave any
                        fields with null strings(though this is
                        usually associate with deleting data rather
                        than updating it). FWIW if using sqlite3 I
                        would use this sequence of commands:

                        $ sqlite3 /home/weewx/archive/weewx.sdb
                        sqlite> SELECT dateTime, datetime(dateTime,
                        'unixepoch','localtime'), usUnits, rain FROM
                        archive WHERE dateTime > 1686881600 AND
                        dateTime <= 1686981600;
                        sqlite> UPDATE archive SET rain=12.6 WHERE
                        dateTime = 1686975900;
                        sqlite> SELECT dateTime, datetime(dateTime,
                        'unixepoch','localtime'), usUnits, rain FROM
                        archive WHERE dateTime=1686975900;
                        sqlite> .q
                        $ sudo wee_database --rebuild-daily
                        --date=2023-06-17

                        In terms of the Seasons skin your updated data
                        may causes changes to rain plots (all except
                        the 'today' plot), the June 2023 and 2023 NOAA
                        format reports and the statistics widget/page.
                        All should come good in time (max 24 hours)
                        provided you update your data sometime this
                        month, but if you want to speed things up
                        delete all your rain plots on your WeeWX
                        machine. If you update your data in say July
                        you will need to delete the June 2023 and 2023
                        NOAA format reports and all subsequent NOAA
                        format reports to force regeneration.

                        Can't speak for any other skins.

                        Gary
                        On Tuesday, 20 June 2023 at 07:04:56 UTC+1
                        [email protected] wrote:

                            here is me commands in terminal . trying
                            to plus 12.1 missing mm  in 17 july  total
                            rainfall

                            metfm@metfm:~$ sudo sqlite3
                            /var/weewx/weewx.sdb
                            [sudo] password for metfm:
                            SQLite version 3.34.1 2021-01-20 14:10:07
                            Enter ".help" for usage hints.
                            sqlite> select datetime,
                            datetime(dateTime,
                            'unixepoch','localtime'), rain from
                            archive where dateTime > 1686881600 and
                            dateTime <= 1686981600
                               ...> update archive set rain=12.6 where
                            dateTime = 1686975900
                               ...> .quit
                               ...>
                            metfm@metfm:~$ sudo wee_database
                            --rebuild-daily --from=2023-06-17
                            --to=2023-06-17
                            [sudo] password for metfm:
                            Using configuration file /etc/weewx/weewx.conf
                            Using database binding 'wx_binding', which
                            is bound to database 'archive_sqlite'
                            Daily summary for 2023-06-17 will be rebuilt.
                            Proceed (y/n)? y
                            Rebuilding daily summaries in database
                            'weewx.sdb' ...
                            Processed 276 records to rebuild 1 daily
                            summary in 0.12 seconds
                            Rebuild of daily summaries in database
                            'weewx.sdb' complete
                            metfm@metfm:~$ sudo /etc/init.d/weewx start
                            Starting weewx (via systemctl): weewx.service.
                            metfm@metfm:~$

                            something missing? something im doing
                            wrong? the exetra mm never shows in weewx
                            restarting and updating.



                            Στις Σάββατο 17 Ιουνίου 2023 στις
                            12:11:40 μ.μ. UTC+3, ο χρήστης Stefanos
                            Kalaitzis έγραψε:

                                First find the range of time(epoch) 
                                that you want to add the rain
                                Enter to weeex.sdb

                                sudo sqlite3
                                /home/weewx/archive/weewx.sdb

                                Then check what values your station
                                recorded

                                 select datetime, datetime(dateTime,
                                'unixepoch','localtime'), rain from
                                archive where dateTime > 1686881600
                                and dateTime <= 1686981600;

                                Then correct the time you want
                                For example

                                update archive set rain=1.0 where
                                dateTime = 1686975900;

                                Then exit the db

                                .quit

                                Stop weewx

                                After all corrections rebuild the data
                                base for that day


                                sudo /home/weewx/bin/wee_database
                                --rebuild-daily --from=2023-06-17
                                --to=2023-06-17

                                Start weewx
                                Thats what i am doing when i have to
                                add some missing mm in my db



                                Στις Σάβ, 17 Ιουν 2023, 11:42 ο
                                χρήστης Δημήτρης Βήχος
                                <[email protected]> έγραψε:

                                    i want like to add some mm to my
                                    daily rainfall beacuse after power
                                    loss , my console (fine offset)
                                    have 10mm above the weewx after
                                    the power on again.
                                    i had loss 10mm in my daily rain.

                                    thank you!

-- 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
                                    [email protected].
                                    To view this discussion on the web
                                    visit
                                    
https://groups.google.com/d/msgid/weewx-user/e96ce7e9-1085-46f6-adf4-b82275bf4df4n%40googlegroups.com
                                    
<https://groups.google.com/d/msgid/weewx-user/e96ce7e9-1085-46f6-adf4-b82275bf4df4n%40googlegroups.com?utm_medium=email&utm_source=footer>.

-- 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 [email protected].

            To view this discussion on the web visit
            
https://groups.google.com/d/msgid/weewx-user/88595a49-17a9-4e1f-9fc1-6d884f9f1863n%40googlegroups.com
            
<https://groups.google.com/d/msgid/weewx-user/88595a49-17a9-4e1f-9fc1-6d884f9f1863n%40googlegroups.com?utm_medium=email&utm_source=footer>.

--
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 [email protected]. To view this discussion on the web visit https://groups.google.com/d/msgid/weewx-user/f4d024d3-7dca-4a12-961f-1a3d85c05a07n%40googlegroups.com <https://groups.google.com/d/msgid/weewx-user/f4d024d3-7dca-4a12-961f-1a3d85c05a07n%40googlegroups.com?utm_medium=email&utm_source=footer>.

--
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 [email protected].
To view this discussion on the web visit 
https://groups.google.com/d/msgid/weewx-user/692a7641-25aa-dba0-bb78-2b25f71c4aa6%40gmail.com.

Reply via email to