ReefAngel Client v2.2 masking issue

Community contributed apps
Post Reply
agentgreen
Posts: 97
Joined: Wed Jul 06, 2011 6:45 am

ReefAngel Client v2.2 masking issue

Post by agentgreen »

I installed the ReefAngel Client v2.2 and so far am really liking it. Nice job!

I am seeing a strange issue, and I'm not 100% sure its due to the client software, but it seems this issue cropped up after connecting the client.

Just to confirm, when there is a blue box surrounding a relay, that means it's masked by the client software, right? I'm talking about this:

Image

So it appears my MH2, Fans and NA are masked OFF, right?

Well, when I set them back to Auto (click OFF, choose Auto) the relays switch to ON, like they should be, but then immediately go back to masked off.

I checked the relay profile for this relay box, and it's only using the Auto profile, which has all relays set to Auto.

Anything I'm missing?

Thanks!
rimai
Posts: 12881
Joined: Fri Mar 18, 2011 6:47 pm

Re: ReefAngel Client v2.2 masking issue

Post by rimai »

Can you post your entire code?
It could be your overheat mask.
Roberto.
agentgreen
Posts: 97
Joined: Wed Jul 06, 2011 6:45 am

Re: ReefAngel Client v2.2 masking issue

Post by agentgreen »

// Autogenerated file by RAGen (v1.0.4.92), (09/09/2011 07:48)
// RA_090911_0748.pde
//
// This version designed for v0.8.5 Beta 12 or later

/* The following features are enabled for this PDE File:
#define DisplayImages
#define WavemakerSetup
#define DateTimeSetup
#define VersionMenu
#define MetalHalideSetup
#define DirectTempSensor
#define DisplayLEDPWM
#define StandardLightSetup
#define RelayExp
*/

/*
Box 0 Port 1 = MH1
Box 0 Port 2 = MH2
Box 0 Port 3 = Canopy Fans
Box 0 Port 4 = Powerhead 1
Box 0 Port 5 = Powerhead 2
Box 0 Port 6 = Heater 1
Box 0 Port 7 = EMPTY
Box 0 Port 8 = EMPTY

Box 1 Port 1 = Return Pump
Box 1 Port 2 = Skimmedr
Box 1 Port 3 = Refugium Light
Box 1 Port 4 = ATO
Box 1 Port 5 = EMPTY
Box 1 Port 6 = EMPTY
Box 1 Port 7 = EMPTY
Box 1 Port 8 = EMPTY
*/

#include <ReefAngel_Features.h>
#include <ReefAngel_Globals.h>
#include <ReefAngel_Wifi.h>
#include <Wire.h>
#include <OneWire.h>
#include <Time.h>
#include <DS1307RTC.h>
#include <ReefAngel_EEPROM.h>
#include <ReefAngel_NokiaLCD.h>
#include <ReefAngel_ATO.h>
#include <ReefAngel_Joystick.h>
#include <ReefAngel_LED.h>
#include <ReefAngel_TempSensor.h>
#include <ReefAngel_Relay.h>
#include <ReefAngel_PWM.h>
#include <ReefAngel_Timer.h>
#include <ReefAngel_Memory.h>
#include <ReefAngel.h>

