Open2300 - Fix For Rain Total
You are here: Foswiki>Open2300 Web>FixForRainTotal (08 Mar 2008, OschenLars)Edit Attach

Patch Title


I took a look at a problem open2300 user often faced: there was a difference between rain_total in the history and the current value.

Somewhere in the memory map there was a hint and I double checked my memory dump:

Description of Patch

rain_total_reset(..) in rw2300 needs to changed to rewrite 12 times 0 (zero) starting at 0x043A when reseting the memory. This is really the location in the memory where the WS23xx stores its offset for raintotal.

After rw2300.c is patched recompile at least minmax2300.

Installation of Patch

Add the following lines to rain_total_reset(..) in rw2300.c


// Set value to zero offset table
memset(&data_value, 0, sizeof(data_value));

if (write_safe(ws2300, address, number, WRITENIB, data_value, command) = number)


History of Patch

Discussion and Comments

I'm not sure this is quite right. 0x043A is the value from the rain sensor. I'm not sure whether the station overwrites the first two values there, or whether it is incrementing them based on some accumulated number of rain "pulses" stored in the sensor. I do know that changing the batteries in the remote sensor causes these to reset to zero.

I think the correct fix is to the history programs to use 0x0440 as the basis for comparing the rain values.

Overwriting the third value at 0x0440 will make all your history values incorrect in reference to rain-total.

I've got some java code that attempts to handle this in my openjaws program (See, class, email me if you are having difficulty finding it through the svn browser at that site.

-- GrantGardner - 02 Mar 2008

Yes. I have noticed some strange behavior. In fact the patch is rubbish, I suppose. It is still best to use RAIN_OFFSET.

-- OschenLars - 08 Mar 2008
Topic revision: r3 - 08 Mar 2008, OschenLars
Copyright © 1999-2018 by the contributing authors. All material on this collaboration platform is the property of the contributing authors.
This website only use harmless session cookies. See Cookie Policy for details. By using this website you accept the use of these cookies.