lokki
New Member
Posts: 7
|
Post by lokki on Sept 9, 2021 10:47:32 GMT -8
So I've have this set up for a few days now. It took a bit to get it up and running, but everything tested and connected the way it should based on the documentation. My question is this the rain gauge/sensor has shown since I set it up that we have had 1.2" of rain in every category measured. We haven't had any since I put it outside a few days ago. Is there a way to reset this sensor? Is this somehow just an entry in the database that will change when it actually rains? And can I edit the database to "fix" this reading? Ok that was 3 questions..... Thanks for the help in advance!
|
|
|
Post by doxidad on Sept 9, 2021 16:26:52 GMT -8
You will need to zero out the TotalRain column in the table WeatherData in the SkyWeather2 database of the LAST record in the table.
You can do this if you have installed phpMyAdnin
or by using mysql command line to enter the SQL statements
First stop the SkyWeather2 program (so it doesn't update while you are updating the value
Then get the ID of the last record in the WeatherData table - you can use this SQL statement
MariaDB [SkyWeather2]> select ID, TotalRain from WeatherData order by TimeStamp desc limit 1; +-------+-----------+ | ID | TotalRain | +-------+-----------+ | 14823 | 540.3 | +-------+-----------+ 1 row in set (0.000 sec)
This is from my system - the last record ID was 14823 - yours will be different (much smaller) Then use this ID to update the TotalRain column to 0 - here is the SQL to do this - Make sure you use the ID that was returned from the statement above.
MariaDB [SkyWeather2]> update WeatherData set TotalRain=0 where ID= ID RETURNED by Previous SQL
Then restart SkyWeather2.py
|
|
lokki
New Member
Posts: 7
|
Post by lokki on Sept 9, 2021 18:10:26 GMT -8
Thanks that worked
|
|
lokki
New Member
Posts: 7
|
Post by lokki on Sept 11, 2021 15:33:33 GMT -8
Apparently that didn't work, the 1.2 measurement is back Plus it has actually been raining all day here. Any thoughts?
|
|
|
Post by doxidad on Sept 11, 2021 16:26:28 GMT -8
That's strange
Try this SQL and post the output here. Interested in what the last row has in it.
pi@WPI2:~ $ sudo mysql -u root -p SkyWeather2 Enter password: Reading table information for completion of table and column names You can turn off this feature to get a quicker startup with -A
Welcome to the MariaDB monitor. Commands end with ; or \g. Your MariaDB connection id is 1428 Server version: 10.3.29-MariaDB-0+deb10u1 Raspbian 10
Copyright (c) 2000, 2018, Oracle, MariaDB Corporation Ab and others.
Type 'help;' or '\h' for help. Type '\c' to clear the current input statement.
MariaDB [SkyWeather2]> MariaDB [SkyWeather2]> select TimeStamp, ID, TotalRain from WeatherData order by TimeStamp desc limit 1; +---------------------+-------+-----------+ | TimeStamp | ID | TotalRain | +---------------------+-------+-----------+ | 2021-09-11 20:18:22 | 15013 | 540.3 | +---------------------+-------+-----------+ 1 row in set (0.030 sec)
MariaDB [SkyWeather2]>
|
|
lokki
New Member
Posts: 7
|
Post by lokki on Sept 11, 2021 16:43:24 GMT -8
|
|
|
Post by doxidad on Sept 12, 2021 4:06:59 GMT -8
I see what the problem is - the TotalRain column has data in it from before the date you cleared out the one record. Dash uses just more than that current record for calculating the total rain.
You can clear it by using this SQL statement.
I ran this on my test database and it zeroed out the TotalRain column on all 15056 rows.
MariaDB [SkyWeather2]> update WeatherData set TotalRain = 0; Query OK, 15056 rows affected (0.292 sec) Rows matched: 15057 Changed: 15056 Warnings: 0
MariaDB [SkyWeather2]>
That should fix the value at 0 as a starting point. BTW this value is stored in mm not inches - so your value of 31.5mm = 1.24 in.
I actually wrote this up a while ago for someone else and couldn't find it in the forum. Would have made things easier.
|
|
lokki
New Member
Posts: 7
|
Post by lokki on Sept 12, 2021 4:41:45 GMT -8
Awesome, I'll keep an eye on it and see if it actually tracks anything for the rain. It spit a little yesterday but apparently nothing of note. Now that everything is at zero we'll see what happens when we get a proper rain.
Thanks for the help so far!!
|
|
lokki
New Member
Posts: 7
|
Post by lokki on Sept 12, 2021 13:03:55 GMT -8
Okay so new development...there has been zero rain in the past 8-ish hours since everything was reset, but I just checked on it and here are the results. Anyone have an idea on why this keeps going back to showing 1.2 in of rain when there has been no rain, and the database was zeroed out? or what else can be done to chase this down? Or is the sensor group bad?
|
|
|
Post by doxidad on Sept 12, 2021 16:41:51 GMT -8
Guess I steered you partially wrong you need to zero the database values but also reset the WeatherRack sensor.
The total comes from it. So clearing the database is only part of it. You also need to reset the WeatherRack by pushing the reset button on the bottom. Getting very forgetful in my old age
Here is a raw message from mine -
processing FT020T Data This is the raw data: {"time" : "2021-09-12 20:30:42", "model" : "SwitchDoc Labs FT020T AIO", "device" : 12, "id" : 0, "batterylow" : 0, "avewindspeed" : 0, "gustwindspeed" : 0, "winddirection" : 233, "cumulativerain" : 5403, "temperature" : 1150, "humidity" : 71, "light" : 0, "uv" : 0, "mic" : "CRC"}
Resetting it should set the cumulativerain to 0.
BTW - the readings are only stored every 15 minutes in the database not every received message.
|
|