Delay Port restart after feeding/water change
Delay Port restart after feeding/water change
Please let me know how to delay a port restart (if it was ON) after entering feeding/ water change mode.
This is my code, if port 5 was on before feeding/water change, I'd like to delay it for 1 min, until the water level in the sump gets back to normal high. Right now, this command does nothing, no effect: ReefAngel.Relay.DelayedOn( Port5,1 );
Also, I'd like to know how to prevent the lcd from entering a weird blinking loop mode after the wifi module is connected.
#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>q
#include <RF.h>
#include <IO.h>
#include <AI.h>
#include <DCPump.h>
#include <ReefAngel.h>
////// Place global variable code below here
////// Place global variable code above here
void setup()
{
InternalMemory.LCDID_write(255);
InternalMemory.FeedingTimer_write(900);
InternalMemory.LCDTimer_write(600);
InternalMemory.HeaterTempOn_write(760);
InternalMemory.HeaterTempOff_write(780);
InternalMemory.OverheatTemp_write(815);
InternalMemory.IMCheck_write(0xCF06A31E);
ReefAngel.Init(); //Initialize controller
ReefAngel.Use2014Screen();
// Ports toggled in Feeding Mode
ReefAngel.FeedingModePorts = Port1Bit | Port2Bit | Port3Bit | Port4Bit | Port5Bit | Port8Bit;
// Ports toggled in Water Change Mode
ReefAngel.WaterChangePorts = Port1Bit | Port2Bit | Port3Bit | Port4Bit | Port5Bit | Port7Bit | Port8Bit;
// Ports toggled when Lights On / Off menu entry selected
ReefAngel.LightsOnPorts = Port3Bit | Port4Bit;
// Ports turned off when Overheat temperature exceeded
ReefAngel.OverheatShutoffPorts = Port2Bit | Port3Bit | Port4Bit | Port5Bit |Port7Bit | Port8Bit;
// Use T1 probe as temperature and overheat functions
ReefAngel.TempProbe = T1_PROBE;
ReefAngel.OverheatProbe = T1_PROBE;
// Set the Overheat temperature setting
// Ports that are always on
ReefAngel.Relay.On( Port1 ); // main pump
ReefAngel.Relay.On( Port6 ); // reserved
////// Place additional initialization code below here
////// Place additional initialization code above here
}
void loop()
{
ReefAngel.Relay.DelayedOn( Port5,1 );
ReefAngel.StandardLights( Port2,11,0,18,0 ); // wavemaker
ReefAngel.StandardLights( Port3,18,0,22,0 ); //algae farm blue leds
ReefAngel.StandardLights( Port4,20,0,11,0 ); //algae farm red leds
ReefAngel.StandardLights( Port5,11,0,20,0 ); // skimmer
ReefAngel.StandardHeater( Port7,760,780 ); // heater
ReefAngel.StandardLights( Port8,11,0,20,0 ); // circulation pump
////// Place your custom code above here
// This should always be the last line
ReefAngel.Portal( "d0lph1n","****" );
ReefAngel.ShowInterface();
}
This is my code, if port 5 was on before feeding/water change, I'd like to delay it for 1 min, until the water level in the sump gets back to normal high. Right now, this command does nothing, no effect: ReefAngel.Relay.DelayedOn( Port5,1 );
Also, I'd like to know how to prevent the lcd from entering a weird blinking loop mode after the wifi module is connected.
#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>q
#include <RF.h>
#include <IO.h>
#include <AI.h>
#include <DCPump.h>
#include <ReefAngel.h>
////// Place global variable code below here
////// Place global variable code above here
void setup()
{
InternalMemory.LCDID_write(255);
InternalMemory.FeedingTimer_write(900);
InternalMemory.LCDTimer_write(600);
InternalMemory.HeaterTempOn_write(760);
InternalMemory.HeaterTempOff_write(780);
InternalMemory.OverheatTemp_write(815);
InternalMemory.IMCheck_write(0xCF06A31E);
ReefAngel.Init(); //Initialize controller
ReefAngel.Use2014Screen();
// Ports toggled in Feeding Mode
ReefAngel.FeedingModePorts = Port1Bit | Port2Bit | Port3Bit | Port4Bit | Port5Bit | Port8Bit;
// Ports toggled in Water Change Mode
ReefAngel.WaterChangePorts = Port1Bit | Port2Bit | Port3Bit | Port4Bit | Port5Bit | Port7Bit | Port8Bit;
// Ports toggled when Lights On / Off menu entry selected
ReefAngel.LightsOnPorts = Port3Bit | Port4Bit;
// Ports turned off when Overheat temperature exceeded
ReefAngel.OverheatShutoffPorts = Port2Bit | Port3Bit | Port4Bit | Port5Bit |Port7Bit | Port8Bit;
// Use T1 probe as temperature and overheat functions
ReefAngel.TempProbe = T1_PROBE;
ReefAngel.OverheatProbe = T1_PROBE;
// Set the Overheat temperature setting
// Ports that are always on
ReefAngel.Relay.On( Port1 ); // main pump
ReefAngel.Relay.On( Port6 ); // reserved
////// Place additional initialization code below here
////// Place additional initialization code above here
}
void loop()
{
ReefAngel.Relay.DelayedOn( Port5,1 );
ReefAngel.StandardLights( Port2,11,0,18,0 ); // wavemaker
ReefAngel.StandardLights( Port3,18,0,22,0 ); //algae farm blue leds
ReefAngel.StandardLights( Port4,20,0,11,0 ); //algae farm red leds
ReefAngel.StandardLights( Port5,11,0,20,0 ); // skimmer
ReefAngel.StandardHeater( Port7,760,780 ); // heater
ReefAngel.StandardLights( Port8,11,0,20,0 ); // circulation pump
////// Place your custom code above here
// This should always be the last line
ReefAngel.Portal( "d0lph1n","****" );
ReefAngel.ShowInterface();
}
Re: Delay Port restart after feeding/water change
The issue is because you have this line after overriding the DelayedOn.
I would remove that and wrap the delayed on with a time check
Code: Select all
ReefAngel.StandardLights( Port5,11,0,20,0 ); // skimmer
Code: Select all
if (hour() >= 11 && hour()<20) ReefAngel.Relay.DelayedOn(Port5,1);
Re: Delay Port restart after feeding/water change
Thanks, it worked.
Any idea about my 2nd question, when the lcd reboots itself, it goes from normal, blank, blank & line... etc when the wifi module is connected?
Any idea about my 2nd question, when the lcd reboots itself, it goes from normal, blank, blank & line... etc when the wifi module is connected?
Re: Delay Port restart after feeding/water change
I'm not sure on that one. Sounds like maybe a loose signal somewhere with the LCD or the connectors to the TTY
Re: Delay Port restart after feeding/water change
It's not doing it when i connect the usb cable. I have the feeling it has to do with wifi module; it is preventing the lcd from going in standby, some incompatibity between my old RA+ and the newer firmware.
Re: Delay Port restart after feeding/water change
One important detail, it's doesn't do it if the screen is already in standby and the wifi module is connected, only when the screen is on, it triggers the rebooting chaoslnevo wrote:I'm not sure on that one. Sounds like maybe a loose signal somewhere with the LCD or the connectors to the TTY
Re: Delay Port restart after feeding/water change
As i mentioned, the command works, i mean, the port is delayed but the skimmer is not turned off after 20:00. Please advise. Thanks.lnevo wrote:The issue is because you have this line after overriding the DelayedOn.I would remove that and wrap the delayed on with a time checkCode: Select all
ReefAngel.StandardLights( Port5,11,0,20,0 ); // skimmer
Code: Select all
if (hour() >= 11 && hour()<20) ReefAngel.Relay.DelayedOn(Port5,1);
Re: Delay Port restart after feeding/water change
Yeah sounds like a loose connection being rocked. I always have temp sensor issues when jiggling things. If the monitor is off it won't cut out and initialize badly
Re: Delay Port restart after feeding/water change
Few years ago, I started with RA..I added a 2nd relay unit, later, I upgraded the board to a RA+. Now, the 2nd relay unit is not connected anymore, and I don't remember if I moved any jumper(s) or not. Is it possible that an incorrect jumper setting on the RA+ board might affect the way the LCD behaves when the WIFI module is connected?lnevo wrote:Yeah sounds like a loose connection being rocked. I always have temp sensor issues when jiggling things. If the monitor is off it won't cut out and initialize badly