Need help with controller

Basic / Standard Reef Angel hardware
Post Reply
lucho
Posts: 80
Joined: Fri Mar 02, 2012 8:11 am

Need help with controller

Post by lucho »

Hi. I have had a Reef Angel for a couple of years now. It has mostly worked correctly, but I am having a lot of problem lately.

I have recently added a second relay, and maybe that is creating the problem. After a couple of hours I find that the controller will not work any more (e.g., lights will not turn on). It would basically keep the settings fixed. When I check the controller, I find the Status light blinking constantly, and the time and date be very far in the future (e.g., 11/29/2039). When I unplug and replug the controller, this gets fixed (correct time and date, normal functioning) for some hours and then eventually it stops working again.

Below is the code. Please help! What is happening? How do I fix this? Thanks!
#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

// Define Relay Ports by Name
#define MainLights 1
#define Actinics 2
#define LightFans 4
#define Unused1 3
#define Unused2 5
#define ATOPump 6
#define Skimmer 7
#define Return 8

#define MP401 Box1_Port1
#define MP402 Box1_Port2
#define Sump Box1_Port3
#define MP10 Box1_Port4
#define DPump1 Box1_Port5
#define DPump2 Box1_Port6
#define Reactor Box1_Port7
#define Unused3 Box1_Port8

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


void setup()
{
// This must be the first line
ReefAngel.Init(); //Initialize controller
// Ports toggled in Feeding Mode
ReefAngel.FeedingModePorts = Port7Bit;
// Ports toggled in Water Change Mode
ReefAngel.WaterChangePorts = Port7Bit | Port8Bit;
// Ports toggled when Lights On / Off menu entry selected
ReefAngel.LightsOnPorts = 0;
// Ports turned off when Overheat temperature exceeded
ReefAngel.OverheatShutoffPorts = Port1Bit | Port2Bit | Port7Bit;
// Use T1 probe as temperature and overheat functions
ReefAngel.TempProbe = T1_PROBE;
ReefAngel.OverheatProbe = T1_PROBE;

// Ports that are always on
ReefAngel.Relay.On( Skimmer );
ReefAngel.Relay.On( Return );
ReefAngel.Relay.On( MP401 );
ReefAngel.Relay.On( MP402 );
ReefAngel.Relay.On( MP10 );
ReefAngel.Relay.On( Sump );

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


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

void loop()
{
ReefAngel.DayLights( MainLights );
ReefAngel.ActinicLights( Actinics );
ReefAngel.ActinicLights( LightFans );
ReefAngel.WaterLevelATO( ATOPump );
ReefAngel.DosingPump1( DPump1 );
ReefAngel.DosingPump2( DPump2 );
//ReefAngel.DosingPumpRepeat3( Reactor);

//ReefAngel.StandardHeater( Heater );

// Pumps for night mode, start with lagoon, short pulse most of the day
if (ReefAngel.DisplayedMenu!=FEEDING_MODE || ReefAngel.DisplayedMenu!=WATERCHANGE_MODE)
{
if (hour()>=21 && hour()<=22)
{
ReefAngel.RF.UseMemory=false;
ReefAngel.RF.SetMode(LongWave,60,3);
}
else if (hour()>=23 || hour()<9)
{
ReefAngel.RF.UseMemory=false;
ReefAngel.RF.SetMode(ReefCrest,40,0);
}
else if (hour()>=9 && hour()<=10)
{
ReefAngel.RF.UseMemory=false;
ReefAngel.RF.SetMode(LongWave,60,3);
}
else
{
ReefAngel.RF.UseMemory=true;
}
}


//Start feedmode when the feeder will kick in
//if ( (now()%86400==39480) || (now()%86400==50280) || (now()%86400==61080) )
// {
// ReefAngel.FeedingModeStart();
// }


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

void DrawCustomMain()
{
int x,y;
char text[10];
// Parameters
#if defined DisplayLEDPWM && ! defined RemoveAllLights
ReefAngel.LCD.DrawMonitor( 15, 20, ReefAngel.Params,
ReefAngel.PWM.GetDaylightValue(), ReefAngel.PWM.GetActinicValue() );
#else // defined DisplayLEDPWM && ! defined RemoveAllLights
ReefAngel.LCD.DrawMonitor( 15, 20, ReefAngel.Params );
#endif // defined DisplayLEDPWM && ! defined RemoveAllLights
pingSerial();

// Water Level
ReefAngel.LCD.DrawText( COLOR_DARKGOLDENROD,DefaultBGColor,75,66, "WL:" );
ReefAngel.LCD.DrawText( COLOR_DARKGOLDENROD,DefaultBGColor,99,66, ReefAngel.WaterLevel.GetLevel() );
pingSerial();

// Main Relay Box
byte TempRelay = ReefAngel.Relay.RelayData;
TempRelay &= ReefAngel.Relay.RelayMaskOff;
TempRelay |= ReefAngel.Relay.RelayMaskOn;
ReefAngel.LCD.DrawOutletBox( 12, 92, TempRelay );
pingSerial();

// Date and Time
ReefAngel.LCD.DrawDate( 6, 122 );
pingSerial();
}

void DrawCustomGraph()
{
}
rimai
Posts: 12857
Joined: Fri Mar 18, 2011 6:47 pm

Re: Need help with controller

Post by rimai »

Are you using the latest libraries?
Roberto.
lucho
Posts: 80
Joined: Fri Mar 02, 2012 8:11 am

Re: Need help with controller

Post by lucho »

I thought I was. What is the best way to check or update them?
rimai
Posts: 12857
Joined: Fri Mar 18, 2011 6:47 pm

Re: Need help with controller

Post by rimai »

It should update by itself.
You can go to menu Tools->Reef Angel Libraries Version to see what's installed in your computer.
Hit the joystick and go to Version in the controller to see what's installed in the controller.
Roberto.
lucho
Posts: 80
Joined: Fri Mar 02, 2012 8:11 am

Re: Need help with controller

Post by lucho »

I have version 1.0.9 in the computer. I will check the controller tonight when I get home, but since I uploaded a code last month, I would think I have the same in the controller.
User avatar
lnevo
Posts: 5422
Joined: Fri Jul 20, 2012 9:42 am

Re: Need help with controller

Post by lnevo »

Your controller would not have a higher version than your computer :)
lucho
Posts: 80
Joined: Fri Mar 02, 2012 8:11 am

Re: Need help with controller

Post by lucho »

Just checked and I have 1.0.9 in the controller. Is this the latest? If not, could you point me to where to read on how to update? I tries in the arduino software but could not find it. Thanks!
lucho
Posts: 80
Joined: Fri Mar 02, 2012 8:11 am

Re: Need help with controller

Post by lucho »

Ok, upgraded to 1.1.0

Let's see what happens tomorrow.
lucho
Posts: 80
Joined: Fri Mar 02, 2012 8:11 am

Re: Need help with controller

Post by lucho »

Ok, so far so good. Checked this morning and seems to be working well for now
Post Reply