Freshwater Ato switches on during reboot.
-
lmolenmaker
- Posts: 59
- Joined: Tue Nov 12, 2013 5:58 am
Freshwater Ato switches on during reboot.
Hi guys,
After my freshwater drum got emptied in a rate much bigger than my usual evaporation rate for one day, I started to investigate what happened. As my relay activity chart doesn't display the actions correctly (sometimes data has been plotted on the chart and sometimes not, maybe somebody can help me with that as well), that was of no use.
So I switched off the power and switched it on again, I noticed that my freshwater AtO (port 5) switches on during reboot. Once the reboot is finished it stops and acts perfectly according the rules I set.
So my guess is that the system got rebooted for some reason, could be a power outage a couple of times.
How can I prevent port 5 from switching on during a reboot?
Any help is much appreciated.
Thanks.
Leslie
After my freshwater drum got emptied in a rate much bigger than my usual evaporation rate for one day, I started to investigate what happened. As my relay activity chart doesn't display the actions correctly (sometimes data has been plotted on the chart and sometimes not, maybe somebody can help me with that as well), that was of no use.
So I switched off the power and switched it on again, I noticed that my freshwater AtO (port 5) switches on during reboot. Once the reboot is finished it stops and acts perfectly according the rules I set.
So my guess is that the system got rebooted for some reason, could be a power outage a couple of times.
How can I prevent port 5 from switching on during a reboot?
Any help is much appreciated.
Thanks.
Leslie
-
rimai
- Posts: 12857
- Joined: Fri Mar 18, 2011 6:47 pm
-
lmolenmaker
- Posts: 59
- Joined: Tue Nov 12, 2013 5:58 am
Re: Freshwater Ato switches on during reboot.
Hi Roberto, Please find below the code (not sure how to embed it):
Code: Select all
#include <ReefAngel_Features.h>
#include <Globals.h>
#include <RA_Wifi.h>
#include <Wire.h>
#include <OneWire.h>
#include <Time.h>
#include <DS1307RTC.h>
#include <InternalEEPROM.h>
#include <RA_NokiaLCD.h>
#include <RA_ATO.h>
#include <RA_Joystick.h>
#include <LED.h>
#include <RA_TempSensor.h>
#include <Relay.h>
#include <RA_PWM.h>
#include <Timer.h>
#include <Memory.h>
#include <InternalEEPROM.h>
#include <RA_Colors.h>
#include <RA_CustomColors.h>
#include <Salinity.h>
#include <RF.h>
#include <IO.h>
#include <ORP.h>
#include <AI.h>
#include <PH.h>
#include <WaterLevel.h>
#include <Humidity.h>
#include <DCPump.h>
#include <ReefAngel.h>
////// Place global variable code below here
////// Place global variable code above here
void setup()
{
// This must be the first line
ReefAngel.Init(); //Initialize controller
ReefAngel.SetTemperatureUnit( Celsius ); // set to Celsius Temperature
ReefAngel.Use2014Screen(); // Let's use 2014 Screen
ReefAngel.AddWaterLevelExpansion(); // Water Level Expansion Module
// Ports toggled in Feeding Mode
ReefAngel.FeedingModePorts = 0;
// Ports toggled in Water Change Mode
ReefAngel.WaterChangePorts = 0;
// Ports toggled when Lights On / Off menu entry selected
ReefAngel.LightsOnPorts = 0;
// Ports turned off when Overheat temperature exceeded
ReefAngel.OverheatShutoffPorts = 0;
// Use T1 probe as temperature and overheat functions
ReefAngel.TempProbe = T1_PROBE;
ReefAngel.OverheatProbe = T1_PROBE;
// Set the Overheat temperature setting
InternalMemory.OverheatTemp_write( 500 );
// Feeeding and Water Change mode speed
ReefAngel.DCPump.FeedingSpeed=0;
ReefAngel.DCPump.WaterChangeSpeed=0;
ReefAngel.DCPump.ActinicChannel=Sync; // Now you're pump will be affected by the portal settings.
// Ports that are always on
////// Place additional initialization code below here
////// Place additional initialization code above here
}
void loop()
{
ReefAngel.StandardFan( Port1,250,255 );
ReefAngel.StandardLights( Port2,9,30,21,30 );
ReefAngel.StandardLights( Port3,10,30,22,30 );
ReefAngel.StandardLights( Port4,19,0,19,1 );
ReefAngel.StandardHeater( Port7,245,250 );
ReefAngel.DCPump.UseMemory = false;
//ReefAngel.DCPump.SetMode( ShortPulse,90,165 );
ReefAngel.DCPump.DaylightChannel = None;
ReefAngel.DCPump.ActinicChannel = Sync;
////// Place your custom code below here
ReefAngel.DCPump.UseMemory=true; // Use whatever is in the portal
////////
if ( (hour() >=18) && (hour() <20) )
ReefAngel.Relay.Off(Port5); // Freshwater ATO off between 18.00 and 20.00, port 5
else
ReefAngel.WaterLevelATO(Port5,30,95,99); // else min level 95% and max level 99%, timeout 30 sec
/////////
if ( (hour() >=18) && (hour() <19) )
ReefAngel.WaterLevelATO(Port6,4000,96,99); // Saltwater ATO on when below 96%, max level 99%, timeout 4000 sec. Port 6 between 18.00 and 19.00
else
ReefAngel.Relay.Off(Port6); // otherwise port 6 off
//////////
////// Place your custom code above here
// This should always be the last line
ReefAngel.Portal( "lmolenmaker" );
ReefAngel.ShowInterface();
}
-
rimai
- Posts: 12857
- Joined: Fri Mar 18, 2011 6:47 pm
Re: Freshwater Ato switches on during reboot.
I don't think you can use the ato function on two ports.
What's the intended purpose?
What's the intended purpose?
Roberto.
-
lmolenmaker
- Posts: 59
- Joined: Tue Nov 12, 2013 5:58 am
Re: Freshwater Ato switches on during reboot.
Hi Roberto,
The idea is the following for an automatic water change.
I have two top off drums with pumps (salt-water port 6 and freshwater port 5 ).
Every day just after 18.00 a drain pump (not connected to the reefangel) will drain for a few minutes to bring it down to about 85 % level.
Of course the freshwater relay need to be switched off during this time, hence the rule 18.00 until 20.00.
I know it should take not longer than about 50 minutes for the salt-water pump to pump it to level 99%, hence the rule for 18.00 until 19.00.
Once reached 99% and time is 19.00 the salt-water relay should be turned off.
And freshwater relay should be turned on again for evaporation purposes at 20.00.
Next day same sequence.
I must say, it works like a charm, but only when the reefangel reboots, relay 5 (freshwater) switches on during the reboot and then switches off according the rule I set. It is quite common that we have very short power outages of a few seconds, especially if we have heavy weather. In such a case the freshwater will be pumped in when it is not supposed to.
Hope this is a little bit clear.
Leslie
The idea is the following for an automatic water change.
I have two top off drums with pumps (salt-water port 6 and freshwater port 5 ).
Every day just after 18.00 a drain pump (not connected to the reefangel) will drain for a few minutes to bring it down to about 85 % level.
Of course the freshwater relay need to be switched off during this time, hence the rule 18.00 until 20.00.
I know it should take not longer than about 50 minutes for the salt-water pump to pump it to level 99%, hence the rule for 18.00 until 19.00.
Once reached 99% and time is 19.00 the salt-water relay should be turned off.
And freshwater relay should be turned on again for evaporation purposes at 20.00.
Next day same sequence.
I must say, it works like a charm, but only when the reefangel reboots, relay 5 (freshwater) switches on during the reboot and then switches off according the rule I set. It is quite common that we have very short power outages of a few seconds, especially if we have heavy weather. In such a case the freshwater will be pumped in when it is not supposed to.
Hope this is a little bit clear.
Leslie
-
rimai
- Posts: 12857
- Joined: Fri Mar 18, 2011 6:47 pm
Re: Freshwater Ato switches on during reboot.
Try adding ReefAngel.Relay.Off(Port5); to the setup() section.
Roberto.
-
lmolenmaker
- Posts: 59
- Joined: Tue Nov 12, 2013 5:58 am
Re: Freshwater Ato switches on during reboot.
Hi Roberto,
Thanks, but it switches on as well for a very short second.
If 2 ports on one ATO doesn't work, how do I code the sequence mentioned above ?
Also, i would like to be emailed if Relay 5 switches on (and off), there are so many abbreviations in the portal settings and I don't know what they mean. Is there a list with the explanation of the abbreviations somewhere and which parameters need to be filled in for the trigger?
Thanks in advance.
Leslie
Thanks, but it switches on as well for a very short second.
If 2 ports on one ATO doesn't work, how do I code the sequence mentioned above ?
Also, i would like to be emailed if Relay 5 switches on (and off), there are so many abbreviations in the portal settings and I don't know what they mean. Is there a list with the explanation of the abbreviations somewhere and which parameters need to be filled in for the trigger?
Thanks in advance.
Leslie
-
rimai
- Posts: 12857
- Joined: Fri Mar 18, 2011 6:47 pm
Re: Freshwater Ato switches on during reboot.
I don't think it is the use of the function twice that is causing the problem.
I think it could be that when the controller reboots, water level is at 0% and it thinks that it needs to pump.
Then, the very next split second, it updates the level from the module and sees it at for example 98% and shuts the port off.
Let's try this:
What this is going to do is wait for a second to make sure the controller got the water level updated before it starts the ATO function.
I think it could be that when the controller reboots, water level is at 0% and it thinks that it needs to pump.
Then, the very next split second, it updates the level from the module and sees it at for example 98% and shuts the port off.
Let's try this:
Code: Select all
if (millis() > 1000)
{
if ( (hour() >=18) && (hour() <20) )
ReefAngel.Relay.Off(Port5); // Freshwater ATO off between 18.00 and 20.00, port 5
else
ReefAngel.WaterLevelATO(Port5,30,95,99); // else min level 95% and max level 99%, timeout 30 sec
/////////
if ( (hour() >=18) && (hour() <19) )
ReefAngel.WaterLevelATO(Port6,4000,96,99); // Saltwater ATO on when below 96%, max level 99%, timeout 4000 sec. Port 6 between 18.00 and 19.00
else
ReefAngel.Relay.Off(Port6); // otherwise port 6 off
}
Roberto.
-
lmolenmaker
- Posts: 59
- Joined: Tue Nov 12, 2013 5:58 am
Re: Freshwater Ato switches on during reboot.
Hi Roberto,
Thank you so much. IT WORKS !!
It brings me to the other question, mentioned above.
I would like the Portal to send me an email alert when port 5 switches on. Now the Portal settings show a lot of abbreviations, and I don't know what they stand for.
Is there a list with the explanations of the abbreviations somewhere and also which trigger parameters to fill in.
Thanks in advance.
Leslie
Thank you so much. IT WORKS !!
It brings me to the other question, mentioned above.
I would like the Portal to send me an email alert when port 5 switches on. Now the Portal settings show a lot of abbreviations, and I don't know what they stand for.
Is there a list with the explanations of the abbreviations somewhere and also which trigger parameters to fill in.
Thanks in advance.
Leslie
-
rimai
- Posts: 12857
- Joined: Fri Mar 18, 2011 6:47 pm
Re: Freshwater Ato switches on during reboot.
Here is the list:
http://forum.reefangel.com/viewtopic.php?p=5957#p5957
But unfortunately the relay data, which would be letter R, includes all ports. Not much useful.
I think the best way is to include this to your code:
The code above will set the custom variable 0 to be the status of port 5.
Then setup a trigger on C0>0 to alert you.
http://forum.reefangel.com/viewtopic.php?p=5957#p5957
But unfortunately the relay data, which would be letter R, includes all ports. Not much useful.
I think the best way is to include this to your code:
Code: Select all
ReefAngel.CustomVar[0]=ReefAngel.Relay.Status(Port5);
ReefAngel.CustomVar[7]=255;Then setup a trigger on C0>0 to alert you.
Roberto.
-
lmolenmaker
- Posts: 59
- Joined: Tue Nov 12, 2013 5:58 am
Re: Freshwater Ato switches on during reboot.
Thank you Roberto.
I try to understand this little piece of code, so I can set more triggers.
What does the second line stand for (7 and 255) ?
Sorry for all those questions. I just want to get it right.
Leslie
I try to understand this little piece of code, so I can set more triggers.
What does the second line stand for (7 and 255) ?
Sorry for all those questions. I just want to get it right.
Leslie
-
rimai
- Posts: 12857
- Joined: Fri Mar 18, 2011 6:47 pm
Re: Freshwater Ato switches on during reboot.
Ahh..
You really don't need that.
If you remove, it will also work.
We have 8 custom variables, from CustomVar[0] to CustomVar[7].
I included it in there just to make sure the portal will show up the custom var section all the time.
It checks for a value that is not zero in any of the of variables. If it finds it, it displays the section. If all are zero, it hides.
So, just to ensure the section will show up all the time, even when your port5 is off, I assigned the last variable to a value that is non zero to force the Portal to display the section
You really don't need that.
If you remove, it will also work.
We have 8 custom variables, from CustomVar[0] to CustomVar[7].
I included it in there just to make sure the portal will show up the custom var section all the time.
It checks for a value that is not zero in any of the of variables. If it finds it, it displays the section. If all are zero, it hides.
So, just to ensure the section will show up all the time, even when your port5 is off, I assigned the last variable to a value that is non zero to force the Portal to display the section
Roberto.