// Labels for the web banner
#include <avr/pgmspace.h>
prog_char id_label[] PROGMEM = "agentgreen";
prog_char probe1_label[] PROGMEM = "Sump";
prog_char probe2_label[] PROGMEM = "Canopy";
prog_char probe3_label[] PROGMEM = "Not%20Used";
prog_char relay1_label[] PROGMEM = "MH1";
prog_char relay2_label[] PROGMEM = "MH2";
prog_char relay3_label[] PROGMEM = "FANS";
prog_char relay4_label[] PROGMEM = "PH1";
prog_char relay5_label[] PROGMEM = "PH2";
prog_char relay6_label[] PROGMEM = "H1";
prog_char relay7_label[] PROGMEM = "H2";
prog_char relay8_label[] PROGMEM = "NA";
prog_char relay11_label[] PROGMEM = "Return";
prog_char relay12_label[] PROGMEM = "Skimmer";
prog_char relay13_label[] PROGMEM = "RefugLight";
prog_char relay14_label[] PROGMEM = "ATO";
prog_char relay15_label[] PROGMEM = "NA";
prog_char relay16_label[] PROGMEM = "NA";
prog_char relay17_label[] PROGMEM = "NA";
prog_char relay18_label[] PROGMEM = "NA";
PROGMEM const char *webbanner_items[] = {
id_label, probe1_label, probe2_label, probe3_label, relay1_label, relay2_label,
relay3_label, relay4_label, relay5_label, relay6_label, relay7_label, relay8_label,
relay11_label, relay12_label, relay13_label, relay14_label, relay15_label, relay16_label,
relay17_label, relay18_label};

void WifiSendAlert(byte id, boolean IsAlert)
{
static byte alert_status;

if (IsAlert)
{
if ((alert_status & 1<<(id-1))==0)
{
alert_status|=1<<(id-1);
Serial.print("GET /status/alert.asp?e=4048587609@vtext.com&id=");
Serial.println(alert_status,DEC);
Serial.println("\n\n");
}
}
else
{
if (id==0)
{
alert_status=0;
delay(900);
}
else
{
alert_status&=~(1<<(id-1));
}
}
}

void setup()
{
ReefAngel.Init(); //Initialize controller
// Initialize and start the web banner timer
ReefAngel.LoadWebBanner(pgm_read_word(&(webbanner_items[0])), SIZE(webbanner_items));
ReefAngel.Timer[4].SetInterval(180); // set interval to 180 seconds
ReefAngel.Timer[4].Start();
ReefAngel.FeedingModePorts = B00011000;
ReefAngel.WaterChangePorts = B00011000;
ReefAngel.WaterChangePortsE[0] = B11000000;
ReefAngel.OverheatShutoffPorts = B11000110;
ReefAngel.LightsOnPorts = B11000000;
ReefAngel.LightsOnPortsE[0] = B00100000;
ReefAngel.OverheatTempProbe = &ReefAngel.Params.Temp1;


// Ports that are always on
// Return pump
ReefAngel.Relay.On(Box1_Port1);
}

void loop()
{
ReefAngel.ShowInterface();

// Specific functions
ReefAngel.MHLights(Port1);
ReefAngel.MHLights(Port2);
ReefAngel.Wavemaker1(Port4);
ReefAngel.Wavemaker2(Port5);
ReefAngel.StandardHeater(Port6);
ReefAngel.StandardHeater(Port7);
ReefAngel.StandardLights(Box1_Port3);
//ReefAngel.DelayedOn(Box1_Port2, 2);
ReefAngel.Relay.DelayedOn(Box1_Port2, 2);
// Turn on Port 3 when the temp of T2 gets above 85.0 degrees
if ( ReefAngel.Params.Temp2 >= 850 ) ReefAngel.Relay.On(Port3);
// Turn off Port 3 when the temp of T2 gets below 80.0 degrees
if ( ReefAngel.Params.Temp2 <= 800 ) ReefAngel.Relay.Off(Port3);
// Turn on moon lights based on moon phases between 10pm and 9am.
if ( hour() > 22 || hour() < 9)
{
ReefAngel.PWM.SetActinic(100);
ReefAngel.PWM.SetDaylight(100);
}
// Web Banner stuff
if(ReefAngel.Timer[4].IsTriggered())
{
ReefAngel.Timer[4].Start();
ReefAngel.WebBanner();
}

// Only turn on ATO for 20 minutes every hour.
if (minute()<=20)
{
ReefAngel.Relay.On(Box1_Port4);
} else {
ReefAngel.Relay.Off(Box1_Port4);
}
//This will send an alert if T1 is below 77 and reset if above 78
if (ReefAngel.Params.Temp1<770 && ReefAngel.Params.Temp1>0) WifiSendAlert(3,true);
if (ReefAngel.Params.Temp1>780 && ReefAngel.Params.Temp1<1850) WifiSendAlert(3,false);
//This will send an alert if T1 is above 83 and reset if below 80
if (ReefAngel.Params.Temp1>830 && ReefAngel.Params.Temp1>1850) WifiSendAlert(4,true);
if (ReefAngel.Params.Temp1<800 && ReefAngel.Params.Temp1>0) WifiSendAlert(4,false);
}
rimai
Posts: 12881
Joined: Fri Mar 18, 2011 6:47 pm

