DC Pumps Not Responding to Time Event

Do you have a question on how to do something.
Ask in here.
Post Reply
User avatar
CaliFSU
Posts: 11
Joined: Fri Mar 18, 2016 7:49 am

DC Pumps Not Responding to Time Event

Post by CaliFSU »

Hi all,

I have my dual Jaebo RW-4's on a "SetMode" schedule. They will not physically change when the time event occurs. The only fix I have for now is rebooting my relay box. Any thoughts?

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 <PAR.h>
#include <ReefAngel.h>
#include <Tide.h>  

////// Place global variable code below here
Tide tide;

////// Place global variable code above here

// Define Relay Ports by Name
#define MoonLights         1
#define MainPump           2
#define WhiteLED           3
#define Skimmer            4
#define BlueLED            5
#define Unused             6
#define Unused             7
#define ATO_Pump           8




void setup()
{
	// This must be the first line
	ReefAngel.Init();  //Initialize controller
	ReefAngel.Use2014Screen();  // Let's use 2014 Screen 
	ReefAngel.AddPHExpansion();  // pH Expansion Module
								 // Ports toggled in Feeding Mode
	ReefAngel.FeedingModePorts = Port2Bit | Port4Bit;
	// Ports toggled in Water Change Mode
	ReefAngel.WaterChangePorts = Port2Bit | Port4Bit;
	// Feeeding and Water Change mode speed
	ReefAngel.DCPump.FeedingSpeed = 0;
	ReefAngel.DCPump.WaterChangeSpeed = 0;
	// Ports toggled when Lights On / Off menu entry selected
	ReefAngel.LightsOnPorts = Port1Bit | Port3Bit | Port5Bit;
	// Ports turned off when Overheat temperature exceeded
	ReefAngel.OverheatShutoffPorts = Port3Bit | Port5Bit;
	// Use T1 probe as temperature and overheat functions
	ReefAngel.TempProbe = T1_PROBE;
	ReefAngel.OverheatProbe = T1_PROBE;
	// Set the Overheat temperature setting
	InternalMemory.OverheatTemp_write(869);

	// Feeeding and Water Change mode speed
	ReefAngel.DCPump.FeedingSpeed = 0;
	ReefAngel.DCPump.WaterChangeSpeed = 0;


	// Ports that are always on
	ReefAngel.Relay.On(Port2);
	ReefAngel.Relay.On(Port4);
	ReefAngel.Relay.On(Port8);

	////// Place additional initialization code below here


	////// Place additional initialization code above here
}

void loop()
{
	switch (tmWday)
	{
	case 1: //Sunday
		if (hour() >= 11 || hour() < 8) {
			ReefAngel.StandardLights(Port1, 0);
			ReefAngel.StandardLights(Port1, 20, 0, 7, 0);
			ReefAngel.StandardLights(Port3, 11, 0, 19, 0);
			ReefAngel.StandardLights(Port5, 11, 0, 19, 0);
		}
		break;
	case 2: //Monday
		if (hour() >= 12 || hour() < 8) {
			ReefAngel.StandardLights(Port1, 20, 0, 7, 0);
			ReefAngel.StandardLights(Port3, 12, 0, 20, 0);
			ReefAngel.StandardLights(Port5, 12, 0, 20, 0);
		}
		break;
	case 3: //Tuesday
		if (hour() >= 12 || hour() < 8) {
			ReefAngel.StandardLights(Port1, 20, 0, 7, 0);
			ReefAngel.StandardLights(Port3, 12, 0, 20, 0);
			ReefAngel.StandardLights(Port5, 12, 0, 20, 0);
		}
		break;
	case 4: //Wednesday
		if (hour() >= 12 || hour() < 8) {
			ReefAngel.StandardLights(Port1, 20, 0, 7, 0);
			ReefAngel.StandardLights(Port3, 12, 0, 20, 0);
			ReefAngel.StandardLights(Port5, 12, 0, 20, 0);
		}
		break;
	case 5: //Thursday
		if (hour() >= 12 || hour() < 8) {
			ReefAngel.StandardLights(Port1, 20, 0, 7, 0);
			ReefAngel.StandardLights(Port3, 12, 0, 20, 0);
			ReefAngel.StandardLights(Port5, 12, 0, 20, 0);
		}
		break;
	case 6: //Friday
		if (hour() >= 11 || hour() < 8) {
			ReefAngel.StandardLights(Port1, 20, 0, 7, 0);
			ReefAngel.StandardLights(Port3, 12, 0, 20, 0);
			ReefAngel.StandardLights(Port5, 12, 0, 20, 0);
		}
		break;
	case 7: //Saturday
		ReefAngel.StandardLights(Port1, 20, 0, 7, 0);
		ReefAngel.StandardLights(Port3, 11, 0, 20, 0);
		ReefAngel.StandardLights(Port5, 11, 0, 20, 0);
		break;
	default:
		ReefAngel.StandardLights(Port1, 20, 0, 7, 0);
		ReefAngel.StandardLights(Port3, 0, 0, 0, 0);
		ReefAngel.StandardLights(Port5, 0, 0, 0, 0);
		break;

	} 
		
	ReefAngel.DCPump.UseMemory = false;
	
	//ReefAngel.DCPump.SetMode(ReefCrest, 45, 5);
	ReefAngel.PWM.SetActinic(MoonPhase());
	ReefAngel.DCPump.DaylightChannel = Sync;
	ReefAngel.DCPump.ActinicChannel = AntiSync;
	

	if (hour() >= 20 || hour()<7) {
		
		//ReefAngel.DCPump.SetMode(TideMode(15, 3, 7), 15, 10);
		ReefAngel.DCPump.SetMode(Lagoon, 20, 5);

	}
	else if (hour() >= 7 || hour()<20)
	{
		ReefAngel.DCPump.SetMode(ReefCrest, 45, 10);
		//ReefAngel.DCPump.SetMode(TideMode(45, 3, 10),45,10);
		
	}

	

	////// Place your custom code below here

	////// Place your custom code above here

	// This should always be the last line
	ReefAngel.Portal("CaliFSU");
	ReefAngel.ShowInterface();
}


>>--Cali-->
User avatar
cosmith71
Posts: 1437
Joined: Fri Mar 29, 2013 3:51 pm
Location: Oklahoma City

Re: DC Pumps Not Responding to Time Event

Post by cosmith71 »

Change this:

Code: Select all

else if (hour() >= 7 || hour()<20)
to this:

Code: Select all

if (hour() >= 7 && hour()<20)
--Colin
User avatar
CaliFSU
Posts: 11
Joined: Fri Mar 18, 2016 7:49 am

Re: DC Pumps Not Responding to Time Event

Post by CaliFSU »

Thanks Colin this helped!
>>--Cali-->
Post Reply