reefangel froze

Related to the development libraries, released by Curt Binder
Post Reply
ahmedess
Posts: 173
Joined: Sun May 22, 2011 2:29 pm

reefangel froze

Post by ahmedess »

last night my reefangel froze I dont know why. I've been using it for more than 2 months with the same code and this is the first time it froze. I had to unplug it from the power and plug it back on to make it run normally again.

I really don't want to risk this happening ever again cause my tank's temp rose to 84.2 deg and my lights were on all night. Thank god I didn't lose any live stock this time. I would like to know why this has happened so that i can avoid it happening again.

Also another weird thing that happened a couple of days before is that I found the status led on when it should be off while the controller was running normally. I had to turn the controller off then back on to make the status led turn off again. it didnt happen again since then but i think it might help solve the problem of why the controller froze.

I m using Dev Library version 8.5.14. I m using the pwmslope function and I m also using the delayedon function.

here is my code:

Code: Select all

// Current file
// Autogenerated file by RAGen (v1.0.4.92), (05/30/2011 23:56)
// RA_053011_2356.pde
//
// This version designed for v0.8.5 Beta 12 or later

/* The following features are enabled for this PDE File:
#define DosingPumpIntervalSetup
#define WavemakerSetup
#define DirectTempSensor
#define DisplayLEDPWM
#define wifi
*/


#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 = "ahmedess";
prog_char probe1_label[] PROGMEM = "Water";
prog_char probe2_label[] PROGMEM = "Room";
prog_char probe3_label[] PROGMEM = "LEDTemp";
prog_char relay1_label[] PROGMEM = "Sump";
prog_char relay2_label[] PROGMEM = "Fan/Chiller";
prog_char relay3_label[] PROGMEM = "Heater";
prog_char relay4_label[] PROGMEM = "Dosers";
prog_char relay5_label[] PROGMEM = "Wavemaker";
prog_char relay6_label[] PROGMEM = "Universal";
prog_char relay7_label[] PROGMEM = "Universal";
prog_char relay8_label[] PROGMEM = "TunzeATO";
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};


void setup()
{
    ReefAngel.Init();  //Initialize controller
    ReefAngel.SetTemperatureUnit(1);  // set to Celsius Temperature
    // 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 = B10000001;
    ReefAngel.WaterChangePorts = B10000001;
    ReefAngel.OverheatShutoffPorts = B00000000;
    ReefAngel.LightsOnPorts = B00000000;

    // Ports that are always on
    ReefAngel.Relay.On(Port1);
    ReefAngel.Relay.On(Port6);
    ReefAngel.Relay.On(Port7);
    //ReefAngel.Relay.On(Port8);    // removed to use the delayed on function
}

void loop()
{
    ReefAngel.ShowInterface();

    // Specific functions
    ReefAngel.StandardFan(Port2);
    ReefAngel.StandardHeater(Port3);
    ReefAngel.DosingPumpRepeat1(Port4);
    ReefAngel.Wavemaker1(Port5);
    
    ReefAngel.PWM.SetActinic(PWMSlope(15,0,0,30,0,95,90,ReefAngel.PWM.GetActinicValue()));
    ReefAngel.PWM.SetDaylight(PWMSlope(15,0,0,40,0,50,90,ReefAngel.PWM.GetDaylightValue()));
   
   
    if ( (NumMins(hour(), minute()) > NumMins(0,30)) && (NumMins(hour(), minute()) < NumMins(15, 0)) )
    {
      ReefAngel.PWM.SetActinic(0);
      //ReefAngel.PWM.SetDaylight(0);
    }
    
    if ( (NumMins(hour(), minute()) > NumMins(0,40)) && (NumMins(hour(), minute()) < NumMins(15, 0)) )
    {
      //ReefAngel.PWM.SetActinic(0);
      ReefAngel.PWM.SetDaylight(0);
    }
    
    // Web Banner stuff
    if(ReefAngel.Timer[4].IsTriggered())
    {
        ReefAngel.Timer[4].Start();
        ReefAngel.WebBanner();
    }
   
    //delayed on for port 8 ATO
    ReefAngel.DelayedOn(Port8,2);
   
}
rimai
Posts: 12857
Joined: Fri Mar 18, 2011 6:47 pm

Re: reefangel froze

Post by rimai »

To solve this problem, you need to turn on a feature called WDT, but it is only available on head units with optiboot bootloader.
http://forum.reefangel.com/viewtopic.php?f=2&t=113
You can DIY or PM me if you would like to send it in for upgrade.
Roberto.
ahmedess
Posts: 173
Joined: Sun May 22, 2011 2:29 pm

Re: reefangel froze

Post by ahmedess »

Roberto,

Thanks for the quick reply. Since I live in Egypt, so sending you the unit for upgrade will be very expensive. So i guess i ll have to DIY if I couldnt find a suitable programmer for sale here in Egypt. Theres a website in egypt that sells electronics and stuff they have an avr programmer could you please check it out and let me know if it would work or not. here's the link:
http://ram-e-shop.com/oscmax/catalog/pr ... ts_id=1464
rimai
Posts: 12857
Joined: Fri Mar 18, 2011 6:47 pm

Re: reefangel froze

Post by rimai »

Although it does not say the 328P as supported device, I'm pretty sure it would work.
On Arduino IDE, it shows as being one choice of programmer.
Roberto.
Post Reply