ElektorLabs / 191148-RemakeWeatherStation

RemakeWeatherStation
12 stars 4 forks source link

rainmeter.cpp is wrong #14

Open t3hoe opened 3 years ago

t3hoe commented 3 years ago

Hello again,

the rainmeter.cpp Version 1.5 provides incorrect values, accept the 24h amount. The determination of the values from the array is wrong. When you write into the array foreward, you must read backward for calculating e.g. the last hour (see line 118 to 125). My way to do this is: for(uint8_t i=0;i<valuecount;i++){ if (startidx > 0){ startidx--; } else{ startidx = ( sizeof( RainAmount24h ) / sizeof( RainAmount24h[0] ) ) - 1;// 1st index is 0!!! } rainpulses+= RainAmount24h[startidx]; } Regards

Pakl8 commented 3 years ago

Hi, could someone give information how to reset the stored rain value after sending the MQTT string?

lab-mathias-claussen commented 3 years ago

Hi Pakl8,

this is going to be a bit tricky. The architecture has no direct path back to the value generating units. One way would be to extend the "Sensor channels" that can be found inside the station and build one that will, if read, reset the value. Also note that the Rainmeter is an Object so a direct access to it with external may be a way with some helper functions inside the .ino code file.

I try to get some time to implement it and also fix the other bugs that are currently left.......

Regards

Mathias Claußen

Pakl8 commented 3 years ago

Hi,

Thanks for your reply. Let me explain this request. If you send out information to a time driven destination the stored information needs to be reset after sending. I am not familiar with thinkspeak or sensebox and how the information is processed when received.

But lets try to explain it through an example, let say the rainfall is constant during a given time. In the first minute you send out the collected rainfall, in the next minute you sent out the collected rainfall of the previous minute and the elapsed minute. If you look to the destination the graph it goes up, which should be horizontal. When the rainfall stops it still send the previous collected amount of rain.

[cid:image002.png@01D6BE7F.A703DAA0] I did tried to get the stored buffer cleared, but I do understand why my attempts where not successfull.

I have added the INA260 sensor, which was easy because of how the SW is setup, so thank you for that. But also found out that it matters where you add additional measurementvaluestype in the public DataUnits as the order influences the webpage.

MQTT, to Raspberry PI, processed by nodeRed, stored in influxdb and presented by grafana.

Regards,

Paul

Van: lab-mathias-claussenmailto:notifications@github.com Verzonden: donderdag 19 november 2020 10:16 Aan: ElektorLabs/191148-RemakeWeatherStationmailto:191148-RemakeWeatherStation@noreply.github.com CC: Pakl8mailto:paul.klop@hotmail.com; Commentmailto:comment@noreply.github.com Onderwerp: Re: [ElektorLabs/191148-RemakeWeatherStation] rainmeter.cpp is wrong (#14)

Hi Pakl8,

this is going to be a bit tricky. The architecture has no direct path back to the value generating units. One way would be to extend the "Sensor channels" that can be found inside the station and build one that will, if read, reset the value. Also note that the Rainmeter is an Object so a direct access to it with external may be a way with some helper functions inside the .ino code file.

I try to get some time to implement it and also fix the other bugs that are currently left.......

Regards

Mathias Claußen

— You are receiving this because you commented. Reply to this email directly, view it on GitHubhttps://github.com/ElektorLabs/191148-RemakeWeatherStation/issues/14#issuecomment-730237957, or unsubscribehttps://github.com/notifications/unsubscribe-auth/ALGPY6RHEP5PJRZSLUHJ7FDSQTO7XANCNFSM4SB5GFTA.

lab-mathias-claussen commented 3 years ago

Hi Pakl8,

i would suggest i add a accumulating "Sensor" to the weater station as seperate channel ( or channels ) that can be mapped to what ever datasink you have.

Best Regards

Mathias Claußen

lab-mathias-claussen commented 3 years ago

Hi Pak8 , Hi t3hoe,

changes have been made and submitted to the Dev branch. After succsessful test this will be merged back to master branch. A new internel sensor for the accumulated rain amount has been added and will be reset once read. Not ideal but a fast solution for the moment. For a full acknolage based transmission some changes in the architecture are requiered.