Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

rainmeter.cpp is wrong #14

Open
t3hoe opened this issue Oct 2, 2020 · 5 comments
Open

rainmeter.cpp is wrong #14

t3hoe opened this issue Oct 2, 2020 · 5 comments

Comments

@t3hoe
Copy link

t3hoe commented Oct 2, 2020

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

Pakl8 commented Nov 18, 2020

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

@lab-mathias-claussen
Copy link
Collaborator

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

Pakl8 commented Nov 19, 2020 via email

@lab-mathias-claussen
Copy link
Collaborator

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
Copy link
Collaborator

lab-mathias-claussen commented Nov 20, 2020

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.

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
None yet
Projects
None yet
Development

No branches or pull requests

3 participants