ATO alarm putting RA into overheat mode

Related to the development libraries, released by Curt Binder
Post Reply
rimai
Posts: 12881
Joined: Fri Mar 18, 2011 6:47 pm

Re: ATO alarm putting RA into overheat mode

Post by rimai »

Ok, let's try using the standard main screen.
If it still gives you problems, PM me to arrange replacement.
Roberto.
Sebyte

Re: ATO alarm putting RA into overheat mode

Post by Sebyte »

I have run RAgen and built a PDE with standard menu, but retaining my custom code. Lets see how that works!

If this proves to be the issue, does that mean that I will not be able in the future to have custom screens? My next project is to build a custom LED lighting system and then implement the RA control and I thought that I might need to have custom screens to free up memory. That project is at least a month away.

Thanks for your help on this and I will PM you with update.
rimai
Posts: 12881
Joined: Fri Mar 18, 2011 6:47 pm

Re: ATO alarm putting RA into overheat mode

Post by rimai »

Absolutelly not.
If this turns out to be the case, we know for sure that the bug is in the Custom Main part of the code.
What I'm trying to do here is to identify where the problem lies.
Once the bug is found, we can fix it. The problem is that we don't know where it is at this point. :(
Roberto.
Sebyte

Re: ATO alarm putting RA into overheat mode

Post by Sebyte »

I have sent you a couple of PMs, not sure if they have been sent as they are still showing in my out box.
rimai
Posts: 12881
Joined: Fri Mar 18, 2011 6:47 pm

Re: ATO alarm putting RA into overheat mode

Post by rimai »

I'd like you to load this code. It will display the max temp registered for each T1 and T2 probes.
I modified from the previous one you posted.

ReefAngel_Features.h file:

Code: Select all

/*
* Copyright 2010 Curt Binder
*
* Licensed under the Apache License, Version 2.0 (the "License");
* you may not use this file except in compliance with the License.
* You may obtain a copy of the License at
*
* http://www.apache.org/licenses/LICENSE-2.0
*
* Unless required by applicable law or agreed to in writing, software
* distributed under the License is distributed on an "AS IS" BASIS,
* WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied.
* See the License for the specific language governing permissions and
* limitations under the License.
*/

#ifndef __REEFANGEL_FEATURES_H__
#define __REEFANGEL_FEATURES_H__


#define DateTimeSetup
#define VersionMenu
#define wifi
#define CUSTOM_MAIN
#define WDT

#endif  // __REEFANGEL_FEATURES_H__
PDE file:

Code: Select all

// Autogenerated file by RAGen (v1.1.0.126), (11/28/2011 13:34)
// RA_112811_1334.pde
// gold_build.pde
//
// This version designed for v0.8.5 Beta 17 or later

/* The following features are enabled for this PDE File: 
#define DisplayImages
#define WavemakerSetup
#define DateTimeSetup
#define VersionMenu
#define ATOSetup
#define MetalHalideSetup
#define DirectTempSensor
#define wifi
#define SingleATOSetup
#define StandardLightSetup
#define WDT
#define CUSTOM_MAIN
#define ENABLE_ATO_LOGGING
*/


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

#include <avr/pgmspace.h>
// Labels for the web banner
prog_char id_label[] PROGMEM = "sebyte";
prog_char probe1_label[] PROGMEM = "Water";
prog_char probe2_label[] PROGMEM = "Room";
prog_char probe3_label[] PROGMEM = "Not%20Used";
prog_char relay1_label[] PROGMEM = "Skimmer";
prog_char relay2_label[] PROGMEM = "ATO";
prog_char relay3_label[] PROGMEM = "Heater";
prog_char relay4_label[] PROGMEM = "Chiller";
prog_char relay5_label[] PROGMEM = "Wave%20Maker";
prog_char relay6_label[] PROGMEM = "Pumps";
prog_char relay7_label[] PROGMEM = "Actinics";
prog_char relay8_label[] PROGMEM = "Daylight";
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};
   
int t1max=0;
int t2max=0;