Re: ReefAngel Client v2.2 masking issue

Post by rimai »

According to this line:

Code: Select all

ReefAngel.OverheatShutoffPorts = B11000110;
You are masking off Port 2,3,7,8.
So, in the picture above, Port 7 should've been masked off.
Maybe you picked the wrong ports when creating the code.
I think what you really meant was:

Code: Select all

ReefAngel.OverheatShutoffPorts = B01100011;
Which is port 1,2,6,7
It's the tricky of writing in binary. The left most is the most significant, which means the left most is always the biggest.
I think what you have to check too is the overheat temperature setting in the internal memory. That's what is triggering the overheat.
Roberto.
agentgreen
Posts: 97
Joined: Wed Jul 06, 2011 6:45 am

Re: ReefAngel Client v2.2 masking issue

Post by agentgreen »

Ahhh. You actually answered another question I was going to have too!

I wasn't sure which order to use when setting those things.

Thanks, I'll make the changes and see if it resolves.
rimai
Posts: 12881
Joined: Fri Mar 18, 2011 6:47 pm

Re: ReefAngel Client v2.2 masking issue

Post by rimai »

Oh, by the way, on your code you mention moonphase in the comments, but your code sets the channels to 100%.
Was it what you intended or you wanted to have it go according to the moon cycles?
Roberto.
agentgreen
Posts: 97
Joined: Wed Jul 06, 2011 6:45 am

Re: ReefAngel Client v2.2 masking issue

Post by agentgreen »

I couldn't get the moonphase stuff to work, I don't know why. I don't even think the time range to set the PWMs to 100% is working right. For instance, my moon lights are on right now, and they shouldn't be!

I feel like when I first set this up, I pushed some PWM settings to memory, which are overriding the moonphase settings, or my time range settings.
agentgreen
Posts: 97
Joined: Wed Jul 06, 2011 6:45 am

Re: ReefAngel Client v2.2 masking issue

Post by agentgreen »

Ok, I just pushed new code after modifying based on the above.

The moonlights are no longer on, so it may have been a fluke somewhere.
agentgreen
Posts: 97
Joined: Wed Jul 06, 2011 6:45 am

Re: ReefAngel Client v2.2 masking issue

Post by agentgreen »

Ok, so, now I see why the MH was off, something is triggering the OverHeatShutOff, but I can't figure out what. My heaters and MH's are masked off right now because the controller thinks I've over heated.

In Client Suite, if I refresh the memory settings, Overheat is set to 150. In my PDE, I have the OverHeat probe set to Temp1, which is my water temp probe. My water temp is below 80 degrees.

Is memory overwriting the PDE in this regard?
rimai
Posts: 12881
Joined: Fri Mar 18, 2011 6:47 pm

Re: ReefAngel Client v2.2 masking issue

Post by rimai »

Use this:

Code: Select all

  if (hour()>=21 || hour()<=8) // Turn Moonlights on/off
  {
    ReefAngel.PWM.SetActinic(MoonPhase());
    ReefAngel.PWM.SetDaylight(MoonPhase());
  }
  else
  {
    ReefAngel.PWM.SetActinic(0);
    ReefAngel.PWM.SetDaylight(0);
  }
