Reef Angel Malfunctioning

Do you have a question on how to do something.
Ask in here.
ecam
Posts: 229
Joined: Thu Nov 15, 2012 11:27 am

Reef Angel Malfunctioning

Post by ecam »

Good morning all...

Here is the issue I'm having. On Sunday, i finally connected all my cool new gadgets from the Roberto. I added:

- relay expansion (box1)
- lunar hub
- expansion hubs

in addition to that I have been using the Wifi and RF module.

Since the connection,

After a few hours, the reef angel will be flashing a red status on the box and then telling me false information on the wifi and portal (stuff is on when its not). The funny thing is the box is still running as normal (Return and Skimmer etc are still on.. even thouh the box says it off).

Could my new ATI fixture be too much? This only started happening when I added the relay expansion.

Please help. FYI: when i reset the head unit (pulling the plug) it works fine for a few hrs and then does this samething again
#include <RA_ATO.h>
#include <RF.h>
#include <ReefAngel_Features.h>
#include <Globals.h>
#include <RA_Wifi.h>
#include <Wire.h>
#include <OneWire.h>
#include <Time.h>
#include <DS1307RTC.h>fa
#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>fa
#include <IO.h>
#include <ORP.h>
#include <AI.h>
#include <PH.h>
#include <WaterLevel.h>
#include <ReefAngel.h>

////// Place global variable code below here


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