void DrawCustomMain()
{
   // the graph is drawn/updated when we exit the main menu &
   // when the parameters are saved
   ReefAngel.LCD.DrawDate(6, 112);
   pingSerial();
#if defined DisplayLEDPWM && ! defined RemoveAllLights
   ReefAngel.LCD.DrawMonitor(15, 60, ReefAngel.Params,
      ReefAngel.PWM.GetDaylightValue(), ReefAngel.PWM.GetActinicValue());
#else // defined DisplayLEDPWM && ! defined RemoveAllLights
   ReefAngel.LCD.DrawMonitor(15, 60, ReefAngel.Params);
#endif // defined DisplayLEDPWM && ! defined RemoveAllLights
   pingSerial();
   byte TempRelay = ReefAngel.Relay.RelayData;
   TempRelay &= ReefAngel.Relay.RelayMaskOff;
   TempRelay |= ReefAngel.Relay.RelayMaskOn;
   ReefAngel.LCD.DrawOutletBox(12, 93, TempRelay);
   if (t1max<ReefAngel.Params.Temp1) t1max=ReefAngel.Params.Temp1;
   if (t2max<ReefAngel.Params.Temp2) t2max=ReefAngel.Params.Temp2;
  char text[10];
  ConvertNumToString(text, t1max, 10);
  strcat(text,"  ");
  ReefAngel.LCD.DrawText(T1TempColor, DefaultBGColor, 10, 10, "T1 Max:");
  ReefAngel.LCD.DrawText(T1TempColor, DefaultBGColor, 55, 10, text);
  ConvertNumToString(text, t2max, 10);
  strcat(text,"  ");
  ReefAngel.LCD.DrawText(T2TempColor, DefaultBGColor, 10, 20, "T2 Max:");
  ReefAngel.LCD.DrawText(T2TempColor, DefaultBGColor, 55, 20, text);

  pingSerial();

}

void DrawCustomGraph()
{
}


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 = B00110001;
    ReefAngel.WaterChangePorts = B00111111;
    ReefAngel.OverheatShutoffPorts = B11000001;
    ReefAngel.LightsOnPorts = B11000000;

    // Ports that are always on
    ReefAngel.Relay.On(Port1);
    ReefAngel.Relay.On(Port6);
    
     // ***************** commented out at request of Roberto 28/11/11  *******************
     // Change Overheat Temperature Probe from (default Temp2) to Temp1
// ReefAngel.OverheatTempProbe = &ReefAngel.Params.Temp1; 
  
}

void loop()
{
    // Specific functions
   // ReefAngel.SingleATOLow(Port2);  // commented out 28-11-11 - rimai saying not needed
    ReefAngel.StandardHeater(Port3);
    ReefAngel.StandardFan(Port4);
    ReefAngel.Wavemaker1(Port5);
    ReefAngel.StandardLights(Port7);
    ReefAngel.MHLights(Port8);
    
// ATO available 6 times per day - 00:00 to 01:00, 04:00 to 05:00, 08:00 to 09:00, 12:00 to 13:00, 16:00 to 17:00, 20:00 to 21:00,


  if (hour() % 4 == 0 && ReefAngel.LowATO.IsActive()) //Rev made 19/11/11
  {

    ReefAngel.Relay.On(Port2);
  }
  else
  { 
    ReefAngel.Relay.Off(Port2);
  }


  // Kalk Reactor available 6 times per day - 01:30 to 2:00, 05:30 to 06:00, 09:30 to 10:00, 
  // 13:30 to 14:00, 17:30 to 18:00, 21:30 to 2:00.

  if (hour() % 4 == 1 && minute()>30) 
  {
    pinMode(highATOPin,OUTPUT);
    digitalWrite(highATOPin,HIGH); // Turn on Solid State Relay
  }
  else
  {
    pinMode(highATOPin,OUTPUT);
    digitalWrite(highATOPin,LOW); // Turn off Solid State Relay
  } 


  // Wavemaker not available 9 pm to 10 am

  if ( (hour() >= 20) || (hour() <= 9) ) 
  {

    ReefAngel.Relay.Off(Port5);

   }

     // Web Banner stuff
    if(ReefAngel.Timer[4].IsTriggered())
    {
        ReefAngel.Timer[4].Start();
        ReefAngel.WebBanner();
    }

   ReefAngel.ShowInterface();
}
Roberto.
Post Reply