The reason they were on was probably because you forgot to turn them off when not within the time schedule you had.
Roberto.
rimai
Posts: 12881
Joined: Fri Mar 18, 2011 6:47 pm

Re: ReefAngel Client v2.2 masking issue

Post by rimai »

Try changing the temperature to something else. I was testing your code and set it to 83 through the Client. Then with my hands I held the probe to increase the temperature and the ports went off, indicating that it was working as intended.
I only had that one probe in my tests, though... Not that it should influence the results.
Roberto.
agentgreen
Posts: 97
Joined: Wed Jul 06, 2011 6:45 am

Re: ReefAngel Client v2.2 masking issue

Post by agentgreen »

rimai wrote:Try changing the temperature to something else. I was testing your code and set it to 83 through the Client. Then with my hands I held the probe to increase the temperature and the ports went off, indicating that it was working as intended.
I only had that one probe in my tests, though... Not that it should influence the results.
I just set the temp to 95 from the client and cleared the over heat warning. Lights came on for a couple seconds, and now are still masked off. Strange...
agentgreen
Posts: 97
Joined: Wed Jul 06, 2011 6:45 am

Re: ReefAngel Client v2.2 masking issue

Post by agentgreen »

rimai wrote:Use this:

Code: Select all

  if (hour()>=21 || hour()<=8) // Turn Moonlights on/off
  {
    ReefAngel.PWM.SetActinic(MoonPhase());
    ReefAngel.PWM.SetDaylight(MoonPhase());
  }
  else
  {
    ReefAngel.PWM.SetActinic(0);
    ReefAngel.PWM.SetDaylight(0);
  }
The reason they were on was probably because you forgot to turn them off when not within the time schedule you had.

I actually had this code setup previously and I think it was working. However, at the same time the controller was locking up on me every couple of hours. I removed the above loop and it resolved the lock ups. It could have been something else, but I attributed it to the loop.

Let's see what happens this time.
rimai
Posts: 12881
Joined: Fri Mar 18, 2011 6:47 pm

Re: ReefAngel Client v2.2 masking issue

Post by rimai »

What happens if you use joystick and navigate to clear overheat?
Roberto.
agentgreen
Posts: 97
Joined: Wed Jul 06, 2011 6:45 am

Re: ReefAngel Client v2.2 masking issue

Post by agentgreen »

rimai wrote:What happens if you use joystick and navigate to clear overheat?
The lights and heaters go unmasked, the lights come on for about 10 seconds, then go off again, and in the client I see that they are masked off.
rimai
Posts: 12881
Joined: Fri Mar 18, 2011 6:47 pm

Re: ReefAngel Client v2.2 masking issue

Post by rimai »

Beats me, man...
I got the same code and this behavior doesn't happen.
Can you use the update utility to download the latest code??
http://www.reefangel.com/update/
I'm running on .18
Roberto.
dmolton
Posts: 182
Joined: Tue Mar 22, 2011 11:08 am

Re: ReefAngel Client v2.2 masking issue

Post by dmolton »

What happens if you remove the overheat line all together and re-upload?

Code: Select all

ReefAngel.OverheatShutoffPorts = B11000110;
agentgreen
Posts: 97
Joined: Wed Jul 06, 2011 6:45 am

Re: ReefAngel Client v2.2 masking issue

Post by agentgreen »

rimai wrote:Beats me, man...
I got the same code and this behavior doesn't happen.
Can you use the update utility to download the latest code??
http://www.reefangel.com/update/
I'm running on .18
I'm running .18 as well.

dmolton wrote:What happens if you remove the overheat line all together and re-upload?

Code: Select all

ReefAngel.OverheatShutoffPorts = B11000110;

I'm going to comment it out for now, with the alerting setup now, I can manually turn off stuff if I notice it gets hot.

For now I just want to stabilize the controller, so I'll figure this one out later.
Post Reply