waterlevel ato

Basic / Standard Reef Angel hardware

Posts: 411
Joined: Sat Mar 30, 2013 5:02 pm
Location: CT, USA
PostPosted: Thu Jul 13, 2017 4:36 am
There was discussion on re-doing the water-level class. Any movement on that?

Posts: 411
Joined: Sat Mar 30, 2013 5:02 pm
Location: CT, USA
PostPosted: Wed Jul 19, 2017 5:10 am
guess not..
sorry to say but support has plummeted.
User avatar
Posts: 2749
Joined: Fri Mar 18, 2011 6:20 pm
Location: Illinois
PostPosted: Wed Jul 19, 2017 9:58 am
I'm not sure what the discussion was about. What was going to be done with it? I'm asking out of curiosity.

Posts: 411
Joined: Sat Mar 30, 2013 5:02 pm
Location: CT, USA
PostPosted: Wed Jul 19, 2017 3:26 pm
binder wrote:I'm not sure what the discussion was about. What was going to be done with it? I'm asking out of curiosity.


viewtopic.php?f=3&t=6043

viewtopic.php?f=2&t=6070&start=10
User avatar
Posts: 2749
Joined: Fri Mar 18, 2011 6:20 pm
Location: Illinois
PostPosted: Wed Jul 19, 2017 3:29 pm
gotcha. i haven't kept up on this. I don't use an ATO. I just have a gravity fed float valve feeding my sump.

Sent from my XT1585 using Tapatalk
User avatar
Posts: 5362
Joined: Fri Jul 20, 2012 9:42 am
PostPosted: Wed Jul 26, 2017 7:01 pm
Sorry I havent been around as much as I should. Nothings happened. It might be better to do a straightforward if then else on the WL and add a separate time based flag for now. The WL ATO class does things with milliseconds and stuff that I think its where its failing.

The problem I have is not much way to test. I know its a lot but once I get my Star setup I may be in a better position to help write something different.
User avatar
Posts: 5362
Joined: Fri Jul 20, 2012 9:42 am
PostPosted: Mon Jul 31, 2017 1:01 am
I have a feeling I know whats' going on.

Millis does wrap occasionally.

I have a feeling that we are catching those moments. The if statement looks like this

WLATO.Timer = millis() // Iniitalizing the variable...

if ( (millis()-WLATO.Timer > TempTimeout)

If millis wraps when we subtract we get a negative number, granted these are unsigned longs, but not sure how well it takes it. In any case I have some debug code running on my Star and will see if I can recreate it. I think I can :)
User avatar
Posts: 5362
Joined: Fri Jul 20, 2012 9:42 am
PostPosted: Mon Jul 31, 2017 1:09 am
Whoa, I don't think it's the case... I think we're getting stuck in the starting section... I added a Serial.println in the section where we set WLATO.Timer = millis() expecting to get the starting value. and it printed non-stop. Which means I think that WLATO.IsTopping() is not getting set.

if ( WaterLevel.GetLevel(Channel) < LowLevel && ( !WLATO.IsTopping()) && bitRead(AlertFlags,ATOTimeOutFlag)==0)
{
WLATO.Timer = millis();
Serial.print("Starting: ");
Serial.println(WLATO.Timer);
WLATO.StartTopping();
Relay.On(ATORelay);
}

Serial output:

Starting: 309422
Starting: 309568
Starting: 309715
Starting: 309861
Starting: 310007
Starting: 310154

This should be relatively easy to fix I think... So right now it's just a matter of time from the starting millis() that you get a premature timeout.
User avatar
Posts: 5362
Joined: Fri Jul 20, 2012 9:42 am
PostPosted: Mon Jul 31, 2017 4:17 am
hmmm why does this always return false? For the low and high ato ports, it reads the pins, we could probably have this function return activestatus but I need to see where we set that to make sure it's implemented.

#if defined WATERLEVELEXPANSION || defined MULTIWATERLEVELEXPANSION
class RA_ATOWLClass : public RA_ATOClass
{
public:
unsigned long Timer;
inline bool IsActive() { return false; }
};
#endif // WATERLEVELEXPANSION || MULTIWATERLEVELEXPANSION

Posts: 12327
Joined: Fri Mar 18, 2011 6:47 pm
PostPosted: Mon Jul 31, 2017 4:44 am
For ATO pins, it is active or not active.
On WL, there is no active state.
Roberto.
Next

Return to Standard

Who is online

Users browsing this forum: No registered users and 2 guests

cron