Have used wizard to set time schedule but not working?

Do you have a question on how to do something.
Ask in here.
Post Reply
dazza1304
Posts: 154
Joined: Sat Aug 04, 2012 4:22 am

Have used wizard to set time schedule but not working?

Post by dazza1304 »

Hi, as above.

Code from wizard is

ReefAngel.MHLights( Port3,0,40,23,30,5 );
ReefAngel.StandardHeater( Port6,249,251 );
ReefAngel.StandardFan( Port7,250,252 );
ReefAngel.StandardLights( Box1_Port5,23,30,23,32 );

My problem is the box 1 port 5 - I can manually turn on and off fine with portal and iphone app, but ReefAngel.StandardLights( Box1_Port5,23,30,23,32 ); doesnt seem to work - i.e. it does not come on from 23:30 to 23:32.

I cannot see anything wrong, so can anyone help please?
Sebyte

Re: Have used wizard to set time schedule but not working?

Post by Sebyte »

If you do not have a second relay box, then you do not need to specify the box number. Try removing Box_ from the function.
dazza1304
Posts: 154
Joined: Sat Aug 04, 2012 4:22 am

Re: Have used wizard to set time schedule but not working?

Post by dazza1304 »

Sorry, should have said, I do have a second relay box!
User avatar
DrewPalmer04
Posts: 818
Joined: Tue May 29, 2012 2:12 pm
Location: Christopher, IL

Re: Have used wizard to set time schedule but not working?

Post by DrewPalmer04 »

Please post your full code
Out for now...but not over.

VISIT: Ethernet Module/Wifi Alternative
dazza1304
Posts: 154
Joined: Sat Aug 04, 2012 4:22 am

Re: Have used wizard to set time schedule but not working?

Post by dazza1304 »

DrewPalmer04 wrote:Please post your full code
Below is the full code:

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

////// Place global variable code below here
unsigned long lastLowSal=now();

////// 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

// Ports toggled in Feeding Mode
ReefAngel.FeedingModePorts = 0;
ReefAngel.FeedingModePortsE[0] = 0;
// Ports toggled in Water Change Mode
ReefAngel.WaterChangePorts = 0;
ReefAngel.WaterChangePortsE[0] = 0;
// Ports toggled when Lights On / Off menu entry selected
ReefAngel.LightsOnPorts = 0;
ReefAngel.LightsOnPortsE[0] = 0;
// Ports turned off when Overheat temperature exceeded
ReefAngel.OverheatShutoffPorts = Port6Bit;
ReefAngel.OverheatShutoffPortsE[0] = 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( 255 );


// Ports that are always on
ReefAngel.Relay.On( Port4 );
ReefAngel.Relay.On( Port5 );
ReefAngel.Relay.On( Port8 );
ReefAngel.Relay.On( Box1_Port1 );
ReefAngel.Relay.On( Box1_Port4 );
ReefAngel.Relay.On( Box1_Port6 );
ReefAngel.Relay.On( Box1_Port7 );

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


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

void loop()
{
ReefAngel.MHLights( Port3,0,40,23,30,5 );
ReefAngel.StandardHeater( Port6,249,251 );
ReefAngel.StandardFan( Port7,250,252 );
ReefAngel.StandardLights( Box1_Port5,23,30,23,32 );
////// Place your custom code below here
///// If salinity > 35.1 activate ATO pump until salinity < 35.1
if (ReefAngel.Params.Salinity<351) lastLowSal=now();
ReefAngel.Relay.Set(Port1,(now()-lastLowSal>120));
///// if skimmer cup full, turn off skimmer
if (ReefAngel.HighATO.IsActive()) {
bitClear(ReefAngel.Relay.RelayMaskOff,2);
}
else {
bitSet(ReefAngel.Relay.RelayMaskOff,2);
}

////// Place your custom code above here
User avatar
lnevo
Posts: 5422
Joined: Fri Jul 20, 2012 9:42 am

Have used wizard to set time schedule but not working?

Post by lnevo »

Does that port work otherwise? Port 5/6 have special circuitry for wave-makers...shouldn't be a problem but just something to try... The code looks fine but you did not post all of it...bit i dont know if its a code problen
dazza1304
Posts: 154
Joined: Sat Aug 04, 2012 4:22 am

Re: Have used wizard to set time schedule but not working?

Post by dazza1304 »

lnevo wrote:Does that port work otherwise? Port 5/6 have special circuitry for wave-makers...shouldn't be a problem but just something to try... The code looks fine but you did not post all of it...bit i dont know if its a code problen
Hi, yes port works fine, I can manually switch on and off etc.
dazza1304
Posts: 154
Joined: Sat Aug 04, 2012 4:22 am

Re: Have used wizard to set time schedule but not working?

Post by dazza1304 »

Hi I have had a little play around and have got it working.

I changed ReefAngel.StandardLights( Box1_Port5,23,30,23,32 );
to ReefAngel.MHLights( Box1_Port5,23,30,23,32,1 );

I think, though I might be wrong, when using the wizard, when setting a timer if you put the delay to 0, it doesn't populate a required field of the command ReefAngel.MHLights?

Maybe this caused my problem?
User avatar
lnevo
Posts: 5422
Joined: Fri Jul 20, 2012 9:42 am

Have used wizard to set time schedule but not working?

Post by lnevo »

What kind of lights are they? Not sure how MH work but I guess since you put no delay it made them StandardLights..
dazza1304
Posts: 154
Joined: Sat Aug 04, 2012 4:22 am

Re: Have used wizard to set time schedule but not working?

Post by dazza1304 »

lnevo wrote:What kind of lights are they? Not sure how MH work but I guess since you put no delay it made them StandardLights..
It not actually lights - it's turning on an air pump to mix Red Sea reef energy before dosing!

The wizard obviously picks the MH function when choosing a timer schedule.

Not sure why it suddenly works, but got it doing what I want now, which is the main thing!
User avatar
lnevo
Posts: 5422
Joined: Fri Jul 20, 2012 9:42 am

Have used wizard to set time schedule but not working?

Post by lnevo »

Odd for sure...

I would use the DosingPump function to make it clearer what your doing...nevermind its just for the mixing part...

Now that you have a working code base you can drop the wizard. :)
dazza1304
Posts: 154
Joined: Sat Aug 04, 2012 4:22 am

Re: Have used wizard to set time schedule but not working?

Post by dazza1304 »

lnevo wrote:Odd for sure...

I would use the DosingPump function to make it clearer what your doing...

Now that you have a working code base you can drop the wizard. :)
Agreed!
Post Reply