Lighting/fan/portal not working as intended

Do you have a question on how to do something.
Ask in here.

Posts: 9
Joined: Tue Nov 27, 2012 10:11 pm
PostPosted: Tue Nov 19, 2019 7:30 pm
Hi everyone,

I am not sure if this is a code issue or problem with the RAstar unit.

I have uploaded the following code to;
- turn the T5 lights (ports 6 and 7) on between 10am and 4pm
- turn off the skimmer if the highATO switch is activated.
- turn on the fan when temp 1 is above 25.6 degrees C

These only work sometimes. It seems that whenever the unit is left alone for a few hours it basically continues to run as is. Every day the lights either don't come on or they come on and stay on indefinitely unless I tap the screen to wake the unit up.

Code: Select all
#include <Salinity.h>
#include <ReefAngel_Features.h>
#include <Globals.h>
#include <RA_TS.h>
#include <RA_TouchLCD.h>
#include <RA_TFT.h>
#include <RA_TS.h>
#include <Font.h>
#include <RA_Wifi.h>
#include <RA_Wiznet5100.h>
#include <SD.h>
#include <SPI.h>
#include <Ethernet.h>
#include <EthernetDHCP.h>
#include <PubSubClient.h>
#include <Wire.h>
#include <OneWire.h>
#include <Time.h>
#include <DS1307RTC.h>
#include <InternalEEPROM.h>
#include <RA_ATO.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 <RA_CustomLabels.h>
#include <RF.h>
#include <IO.h>
#include <ORP.h>
#include <AI.h>
#include <PH.h>
#include <WaterLevel.h>
#include <Humidity.h>
#include <PAR.h>
#include <DCPump.h>
#include <ReefAngel.h>
#include <SoftwareSerial.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
    ReefAngel.Star();
    ReefAngel.AddPHExpansion();  // pH Expansion Module
    ReefAngel.SetTemperatureUnit( Celsius );  // set to Celsius Temperature
    // Ports toggled in Feeding Mode
    ReefAngel.FeedingModePorts = 0;
    ReefAngel.FeedingModePortsE[0] = Port1Bit | Port4Bit;
    ReefAngel.FeedingModePortsE[1] = 0;
    // Ports toggled in Water Change Mode
    ReefAngel.WaterChangePorts = 0;
    ReefAngel.WaterChangePortsE[0] = Port1Bit | Port4Bit;
    ReefAngel.WaterChangePortsE[1] = 0;
    // Ports turned off when Overheat temperature exceeded
    ReefAngel.OverheatShutoffPorts = 0;
    ReefAngel.OverheatShutoffPortsE[0] = Port2Bit | Port5Bit | Port6Bit;
    ReefAngel.OverheatShutoffPortsE[1] = 0;
    // Ports toggled when Lights On / Off menu entry selected
    ReefAngel.LightsOnPorts = 0;
    ReefAngel.LightsOnPortsE[0] = 0;
    ReefAngel.LightsOnPortsE[1] = 0;
    // Use T1 probe as temperature and overheat functions
    ReefAngel.TempProbe = T1_PROBE;
    ReefAngel.OverheatProbe = T1_PROBE;
    // Set the Overheat temperature setting
    InternalMemory.OverheatTemp_write( 275 );

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

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

    ReefAngel.Relay.Off( Box1_Port5 | Box1_Port6 | Box1_Port7 );

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

void loop()
{
    ReefAngel.StandardHeater1( Box1_Port2 );
    ReefAngel.StandardFan1( Box1_Port3 );
    ReefAngel.Relay.DelayedOn( Box1_Port4 );
    ReefAngel.StandardLights( Box1_Port5,10,0,16,0 );
    ReefAngel.StandardLights( Box1_Port6,10,0,16,0 );
    ReefAngel.StandardLights( Box1_Port7,7,0,18,0 );
    ReefAngel.StandardHeater1( Box1_Port8 );

    boolean buzzer=false;
    if ( ReefAngel.isOverheat() ) buzzer=true;
    if ( buzzer ) ReefAngel.BuzzerOn(2); else ReefAngel.BuzzerOff();

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


    ReefAngel.Relay.Set(Box1_Port4,ReefAngel.HighATO.IsActive());
   
   
    if (ReefAngel.Params.Temp[T1_PROBE]<249) ReefAngel.Relay.On( Box1_Port2 );
    if (ReefAngel.Params.Temp[T1_PROBE]>256) ReefAngel.Relay.On( Box1_Port3 );
    if (ReefAngel.Params.Temp[T1_PROBE]>253) ReefAngel.Relay.Off( Box1_Port2 );
    if (ReefAngel.Params.Temp[T3_PROBE]<249) ReefAngel.Relay.On( Box1_Port8 );
    if (ReefAngel.Params.Temp[T3_PROBE]>253) ReefAngel.Relay.Off( Box1_Port8 );
   
    ////// Place your custom code above here

    ReefAngel.Network.Cloud();
    // This should always be the last line
    ReefAngel.ShowTouchInterface();
}



// RA_STRING1=U2FsdGVkX18dgbkr0enPhNXrgGcSxpffYBHcyfq7FfY=
// RA_STRING2=null
// RA_STRING3=null
// RA_LABEL LABEL_PORT27=Port 27
// RA_LABEL LABEL_PORT16=LightFrag
// RA_LABEL LABEL_ACTINIC2=Actinic 2
// RA_LABEL LABEL_PORT26=Port 26
// RA_LABEL LABEL_PORT15=LightFrag
// RA_LABEL LABEL_PORT24=Port 24
// RA_LABEL LABEL_PORT28=Port 28
// RA_LABEL LABEL_PORT23=Port 23
// RA_LABEL LABEL_PORT14=Skimmer
// RA_LABEL LABEL_PORT13=Fan
// RA_LABEL LABEL_PORT18=HeatFrag
// RA_LABEL LABEL_PORT22=Port 22
// RA_LABEL LABEL_PORT11=Return
// RA_LABEL LABEL_PORT25=Port 25
// RA_LABEL LABEL_DAYLIGHT2=Daylight 2
// RA_LABEL LABEL_PORT17=LightQT
// RA_LABEL LABEL_DAYLIGHT=Daylight
// RA_LABEL LABEL_PORT21=Port 21
// RA_LABEL LABEL_PORT12=HeatSump
// RA_LABEL LABEL_ACTINIC=Actinic


RE the portal.
I was able to get the portal working by connecting the RA unit to a netgear wifi extender via ethernet cable. A few months ago this stopped and I am not sure why. I can't seem to get the portal to update (last update was 10/4/2019). Is there anything in this code that suggests that wouldn't work? Is there any other options to get this running? My IP address hasn't changed.

Any help would be greatly appreciated.

Michael.
Image

Posts: 12537
Joined: Fri Mar 18, 2011 6:47 pm
PostPosted: Tue Nov 19, 2019 11:54 pm
I opened up a new issue.
There was another report of the same problem.
https://github.com/reefangel/Libraries/issues/255
Roberto.

Return to How do I code ...

Who is online

Users browsing this forum: No registered users and 0 guests

cron