How do I get the portal to see my new relay expansion?

Basic / Standard Reef Angel hardware
Post Reply
Smotz
Posts: 401
Joined: Sat Mar 30, 2013 5:02 pm
Location: CT, USA

How do I get the portal to see my new relay expansion?

Post by Smotz »

Hi

Just installed the expansion module and relay expansion. How do I get the portal to recognize my new (8) ports?

my code:

Code: Select all

////  Port 1			Heater
////  Port 2			ATO pump
////  Port 3			Reactor Pump
////  Port 4			Protien Skimmer
////  Port 5			Return Pump
////  Port 6			Wavemaker
////  Port 7                    UV Sterilizer
////  BOX 1 PORT 8              Fuge Light
////  Always on - Lights & Salinity Module


#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 <DCPump.h>
#include <ReefAngel.h>

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

#define Heater Port1
#define Topoff Port2
#define Reactor Port3
#define Skimmer Port4
#define Return Port5
#define Wave Port6
#define UVlight Port7
#define Fugelight Box1_Port8
#define FugelightBit   2<<7
#define UVlightBit   1<<6
#define WaveBit   1<<5
#define ReturnBit   1<<4
#define SkimmerBit   1<<3
#define ReactorBit   1<<2
#define TopoffBit   1<<1
#define HeaterBit   1<<0

static byte wpMode;
static byte wpWavStr;
static byte wpWavOff;

////// 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 = TopoffBit | ReactorBit | SkimmerBit | ReturnBit | UVlightBit;
  // Ports toggled in Water Change Mode
  ReefAngel.WaterChangePorts = HeaterBit | TopoffBit | ReactorBit | SkimmerBit | ReturnBit | WaveBit | UVlightBit;
  // Ports toggled when Lights On / Off menu entry selected
  ReefAngel.LightsOnPorts = FugelightBit;
  // Ports turned off when Overheat temperature exceeded
  ReefAngel.OverheatShutoffPorts = HeaterBit | TopoffBit | ReactorBit | SkimmerBit | ReturnBit | WaveBit | UVlightBit;

  // Use T1 (SUMP) probe as temperature and overheat functions
  ReefAngel.TempProbe = T1_PROBE;
  ReefAngel.OverheatProbe = T1_PROBE;

  // Ports that are always on
  ReefAngel.Relay.On( Return );
  ReefAngel.Relay.On( Reactor );
  ReefAngel.Relay.On( Wave );

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


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

