I have the RA plugged into the Relay box, then USB to the expansion hub, then USB to the relay expansion module, then serial to the 2nd Relay box. I believe that is how it is all wired.
On the RA LCD, I see the 2nd Relay, and it says port 1 (Kessil) is on, but it doesn't actually power on. As far as I see, none of the ports come on. I left the relay expansion set to all 3 switches off, which should be #1. Was that right?
Any idea?
My code is here:
Code: Select all
#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>
#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.FeedingModePorts = Port3Bit | Port4Bit | Port5Bit | Port6Bit | Port7Bit;
ReefAngel.FeedingModePortsE[0] = Port3Bit | Port4Bit | Port5Bit | Port6Bit;
// Ports toggled in Water Change Mode
ReefAngel.WaterChangePorts = Port3Bit | Port4Bit | Port5Bit | Port6Bit | Port7Bit | Port8Bit;
ReefAngel.WaterChangePortsE[0] = Port3Bit | Port4Bit | Port5Bit | Port6Bit;
// Ports toggled when Lights On / Off menu entry selected
ReefAngel.LightsOnPorts = Port1Bit;
ReefAngel.LightsOnPortsE[0] = Port1Bit | Port2Bit;
// Ports turned off when Overheat temperature exceeded
ReefAngel.OverheatShutoffPorts = Port1Bit | Port8Bit;
ReefAngel.OverheatShutoffPortsE[0] = Port1Bit | Port2Bit;
// Use T1 probe as temperature and overheat functions
ReefAngel.TempProbe = T1_PROBE;
ReefAngel.OverheatProbe = T1_PROBE;
// Set the Overheat temperature setting
InternalMemory.OverheatTemp_write( 830 );
// Ports that are always on
ReefAngel.Relay.On( Port7 );
ReefAngel.Relay.On( Box1_Port7 );
ReefAngel.Relay.On(Port5);
ReefAngel.Relay.On(Port6);
ReefAngel.Relay.On(Box1_Port5);
ReefAngel.Relay.On(Box1_Port6);
////// Place additional initialization code below here
////// Place additional initialization code above here
}
void loop()
{
ReefAngel.StandardLights( Port1,11,0,19,0 );
ReefAngel.StandardLights( Port2,19,0,11,0 );
ReefAngel.StandardHeater( Port8,770,790 );
ReefAngel.StandardLights( Box1_Port1,11,0,19,0 );
ReefAngel.StandardATO( Box1_Port3,60 );
////// Place your custom code below here
// Actinic lights - BEGIN
// Sunrise
ReefAngel.StandardLights(Box1_Port2,8,0,9,30);
//Sunset
ReefAngel.StandardLights(Box1_Port2,18,30,20,0);
// 15min interval
ReefAngel.StandardLights(Box1_Port2,10,15,10,30);
ReefAngel.StandardLights(Box1_Port2,11,30,11,45);
ReefAngel.StandardLights(Box1_Port2,13,0,13,15);
ReefAngel.StandardLights(Box1_Port2,14,15,14,30);
ReefAngel.StandardLights(Box1_Port2,15,0,15,15);
ReefAngel.StandardLights(Box1_Port2,16,15,16,30);
ReefAngel.StandardLights(Box1_Port2,17,15,17,30);
// Actinic lights - END
////// Place your custom code above here
// This should always be the last line
ReefAngel.Portal( "kahlif" );
ReefAngel.ShowInterface();
}
void DrawCustomMain()
{
int x,y;
char text[10];
// Parameters
#if defined DisplayLEDPWM && ! defined RemoveAllLights
ReefAngel.LCD.DrawMonitor( 15, 62, ReefAngel.Params,
ReefAngel.PWM.GetDaylightValue(), ReefAngel.PWM.GetActinicValue() );
#else // defined DisplayLEDPWM && ! defined RemoveAllLights
ReefAngel.LCD.DrawMonitor( 15, 62, 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, 93, TempRelay );
pingSerial();
// Relay Expansion
TempRelay = ReefAngel.Relay.RelayDataE[0];
TempRelay &= ReefAngel.Relay.RelayMaskOffE[0];
TempRelay |= ReefAngel.Relay.RelayMaskOnE[0];
ReefAngel.LCD.DrawOutletBox( 12, 107, TempRelay );
pingSerial();
// Date and Time
ReefAngel.LCD.DrawDate( 6, 122 );
pingSerial();
}
void DrawCustomGraph()
{
ReefAngel.LCD.DrawGraph( 5, 5 );
}