void setup()
{
// This must be the first line
ReefAngel.Init(); //Initialize controller
// Ports toggled in Feeding Mode
ReefAngel.WaterChangePorts = Port1Bit | Port8Bit; // Turn off Ports 5 and 6 when Feeding Mode is activated
ReefAngel.FeedingModePorts = Port1Bit | Port6Bit | Port8Bit; // Turn off Ports 1, 6, 7 and 8 when Water Change Mode is activated
ReefAngel.LightsOnPorts = Port2Bit | Port3Bit | Port4Bit| Port5Bit;
ReefAngel.OverheatShutoffPorts = Port2Bit |Port3Bit | Port4Bit | Port5Bit | Port7Bit; // Turn off Ports 3,
ReefAngel.TempProbe = T3_PROBE;
ReefAngel.OverheatProbe = T3_PROBE;
// Set the Overheat temperature setting
InternalMemory.OverheatTemp_write( 825 );

// Setup ATO Port for AI communication
ReefAngel.AI.SetPort( lowATOPin );


// Ports that are always on
ReefAngel.Relay.On( Port1 );
ReefAngel.Relay.On( Box1_Port2 ); // Razor Led
ReefAngel.Relay.On( Box1_Port4 ); // Sump Equipment - UV, Pump
ReefAngel.Relay.On( Box1_Port5 ); // MP40s
ReefAngel.Relay.On( Box1_Port6 ); // JBJ
////// Place additional initialization code below here


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

void loop()
{
// Port1 Return pump... on all the time!!!
ReefAngel.Relay.Set( Port2, !ReefAngel.Relay.Status( Port4 ) ); //Refuge
ReefAngel.Relay.Off( Port3); // Start with the relay off
if (hour()>=5 && hour()<10) ReefAngel.Relay.On(Port3); // Moonlight Between 5-10am turn the relay on
if (hour()>=20 && hour()<=23) ReefAngel.Relay.On(Port3); // From 8pm-Midnight turn the relay on
ReefAngel.StandardLights( Port4,10,0,20,0 ); //ATI Actinic
ReefAngel.StandardLights( Port5,11,0,19,0 ); //ATI Daylight
ReefAngel.StandardLights( Port6,10,0,20,0 ); //ATI Fan
ReefAngel.StandardHeater( Port7,778,790 ); //Heater
ReefAngel.Relay.DelayedOn( Port8,2 ); //Skimmer
ReefAngel.Relay.Off( Box1_Port7); // Lunar Hub Port #9
// Box1_Port2 Razor_LED (Sump)... on all the time!!! Port #10
ReefAngel.Relay.Off( Box1_Port3); //not used Port #11
// Box1_Port4 Ecotech MP_40 Pumps on all the time!!! Port #12
// Box1_Port5 Razor_LED (Sump)... on all the time!!! Port #13
// Box1_Port6 JBJ ATO ... on all the time!!! Port #14
ReefAngel.Relay.Off( Box1_Port7); // ALK Doser ... Port #15
ReefAngel.Relay.Off( Box1_Port8); // Calc Doser ... Port #16




// ReefAngel.AI.SetChannel( White, PWMParabola(11,0,17,0,0,75,0) );
// ReefAngel.AI.SetChannel( Blue, PWMParabola(9,0,20,0,15,100,0) );
// ReefAngel.AI.SetChannel( RoyalBlue, PWMParabola(9,0,20,0,15,100,(MoonPhase()/5)<3 ? 3:MoonPhase()/5) );
ReefAngel.RF.UseMemory = false;
ReefAngel.RF.SetMode( ReefCrest,85,10 );
// ReefAngel.RF.SetChannel( Radion_White, PWMParabola(9,0,20,0,0,60,0) );
// ReefAngel.RF.SetChannel( Radion_RoyalBlue, MoonPhase() );
// ReefAngel.RF.SetChannel( Radion_Red, PWMParabola(9,0,20,0,15,65,15) );
// ReefAngel.RF.SetChannel( Radion_Green, PWMParabola(9,0,20,0,15,50,15) );
// ReefAngel.RF.SetChannel( Radion_Blue, MoonPhase() );
// ReefAngel.RF.SetChannel( Radion_Intensity, PWMParabola(9,0,20,0,15,94,15) );
// if ( second()==0 ) ReefAngel.RF.RadionWrite();







////// Place your custom code below here


ReefAngel.RF.UseMemory = false;
if (hour()>=6 && hour()<11)
ReefAngel.RF.SetMode(ReefCrest,85,10);
else if (hour()>=11 && hour()<13)
ReefAngel.RF.SetMode(ReefCrest,85,10);
else if (hour()>=13 && hour()<16)
ReefAngel.RF.SetMode(Smart_NTM,85,15);
else if (hour()>=16 && hour()<19)
ReefAngel.RF.SetMode(ReefCrest,65,10);
else
ReefAngel.RF.SetMode(Lagoon,40,10);



// Hardcode PH calibrations
//ReefAngel.PHMin=544; // PH7.0
//ReefAngel.PHMax=830; // PH10.0

////// Place your custom code above here

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

void DrawCustomMain()
{
int x,y;
char text[10];
// Aqua Illumination
x = 10;
y = 20;
ReefAngel.LCD.DrawText( COLOR_DODGERBLUE,DefaultBGColor,x,y,"WH:" );
ReefAngel.LCD.DrawText( COLOR_DODGERBLUE,DefaultBGColor,x+38,y,"BL:" );
ReefAngel.LCD.DrawText( COLOR_DODGERBLUE,DefaultBGColor,x+76,y,"RB:" );
for ( int a=0;a<3;a++ )
{
ReefAngel.LCD.DrawText( COLOR_DODGERBLUE,DefaultBGColor,x+18,y,ReefAngel.AI.GetChannel(a) );
x += 38;
}
pingSerial();

// Parameters
#if defined DisplayLEDPWM && ! defined RemoveAllLights
ReefAngel.LCD.DrawMonitor( 15, 48, ReefAngel.Params,
ReefAngel.PWM.GetDaylightValue(), ReefAngel.PWM.GetActinicValue() );
#else // defined DisplayLEDPWM && ! defined RemoveAllLights
ReefAngel.LCD.DrawMonitor( 15, 48, ReefAngel.Params );
#endif // defined DisplayLEDPWM && ! defined RemoveAllLights
pingSerial();

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

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

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

Re: Reef Angel Malfunctioning

Post by rimai »

I'm starting to think it is the RF expansion module firmware and the twi.c change.
You are the 2nd with this problem.
I'm thinking that the twi.c change I have made a while ago is not doing its job and making things even worse.
Can we try reverting back to the original file?
Attached is the original twi.c file.
Please download and overwrite the existing one you have in your computer.
It is located at C:\Program Files (x86)\Reef Angel Controller\libraries\Wire\utility
Then upload your code to RA again to apply the change.
Attachments
twi.c
(15.98 KiB) Downloaded 403 times
Roberto.
ecam
Posts: 229
Joined: Thu Nov 15, 2012 11:27 am

Re: Reef Angel Malfunctioning

Post by ecam »

Hey roberto. Just uploaded the code with the new TWI file. Will let u know what happens tomorrow morning
ecam
Posts: 229
Joined: Thu Nov 15, 2012 11:27 am

Re: Reef Angel Malfunctioning

Post by ecam »

Roberto... So far soo good. Everything appears to be functioning okay
ecam
Posts: 229
Joined: Thu Nov 15, 2012 11:27 am

Re: Reef Angel Malfunctioning

Post by ecam »

Roberto... It happened again. What should i do
rimai
Posts: 12881
Joined: Fri Mar 18, 2011 6:47 pm

Re: Reef Angel Malfunctioning

Post by rimai »

Let's try updating the firmware of the RF module.
Open the case
Remove the Ecotech RF module chip from the RF module
Use the same USB-TTL cable you program RA to program the new firmware
Plug the cable to the RF module with the black wire towards the LED.
Download the attached file and unzip it.
Modify the file update.bat with the same COM port used to upload to RA.
Double click the update.bat file to execute it.
It will show a command prompt window with a progress bar and you will see the RF LED blinking just like when you upload to RA.
At the end, the RF module will start blinking 3 times every second.
If the blink every second doesn't happen, something didn't go right
Attachments
RF_Update_WDT_modified.zip
(425.21 KiB) Downloaded 394 times
Roberto.
ecam
Posts: 229
Joined: Thu Nov 15, 2012 11:27 am

Re: Reef Angel Malfunctioning

Post by ecam »

Roberto,

Can you tell me where in the Hex code do i find and change the COM? I am currently using COM1, if that helps
rimai
Posts: 12881
Joined: Fri Mar 18, 2011 6:47 pm

Re: Reef Angel Malfunctioning

Post by rimai »

Modify the file update.bat with the same COM port used to upload to RA.
Not the hex file.... It is in the bat file
Roberto.
ecam
Posts: 229
Joined: Thu Nov 15, 2012 11:27 am

Re: Reef Angel Malfunctioning

Post by ecam »

How do i do that?

Not sure how to modify the executable
User avatar
lnevo
Posts: 5430
Joined: Fri Jul 20, 2012 9:42 am

Re: Reef Angel Malfunctioning

Post by lnevo »

A .bat file is just a text file. You can use notepad/wordpad or any editor.
ecam
Posts: 229
Joined: Thu Nov 15, 2012 11:27 am

Re: Reef Angel Malfunctioning

Post by ecam »

Image


Nothing is happening. Here is the connection and my com is @ 3
ecam
Posts: 229
Joined: Thu Nov 15, 2012 11:27 am

Re: Reef Angel Malfunctioning

Post by ecam »

Image. Better pic
rimai
Posts: 12881
Joined: Fri Mar 18, 2011 6:47 pm

Re: Reef Angel Malfunctioning

Post by rimai »

Remove the Ecotech RF module chip from the RF module
Roberto.
ecam
Posts: 229
Joined: Thu Nov 15, 2012 11:27 am

Re: Reef Angel Malfunctioning

Post by ecam »

Made the change to COM1.. getting the error:

libusb0.dll is missing...
rimai
Posts: 12881
Joined: Fri Mar 18, 2011 6:47 pm

Re: Reef Angel Malfunctioning

Post by rimai »

Sorry... Copy the one you have in C:\Windows\System32 into the folder where your update files are.
Roberto.
ecam
Posts: 229
Joined: Thu Nov 15, 2012 11:27 am

Re: Reef Angel Malfunctioning

Post by ecam »

Just did the firmware and out back online. Will let u know.
ecam
Posts: 229
Joined: Thu Nov 15, 2012 11:27 am

Re: Reef Angel Malfunctioning

Post by ecam »

Just happened again Roberto.
rimai
Posts: 12881
Joined: Fri Mar 18, 2011 6:47 pm

Re: Reef Angel Malfunctioning

Post by rimai »

Maybe it is not the RF then.
Can you try running without the RF?
Roberto.
ecam
Posts: 229
Joined: Thu Nov 15, 2012 11:27 am

Re: Reef Angel Malfunctioning

Post by ecam »

It returns to normal the minute i take off the RF. If it doesn get fixed by tomorrow, Im going to have to take it offline. My light stayed on for over 18 hrs on friday. B\c of this issue
ecam
Posts: 229
Joined: Thu Nov 15, 2012 11:27 am

Re: Reef Angel Malfunctioning

Post by ecam »

Roberto, what can we do about the RF switch? Is it fixable?
rimai
Posts: 12881
Joined: Fri Mar 18, 2011 6:47 pm

Re: Reef Angel Malfunctioning

Post by rimai »

I'm going to lower the refresh rate in the libraries to see if we can get better results.
Roberto.
ecam
Posts: 229
Joined: Thu Nov 15, 2012 11:27 am

Re: Reef Angel Malfunctioning

Post by ecam »

Okay FYI.

Im not sure if this is relevant. But its never happened before. After removing the RF switch I went out. I came back home around 3:15pm to see my fish tank in the dark (the lights don't go out till 8:15). The head unit was saying the time was 8:30pm. I promptly pulled the plug and its been working fine since.


As for the library update please let me know when i can but the RF switch back online.
ecam
Posts: 229
Joined: Thu Nov 15, 2012 11:27 am

Re: Reef Angel Malfunctioning

Post by ecam »

Roberto, any updates?
rimai
Posts: 12881
Joined: Fri Mar 18, 2011 6:47 pm

Re: Reef Angel Malfunctioning

Post by rimai »

It is going to be on the next release.
There is no target date for next release yet though.
Roberto.
ecam
Posts: 229
Joined: Thu Nov 15, 2012 11:27 am

Re: Reef Angel Malfunctioning

Post by ecam »

So is there anything I can do for my RF module. or is it just useless, till the new update (say it aint so Roberto). I really like my mode switching.

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

Re: Reef Angel Malfunctioning

Post by rimai »

Try to find out where you are picking up the noise that is causing the issue.
I also checked the libs code and found out that if you use UseMemory=false, which I think you are, you can change the refresh yourself.
Can you post your code?
Roberto.
ecam
Posts: 229
Joined: Thu Nov 15, 2012 11:27 am

Re: Reef Angel Malfunctioning

Post by ecam »

here you go roberto. Also what noise are you referring to for the RF switch. The only change to my setup has been that I now run 4 MP40s as opposed to 2.

Code: Select all

#include <RA_ATO.h>
#include <RF.h>
#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>fa
#include <IO.h>
#include <ORP.h>
#include <AI.h>
#include <PH.h>
#include <WaterLevel.h>
#include <ReefAngel.h>

////// Place global variable code below here


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


void setup()
{
    // This must be the first line
    ReefAngel.Init();  //Initialize controller
    // Ports toggled in Feeding Mode
ReefAngel.WaterChangePorts = Port1Bit | Port8Bit; // Turn off Ports 5 and 6 when Feeding Mode is activated
  ReefAngel.FeedingModePorts = Port1Bit | Port6Bit | Port8Bit; // Turn off Ports 1, 6, 7 and 8 when Water Change Mode is activated
  ReefAngel.LightsOnPorts = Port2Bit | Port3Bit | Port4Bit| Port5Bit;
  ReefAngel.OverheatShutoffPorts = Port2Bit |Port3Bit | Port4Bit | Port5Bit | Port7Bit; // Turn off Ports 3,
    ReefAngel.TempProbe = T3_PROBE;
    ReefAngel.OverheatProbe = T3_PROBE;
    // Set the Overheat temperature setting
    InternalMemory.OverheatTemp_write( 825 );

    // Setup ATO Port for AI communication
    ReefAngel.AI.SetPort( lowATOPin );


    // Ports that are always on
    ReefAngel.Relay.On( Port1 );


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

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

void loop()
{   //Port1 Return pump...  on all the time!!!
    ReefAngel.Relay.Set( Port2, !ReefAngel.Relay.Status( Port4 ) ); //Refuge
ReefAngel.Relay.Off( Port3); // Start with the relay off
if (hour()>=5 && hour()<10) ReefAngel.Relay.On(Port3); // Moonlight Between 5-10am turn the relay on
if (hour()>=20 && hour()<=23) ReefAngel.Relay.On(Port3); // From 8pm-Midnight turn the relay on

   ReefAngel.StandardLights( Port4,10,0,20,0 ); //ATI Actinic
    ReefAngel.StandardLights( Port5,11,0,19,0 );  //ATI Daylight
    ReefAngel.StandardLights( Port6,10,0,20,0 );  //ATI Fan
    ReefAngel.StandardHeater( Port7,778,790 ); //Heater
    ReefAngel.Relay.DelayedOn( Port8,2 ); //Skimmer
//    ReefAngel.AI.SetChannel( White, PWMParabola(11,0,17,0,0,75,0) );
//    ReefAngel.AI.SetChannel( Blue, PWMParabola(9,0,20,0,15,100,0) );
//    ReefAngel.AI.SetChannel( RoyalBlue, PWMParabola(9,0,20,0,15,100,(MoonPhase()/5)<3 ? 3:MoonPhase()/5) );
    ReefAngel.RF.UseMemory = false;
    ReefAngel.RF.SetMode( ReefCrest,85,10 );
  //  ReefAngel.RF.SetChannel( Radion_White, PWMParabola(9,0,20,0,0,60,0) );
  //  ReefAngel.RF.SetChannel( Radion_RoyalBlue, MoonPhase() );
  //  ReefAngel.RF.SetChannel( Radion_Red, PWMParabola(9,0,20,0,15,65,15) );
  //  ReefAngel.RF.SetChannel( Radion_Green, PWMParabola(9,0,20,0,15,50,15) );
  //  ReefAngel.RF.SetChannel( Radion_Blue, MoonPhase() );
 //   ReefAngel.RF.SetChannel( Radion_Intensity, PWMParabola(9,0,20,0,15,94,15) );
  //  if ( second()==0 ) ReefAngel.RF.RadionWrite();


    ////// Place your custom code below here
    
    
ReefAngel.RF.UseMemory = false;
if (hour()>=6 && hour()<11)
  ReefAngel.RF.SetMode(ReefCrest,85,10);
else if (hour()>=11 && hour()<13)
  ReefAngel.RF.SetMode(ReefCrest,85,10);
else if (hour()>=13 && hour()<16)
  ReefAngel.RF.SetMode(Smart_NTM,85,15);
else if (hour()>=16 && hour()<19)
  ReefAngel.RF.SetMode(ReefCrest,65,10);
else
  ReefAngel.RF.SetMode(Lagoon,40,10);
         
     
        
    // Hardcode PH calibrations
     //ReefAngel.PHMin=544; // PH7.0
     //ReefAngel.PHMax=830; // PH10.0

    ////// Place your custom code above here

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

void DrawCustomMain()
{
    int x,y;
    char text[10];
    // Aqua Illumination
    x = 10;
    y = 20;
    ReefAngel.LCD.DrawText( COLOR_DODGERBLUE,DefaultBGColor,x,y,"WH:" );
    ReefAngel.LCD.DrawText( COLOR_DODGERBLUE,DefaultBGColor,x+38,y,"BL:" );
    ReefAngel.LCD.DrawText( COLOR_DODGERBLUE,DefaultBGColor,x+76,y,"RB:" );
    for ( int a=0;a<3;a++ )
    {
      ReefAngel.LCD.DrawText( COLOR_DODGERBLUE,DefaultBGColor,x+18,y,ReefAngel.AI.GetChannel(a) );
      x += 38;
    }
    pingSerial();

    // Parameters
#if defined DisplayLEDPWM && ! defined RemoveAllLights
    ReefAngel.LCD.DrawMonitor( 15, 48, ReefAngel.Params,
    ReefAngel.PWM.GetDaylightValue(), ReefAngel.PWM.GetActinicValue() );
#else // defined DisplayLEDPWM && ! defined RemoveAllLights
    ReefAngel.LCD.DrawMonitor( 15, 48, ReefAngel.Params );
#endif // defined DisplayLEDPWM && ! defined RemoveAllLights
    pingSerial();

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

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

void DrawCustomGraph()
{
}


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

Re: Reef Angel Malfunctioning

Post by rimai »

To use the new code, you will need to return the RF module to the original firmware.
Attachments
update.zip
(423.63 KiB) Downloaded 356 times
Roberto.
rimai
Posts: 12881
Joined: Fri Mar 18, 2011 6:47 pm

Re: Reef Angel Malfunctioning

Post by rimai »

Try this code:

Code: Select all

#include <RA_ATO.h>
#include <RF.h>
#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>fa
#include <IO.h>
#include <ORP.h>
#include <AI.h>
#include <PH.h>
#include <WaterLevel.h>
#include <ReefAngel.h>

////// Place global variable code below here

byte myRFMode=0;
byte myRFDuration=0;
byte myRFSpeed=0;

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


void setup()
{
  // This must be the first line
  ReefAngel.Init();  //Initialize controller
  // Ports toggled in Feeding Mode
  ReefAngel.WaterChangePorts = Port1Bit | Port8Bit; // Turn off Ports 5 and 6 when Feeding Mode is activated
  ReefAngel.FeedingModePorts = Port1Bit | Port6Bit | Port8Bit; // Turn off Ports 1, 6, 7 and 8 when Water Change Mode is activated
  ReefAngel.LightsOnPorts = Port2Bit | Port3Bit | Port4Bit| Port5Bit;
  ReefAngel.OverheatShutoffPorts = Port2Bit |Port3Bit | Port4Bit | Port5Bit | Port7Bit; // Turn off Ports 3,
  ReefAngel.TempProbe = T3_PROBE;
  ReefAngel.OverheatProbe = T3_PROBE;
  // Set the Overheat temperature setting
  InternalMemory.OverheatTemp_write( 825 );

  // Setup ATO Port for AI communication
  ReefAngel.AI.SetPort( lowATOPin );


  // Ports that are always on
  ReefAngel.Relay.On( Port1 );


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


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

void loop()
{   //Port1 Return pump...  on all the time!!!
  ReefAngel.Relay.Set( Port2, !ReefAngel.Relay.Status( Port4 ) ); //Refuge
  ReefAngel.Relay.Off( Port3); // Start with the relay off
  if (hour()>=5 && hour()<10) ReefAngel.Relay.On(Port3); // Moonlight Between 5-10am turn the relay on
  if (hour()>=20 && hour()<=23) ReefAngel.Relay.On(Port3); // From 8pm-Midnight turn the relay on

  ReefAngel.StandardLights( Port4,10,0,20,0 ); //ATI Actinic
  ReefAngel.StandardLights( Port5,11,0,19,0 );  //ATI Daylight
  ReefAngel.StandardLights( Port6,10,0,20,0 );  //ATI Fan
  ReefAngel.StandardHeater( Port7,778,790 ); //Heater
  ReefAngel.Relay.DelayedOn( Port8,2 ); //Skimmer
  //  ReefAngel.AI.SetChannel( White, PWMParabola(11,0,17,0,0,75,0) );
  //  ReefAngel.AI.SetChannel( Blue, PWMParabola(9,0,20,0,15,100,0) );
  //  ReefAngel.AI.SetChannel( RoyalBlue, PWMParabola(9,0,20,0,15,100,(MoonPhase()/5)<3 ? 3:MoonPhase()/5) );
  //  ReefAngel.RF.UseMemory = false;
  //  ReefAngel.RF.SetMode( ReefCrest,85,10 );
  //  ReefAngel.RF.SetChannel( Radion_White, PWMParabola(9,0,20,0,0,60,0) );
  //  ReefAngel.RF.SetChannel( Radion_RoyalBlue, MoonPhase() );
  //  ReefAngel.RF.SetChannel( Radion_Red, PWMParabola(9,0,20,0,15,65,15) );
  //  ReefAngel.RF.SetChannel( Radion_Green, PWMParabola(9,0,20,0,15,50,15) );
  //  ReefAngel.RF.SetChannel( Radion_Blue, MoonPhase() );
  //   ReefAngel.RF.SetChannel( Radion_Intensity, PWMParabola(9,0,20,0,15,94,15) );
  //  if ( second()==0 ) ReefAngel.RF.RadionWrite();


  ////// Place your custom code below here


  ReefAngel.RF.UseMemory = false;
  if (hour()>=6 && hour()<11)
    myRFSetMode(ReefCrest,85,10);
  else if (hour()>=11 && hour()<13)
    myRFSetMode(ReefCrest,85,10);
  else if (hour()>=13 && hour()<16)
    myRFSetMode(Smart_NTM,85,15);
  else if (hour()>=16 && hour()<19)
    myRFSetMode(ReefCrest,65,10);
  else
    myRFSetMode(Lagoon,40,10);


  // Hardcode PH calibrations
  //ReefAngel.PHMin=544; // PH7.0
  //ReefAngel.PHMax=830; // PH10.0

    ////// Place your custom code above here

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

void DrawCustomMain()
{
  int x,y;
  char text[10];
  // Aqua Illumination
  x = 10;
  y = 20;
  ReefAngel.LCD.DrawText( COLOR_DODGERBLUE,DefaultBGColor,x,y,"WH:" );
  ReefAngel.LCD.DrawText( COLOR_DODGERBLUE,DefaultBGColor,x+38,y,"BL:" );
  ReefAngel.LCD.DrawText( COLOR_DODGERBLUE,DefaultBGColor,x+76,y,"RB:" );
  for ( int a=0;a<3;a++ )
  {
    ReefAngel.LCD.DrawText( COLOR_DODGERBLUE,DefaultBGColor,x+18,y,ReefAngel.AI.GetChannel(a) );
    x += 38;
  }
  pingSerial();

  // Parameters
#if defined DisplayLEDPWM && ! defined RemoveAllLights
  ReefAngel.LCD.DrawMonitor( 15, 48, ReefAngel.Params,
  ReefAngel.PWM.GetDaylightValue(), ReefAngel.PWM.GetActinicValue() );
#else // defined DisplayLEDPWM && ! defined RemoveAllLights
  ReefAngel.LCD.DrawMonitor( 15, 48, ReefAngel.Params );
#endif // defined DisplayLEDPWM && ! defined RemoveAllLights
  pingSerial();

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

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

void DrawCustomGraph()
{
}

void myRFSetMode(byte m, byte s, byte d)
{
  if (m!=myRFMode || s!=myRFSpeed || d!=myRFDuration || millis()<5000)
  {
    myRFMode=m;
    myRFSpeed=s;
    myRFDuration=d;
    ReefAngel.RF.SetMode(m,s,d);
  }
}
Roberto.
ecam
Posts: 229
Joined: Thu Nov 15, 2012 11:27 am

Re: Reef Angel Malfunctioning

Post by ecam »

rimai wrote:To use the new code, you will need to return the RF module to the original firmware.

Roberto, i was regarding in one of the post that you thought the dimming home might be having adverse affects with the Angel. Should i try disconnect the hub and finding out if that works?

http://forum.reefangel.com/viewtopic.php?f=12&t=3865


Cause this same thing happened to me last weekend. With the time changing on me.
Post Reply