void loop()
{
  ReefAngel.StandardHeater( Heater );
  ReefAngel.StandardATO( Topoff );
  ReefAngel.MoonLights( Fugelight );

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

  ReefAngel.LCD.DrawText(0,255,20,80,"Joe's Reef Tank");
  ReefAngel.Relay.DelayedOn(Skimmer,2);
  ReefAngel.Relay.DelayedOn(UVlight,1);

  ReefAngel.DCPump.FeedingSpeed=30;
  ReefAngel.DCPump.WaterChangeSpeed=0;
  ReefAngel.DCPump.DaylightChannel = Sync;
  ReefAngel.DCPump.ActinicChannel = Sync;

  //if (ReefAngel.DCPump.Mode==Custom) ReefAngel.DCPump.UseMemory = false;
  //else ReefAngel.DCPump.UseMemory = true; 
  // Custom Wave Routine 
  if (ReefAngel.DCPump.Mode==Custom) {  
    ReefAngel.DCPump.UseMemory = false;

    // set the wpMode
    if ( (hour() >= 5) && (hour() < 8) )   wpMode=1;       // from 5am - 8am
    if ( (hour() >= 8) && (hour() < 11) ) wpMode=2;      // from 8am - 11am
    if ( (hour() >= 11) && (hour() < 14) ) wpMode=3;     // from 11a - 2pm
    if ( (hour() >= 14) && (hour() < 17) ) wpMode=2;     // from 2pm - 5pm
    if ( (hour() >= 17) && (hour() < 20) ) wpMode=1;     // from 5pm - 8pm
    if ( (hour() >= 20) && (hour() < 23) ) wpMode=2;     // from 8pm - 11p
    if ( (hour() >= 23) && (hour() < 2) ) wpMode=3;      // from 11pm - 2am
    if ( (hour() >= 2) && (hour() < 5) ) wpMode=2;       // from 2am - 5am

    if (wpMode=1) wpWavStr=45;
    if (wpMode=2) wpWavStr=50;
    if (wpMode=3) wpWavStr=55;
    //Set the Wave OffSet
    wpWavOff=12;  

    //if (ReefAngel.DisplayedMenu==FEEDING_MODE) ReefAngel.PWM.SetDaylight(30);
    //else 
    ReefAngel.PWM.SetDaylight( ReefCrestMode(wpWavStr,wpWavOff,true) );
    ReefAngel.PWM.SetActinic(wpWavStr);     
  }
  else ReefAngel.DCPump.UseMemory = true;

  // end Custom Wave Routine

    //  Only turn on UV Sterilizer between 11pm and 5am
  if ( (hour() >= 5) && (hour() < 23) )  // from 5a - 11p
    ReefAngel.Relay.Off(UVlight);
  else ReefAngel.Relay.On(UVlight);

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

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

void DrawCustomMain()
{

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

  // Salinity
  ReefAngel.LCD.DrawText( COLOR_DARKKHAKI,DefaultBGColor,15,66, "SAL:" );
  ReefAngel.LCD.DrawText( COLOR_DARKKHAKI,DefaultBGColor,39,66, ReefAngel.Params.Salinity );
  pingSerial();

  // Main Relay Box
  byte TempRelay = ReefAngel.Relay.RelayData;
  TempRelay &= ReefAngel.Relay.RelayMaskOff;
  TempRelay |= ReefAngel.Relay.RelayMaskOn;
  ReefAngel.LCD.DrawOutletBox( 12, 90, TempRelay );
  pingSerial();
  
 // Relay Expansion
  TempRelay = ReefAngel.Relay.RelayDataE[0];
  TempRelay &= ReefAngel.Relay.RelayMaskOffE[0];
  TempRelay |= ReefAngel.Relay.RelayMaskOnE[0];
  ReefAngel.LCD.DrawOutletBox( 12, 102, TempRelay );
  pingSerial();

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

  //draw the mode on the screen
  char buf[16];
  if (ReefAngel.DisplayedMenu==FEEDING_MODE) sprintf(buf,"Pumps at %d%%",ReefAngel.DCPump.FeedingSpeed);
  else sprintf(buf,"RC %d%% +/- %d%%",wpWavStr,wpWavOff);
  ReefAngel.LCD.DrawText(0,255,15,52,buf);
}

void DrawCustomGraph()
{
}

rossbryant1956
Posts: 471
Joined: Sat Jan 14, 2012 2:08 pm
Location: Montgomery Village, MD

Re: How do I get the portal to see my new relay expansion?

Post by rossbryant1956 »

put a line this in your code calling one of the outlets on th esecond box

ReefAngel.Relay.On( Fuge Light );

Not sure it will take that space between fuge and light
Roscoe's Reefs - Starting Over Again:

Building new 29g Nano after landlord went berserk over my 4 75 gallon tanks, Multiple RA's, Water mixing stations, etc. Your help welcomed in remembering all I've forgotten.
rimai
Posts: 12857
Joined: Fri Mar 18, 2011 6:47 pm

Re: How do I get the portal to see my new relay expansion?

Post by rimai »

Portal will do it automatically as soon as you upload a new code that uses one of the ports in the expansion box.
Roberto.
Smotz
Posts: 401
Joined: Sat Mar 30, 2013 5:02 pm
Location: CT, USA

Re: How do I get the portal to see my new relay expansion?

Post by Smotz »

rimai wrote:Portal will do it automatically as soon as you upload a new code that uses one of the ports in the expansion box.
This is in my code but the Portal is not showing my new expansion box:

Code: Select all

  // Ports that are always on
  ReefAngel.Relay.On( Return );
  ReefAngel.Relay.On( Reactor );
  ReefAngel.Relay.On( Wave );
  ReefAngel.Relay.On( Box1_Port1 );
  ReefAngel.Relay.On( Box1_Port2 );
  ReefAngel.Relay.On( Box1_Port3 );
  ReefAngel.Relay.On( Box1_Port4 );
  ReefAngel.Relay.On( Box1_Port5 );
  ReefAngel.Relay.On( Box1_Port6 );
  ReefAngel.Relay.On( Box1_Port7 );
rimai
Posts: 12857
Joined: Fri Mar 18, 2011 6:47 pm

Re: How do I get the portal to see my new relay expansion?

Post by rimai »

The last time your controller sent data was 2 days ago. Something else is going on.
Roberto.
Smotz
Posts: 401
Joined: Sat Mar 30, 2013 5:02 pm
Location: CT, USA

Re: How do I get the portal to see my new relay expansion?

Post by Smotz »

rimai wrote:The last time your controller sent data was 2 days ago. Something else is going on.

Ok fixed that. You'll notice that the portal has communicated recently. Still no expansion...??


wtf?? it said it was updated but now i look at it and it says 2 days ago


and now its back to recent


My reefangelid:
Smotz
Connection Status:
Ready

Last Update:
7/13/2013 9:45:07 PM
Displaying data from:
Reef Angel Controller (live)
Smotz
Posts: 401
Joined: Sat Mar 30, 2013 5:02 pm
Location: CT, USA

Re: How do I get the portal to see my new relay expansion?

Post by Smotz »

and theres my relay...

thanks everyone. I needed to reset my wifi adapter back to factory and reconfig.
Now I need to see why bluetooth isnt working.
Post Reply