Outlet Socket Assignment?

Basic / Standard Reef Angel hardware
Post Reply
Piper
Posts: 298
Joined: Fri Jul 20, 2012 7:13 am
Location: Oakley, CA

Outlet Socket Assignment?

Post by Piper »

Is this the correct outlet socket assignment for the current relay boxes?

Image

Going off of this image I had two of my powerheads plugged into 5 and 6 for the wavemaker ports but they were not working. I plugged them into what would be 3 and 4 and they are working.

This is on the Relay Expansion Module if that makes a difference. The main module appears to be working as normal. Any ideas?

~Charlie
rimai
Posts: 12857
Joined: Fri Mar 18, 2011 6:47 pm

Re: Outlet Socket Assignment?

Post by rimai »

Yeap. That's correct.
Roberto.
Piper
Posts: 298
Joined: Fri Jul 20, 2012 7:13 am
Location: Oakley, CA

Re: Outlet Socket Assignment?

Post by Piper »

I can't seem to get ports 5 and 6 to work at all. I can get 7 and 8 to work through the portal with a light plugged into the outlet. Same with 1 and 2. 3 and 4 seem to be my wavemaker ports.

Is this something do do with the wiring in the box? My wiring of the relay expansion box? Or possibly my code?

~Charlie
rimai
Posts: 12857
Joined: Fri Mar 18, 2011 6:47 pm

Re: Outlet Socket Assignment?

Post by rimai »

can you post your code?

Sent from my SPH-D700 using Tapatalk 2
Roberto.
Piper
Posts: 298
Joined: Fri Jul 20, 2012 7:13 am
Location: Oakley, CA

Re: Outlet Socket Assignment?

Post by Piper »

Here's what I'm using now:

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 <ReefAngel.h>

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

//*************************************************************
// Define relay box ports
//
// Relay Box #1
#define  ReturnPump     Box0_Port1
#define  Skimmer        Box0_Port2
#define  FugeLight      Box0_Port3
#define  Unused         Box0_Port4  // Not used
#define  PowerHead_1    Box0_Port5
#define  PowerHead_2    Box0_Port6
#define  AlkDoser       Box0_Port7
#define  CalDoser       Box0_Port8

// Relay Box #2
#define  Heater         Box1_Port1
#define  ReefBrite      Box1_Port2
#define  Kessil_A150_1  Box1_Port3
#define  Kessil_A150_2  Box1_Port4
#define  PowerHead_3    Box1_Port5
#define  PowerHead_4    Box1_Port6
#define  Kessil_A350_1  Box1_Port7
#define  Fans           Box1_Port8
//*************************************************************

////// Place global variable code above here
boolean wmDelay = false;
byte    wmPort  = PowerHead_1;

byte lightOffset = InternalMemory.ActinicOffset_read();

boolean lightsAreOn () {
  boolean lightsOn = false;
  int lightsOnMins  = NumMins(InternalMemory.StdLightsOnHour_read(),InternalMemory.StdLightsOnMinute_read()) - lightOffset * 2;
  int lightsOffMins = NumMins(InternalMemory.StdLightsOffHour_read(),InternalMemory.StdLightsOffMinute_read()) + lightOffset * 2;
  int currentMins   = NumMins(hour(), minute());
  
  if (currentMins >= lightsOnMins && currentMins <= lightsOffMins) {
    lightsOn = true;
  } else {
    lightsOn = false;
  }
  
  return lightsOn;
}

void setup()
{
    // This must be the first line
    ReefAngel.Init();  //Initialize controller
    
    // Ports toggled in Feeding Mode
    ReefAngel.FeedingModePorts = Port2Bit | Port5Bit | Port6Bit;
    ReefAngel.FeedingModePortsE[0] = Port5Bit | Port6Bit;
    
    // Ports toggled in Water Change Mode
    ReefAngel.WaterChangePorts = Port1Bit | Port2Bit | Port5Bit | Port6Bit | Port7Bit | Port8Bit;
    ReefAngel.WaterChangePortsE[0] = Port1Bit | Port5Bit | Port6Bit;
    
    // Ports toggled when Lights On / Off menu entry selected
    ReefAngel.LightsOnPorts = 0;
    ReefAngel.LightsOnPortsE[0] = Port2Bit | Port3Bit | Port4Bit | Port7Bit;
    
    // Ports turned off when Overheat temperature exceeded
    ReefAngel.OverheatShutoffPorts = Port2Bit | Port3Bit;
    ReefAngel.OverheatShutoffPortsE[0] = Port1Bit | Port2Bit | Port3Bit | Port4Bit | Port5Bit | Port6Bit | Port7Bit;
    
    // Use T1 probe as temperature and overheat functions
    ReefAngel.TempProbe = T1_PROBE;
    ReefAngel.OverheatProbe = T1_PROBE;
    
    // Ports that are always on
    ReefAngel.Relay.On(ReturnPump);
    ReefAngel.Relay.On(Skimmer);
    
    ReefAngel.AddWifi();

    ////// Place additional initialization code below here
    
    randomSeed(analogRead(0));
    ReefAngel.Timer[1].SetInterval(random(18,45));
    ReefAngel.Timer[1].Start(); 

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

void loop()
{   
    // Trun on ReefBrite (2 * offset) minutes before full daylight
    ReefAngel.StandardLights(ReefBrite, lightOffset * 2);
    
    // Turn on Kessil A150s (offset) minutes before full daylight
    ReefAngel.StandardLights(Kessil_A150_1, lightOffset);
    ReefAngel.StandardLights(Kessil_A150_2, lightOffset);
    
    // Turn on Kessil A350 at standard daylight setting
    ReefAngel.DayLights(Kessil_A350_1);
    
    ReefAngel.StandardHeater(Heater);

    // We always want the fans on when the lights are on to vent the canopy.  When the lights
    // are out we want to run the fans in standard fan mode so they only turn on when needed.
    // We want to run the fuge light opposite daylight
    if (lightsAreOn()) {
      ReefAngel.Relay.On(Fans);
      ReefAngel.Relay.Off(FugeLight);
    } 
    else {
      ReefAngel.StandardFan(Fans);
      ReefAngel.Relay.On(FugeLight);      
    }
    
    
    // wavemaker timers and slow down at night
    // http://forum.reefangel.com/viewtopic.php?f=12&t=1588&p=12403
    if (ReefAngel.Timer[1].IsTriggered()) {
      // Night Mode
      if (!lightsAreOn()) {
        // Always turn off powerheads 3 and 4 at night.
        ReefAngel.Relay.Off(PowerHead_3);
        ReefAngel.Relay.Off(PowerHead_4);

        if (wmDelay) { // wm night delay
          ReefAngel.Timer[1].SetInterval(30);
          ReefAngel.Timer[1].Start();
          ReefAngel.Relay.Off(PowerHead_1);
          ReefAngel.Relay.Off(PowerHead_2);
          wmPort == PowerHead_1 ? wmPort = PowerHead_2 : wmPort = PowerHead_1;
          wmDelay = false;
        }
        else {
          ReefAngel.Timer[1].SetInterval(20); // short wave
          ReefAngel.Timer[1].Start();
          ReefAngel.Relay.On(wmPort);
          wmDelay = true;
        }
      }
      // Day Mode
      else {
        ReefAngel.Timer[1].SetInterval(random(15,45));
        ReefAngel.Timer[1].Start();
        ReefAngel.Relay.Toggle(PowerHead_1);
        ReefAngel.Relay.Toggle(PowerHead_3);

        if (bitRead(ReefAngel.Relay.RelayData,PowerHead_1 - 1)) {
          ReefAngel.Relay.Off(PowerHead_2);
          ReefAngel.Relay.Off(PowerHead_4);
        } else {
          ReefAngel.Relay.On(PowerHead_2);
          ReefAngel.Relay.On(PowerHead_4);
        }
      }
    }
    
    // Turn on the moonlight at night
    if (!lightsAreOn()) {
      ReefAngel.PWM.SetDaylight(MoonPhase());
      ReefAngel.PWM.SetActinic(MoonPhase());
    }
    else {
      ReefAngel.PWM.SetDaylight(0);
      ReefAngel.PWM.SetActinic(0);
    }
    
    // Set up the dosing pumps.
    ReefAngel.DosingPumpRepeat1(CalDoser);
    ReefAngel.DosingPumpRepeat2(AlkDoser);

    
    // This should always be the last line
    ReefAngel.Portal("xxxx", "xxxx");
    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, 106, TempRelay );
    pingSerial();

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

void DrawCustomGraph()
{
    ReefAngel.LCD.DrawGraph( 5, 5 );
}
rimai
Posts: 12857
Joined: Fri Mar 18, 2011 6:47 pm

Re: Outlet Socket Assignment?

Post by rimai »

That's some nice coding :)
I'm impressed on how you picked up on the coding so quick!!!
I don't see anything wrong or out of ordinary.
Can you test the ports with this code?

Code: Select all

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

int port=0;

void setup()
{
  ReefAngel.Init();  
}

void loop()
{
  
  /*
  This code will display:
  
  Temperature probes
  pH probe
  Daylight PWM % (if the feature is enabled)
  Actinic PWM % (if the feature is enabled)
  Relay box
  Time/Date
  ATO port status
  
  It will blink the red status LED and increment the PWM % every second.
  
  Moving or pressing the joystick will activate another port in the relay box.
  
  */
  if (ReefAngel.Joystick.IsUp() || ReefAngel.Joystick.IsRight()) port++;
  if (ReefAngel.Joystick.IsButtonPressed()) port++;
  if (ReefAngel.Joystick.IsDown() || ReefAngel.Joystick.IsLeft()) port--;
  if (port>7) port=0;
  if (port<0) port=7;
  ReefAngel.LCD.DrawText(DefaultFGColor,DefaultBGColor,15,10,"Port   On");
  ReefAngel.LCD.DrawText(DefaultFGColor,DefaultBGColor,45,10,port+1); 
  ReefAngel.LCD.DrawText(DefaultFGColor,DefaultBGColor,15,20,"Low ATO");
  if (ReefAngel.LowATO.IsActive())
    ReefAngel.LCD.DrawText(DefaultFGColor,DefaultBGColor,65,20,"Closed");
  else
    ReefAngel.LCD.DrawText(DefaultFGColor,DefaultBGColor,65,20,"Open  ");
  ReefAngel.LCD.DrawText(DefaultFGColor,DefaultBGColor,15,30,"High ATO");
  if (ReefAngel.HighATO.IsActive())
    ReefAngel.LCD.DrawText(DefaultFGColor,DefaultBGColor,70,30,"Closed");
  else
    ReefAngel.LCD.DrawText(DefaultFGColor,DefaultBGColor,70,30,"Open  ");
  ReefAngel.LCD.DrawText(DefaultFGColor,DefaultBGColor,15,40,"Status LED ");
  if (now()%2==0)
  {
    ReefAngel.LED.On();
    ReefAngel.LCD.DrawText(DefaultFGColor,DefaultBGColor,80,40,"On ");
  }
  else
  {
    ReefAngel.LED.Off();
    ReefAngel.LCD.DrawText(DefaultFGColor,DefaultBGColor,80,40,"Off");
  }
  ReefAngel.Relay.RelayData=1<<port;
  //Box1_Port
  ReefAngel.Relay.RelayDataE[0]=1<<port;  
#if defined DisplayLEDPWM && ! defined RemoveAllLights
  ReefAngel.PWM.SetActinic(now()%100);
  ReefAngel.PWM.SetDaylight(now()%100);
  ReefAngel.LCD.DrawMonitor(15, 70, ReefAngel.Params,
  ReefAngel.PWM.GetDaylightValue(), ReefAngel.PWM.GetActinicValue());
#else // defined DisplayLEDPWM && ! defined RemoveAllLights
  ReefAngel.LCD.DrawMonitor(15, 70, ReefAngel.Params);
#endif // defined DisplayLEDPWM && ! defined RemoveAllLights
  ReefAngel.LCD.DrawOutletBox(12, 103, ReefAngel.Relay.RelayData);
  ReefAngel.LCD.DrawDate(6, 122);
  ReefAngel.Relay.Write();
  ReefAngel.Refresh();
}
Roberto.
Piper
Posts: 298
Joined: Fri Jul 20, 2012 7:13 am
Location: Oakley, CA

Re: Outlet Socket Assignment?

Post by Piper »

That code makes all the ports work as expected when testing each box individually. What's odd is that if I have the Relay Expansion Module hooked up while I'm testing the main box I get odd ports that turn on in the expansion box. It must be something to do with the Relay Expansion Module?

Is there anything special about the USB cable that came with the relay expansion module? The end the plugs into the main relay box was broken so I used a regular USB cable I had laying around in the cable drawer.

~Charlie
Piper
Posts: 298
Joined: Fri Jul 20, 2012 7:13 am
Location: Oakley, CA

Re: Outlet Socket Assignment?

Post by Piper »

rimai wrote:That's some nice coding :)
I'm impressed on how you picked up on the coding so quick!!!
I took a couple of semesters of C and C++. After working with the code yesterday and today I can sure tell that it was a *loooong* time ago too :)

Looking through the docs that lnevo put up (http://www.easte.net/RA/html/index.html) helped a lot too. I can't wait to get my RA up and running and start working on the docs. Just what lnevo put up so far has been a big help!

~Charlie
rimai
Posts: 12857
Joined: Fri Mar 18, 2011 6:47 pm

Re: Outlet Socket Assignment?

Post by rimai »

No, nothing special about the usb cable.
The code was supposed to scroll through each port in the expansion box too, just like in the main box.
When you say odd, do you mean they don't turn on according to the sequence??
Roberto.
Piper
Posts: 298
Joined: Fri Jul 20, 2012 7:13 am
Location: Oakley, CA

Re: Outlet Socket Assignment?

Post by Piper »

I only had one row of outlets showing on the RA and assumed it was only able to test one box. Should I be seeing two rows if the expansion is set up correctly?

What I meant by odd is that when I got to port 3 on the main box (with the expansion plugged in) the ReefBrite strip plugged into the second box, Box1_Port2 I think, also turned up in addition to Box0_Port3.

Did I miss something when I set up the expansion?
rimai
Posts: 12857
Joined: Fri Mar 18, 2011 6:47 pm

Re: Outlet Socket Assignment?

Post by rimai »

Sorry, the test code was actually scrolling through both boxes at the same time even though it showed on line.
So, it should have been doing Box0_Port1 and Box1_Port1 at the same time, then Box0_Port2 and Box1_Port2 at the same time and so forth.
Roberto.
Piper
Posts: 298
Joined: Fri Jul 20, 2012 7:13 am
Location: Oakley, CA

Re: Outlet Socket Assignment?

Post by Piper »

Ooops - that makes more sense now :) Let me plug my light back and go hook the controller back up. Will let you know in a minute...
Piper
Posts: 298
Joined: Fri Jul 20, 2012 7:13 am
Location: Oakley, CA

Re: Outlet Socket Assignment?

Post by Piper »

OK - That worked as it should have. With the expansion hooked up it cycled through each port and both boxes fired off as expected.

So I have issues with my code somewhere?
rimai
Posts: 12857
Joined: Fri Mar 18, 2011 6:47 pm

Re: Outlet Socket Assignment?

Post by rimai »

That's what it is leading to.
Can you minimize your code to a few functions and go adding one at time as you go testing them??
Roberto.
Piper
Posts: 298
Joined: Fri Jul 20, 2012 7:13 am
Location: Oakley, CA

Re: Outlet Socket Assignment?

Post by Piper »

Yep! I'll let you know what I come up with.
Piper
Posts: 298
Joined: Fri Jul 20, 2012 7:13 am
Location: Oakley, CA

Re: Outlet Socket Assignment?

Post by Piper »

I went back to basically nothing and it's still acting haywire. I used the Wizard after that and it seemed to help but within 10 minutes it got all crazy on me again.

This is the code I have now:

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 <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 = Port5Bit | Port6Bit;
    ReefAngel.FeedingModePortsE[0] = Port5Bit | Port6Bit;
    // Ports toggled in Water Change Mode
    ReefAngel.WaterChangePorts = Port1Bit | Port2Bit | Port5Bit | Port6Bit | Port7Bit | Port8Bit;
    ReefAngel.WaterChangePortsE[0] = Port1Bit | Port5Bit | Port6Bit;
    // Ports toggled when Lights On / Off menu entry selected
    ReefAngel.LightsOnPorts = Port3Bit;
    ReefAngel.LightsOnPortsE[0] = Port2Bit | Port3Bit | Port4Bit | Port7Bit | Port8Bit;
    // Ports turned off when Overheat temperature exceeded
    ReefAngel.OverheatShutoffPorts = Port3Bit;
    ReefAngel.OverheatShutoffPortsE[0] = Port1Bit | Port3Bit | Port4Bit | Port5Bit | Port6Bit | Port7Bit;
    // Use T1 probe as temperature and overheat functions
    ReefAngel.TempProbe = T1_PROBE;
    ReefAngel.OverheatProbe = T1_PROBE;


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

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

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

void loop()
{
    ReefAngel.MoonLights( Port3 );
    ReefAngel.Wavemaker1( Port5 );
    ReefAngel.Wavemaker1( Port6 );
    ReefAngel.DosingPumpRepeat1( Port7 );
    ReefAngel.DosingPumpRepeat2( Port8 );
    ReefAngel.StandardHeater( Box1_Port1 );
    ReefAngel.ActinicLights( Box1_Port2 );
    ReefAngel.DayLights( Box1_Port3 );
    ReefAngel.DayLights( Box1_Port4 );
    ReefAngel.Wavemaker1( Box1_Port5 );
    ReefAngel.Wavemaker1( Box1_Port6 );
    ReefAngel.DayLights( Box1_Port7 );
    ReefAngel.StandardFan( Box1_Port8 );
    ReefAngel.PWM.SetDaylight( MoonPhase() );
    ReefAngel.PWM.SetActinic( MoonPhase() );
    ////// Place your custom code below here
    

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

    // This should always be the last line
    ReefAngel.Portal( "Piper" );
    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, 106, TempRelay );
    pingSerial();

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

void DrawCustomGraph()
{
    ReefAngel.LCD.DrawGraph( 5, 5 );
}
If I use the portal to turn the ports on/off it works for some and not others. For instance, I can turn my fans off on Box1_Portt8 but then I can't turn them back on. I tried to turn on my alk pump on Port8 (Box0) and my fans came on! I'm confused...

Do I have something plugged in that the RA doesn't like maybe?

Box #1
Port 1 Little Giant pump
Port 2 EuroReef Skimmer
Port 3 T5 home depot shop light
Port 4 Not uesd
Port 5 Koralia pump
Port 6 Koralia pump
Port 7 Drew's doser pump
Port 8 BRS dosesr pump

Box #1
Port 1 Jager heater
Port 2 Reef Brite 50/50 strip
Port 3 Kessil A150
Port 4 Kessil A150
Port 5 Koralia pump
Port 6 Koralia pump
Port 7 Kessil A350
Port 8 4 x 12v DC fans hooked up to an in-line power supply w/ a 4-pin molex connector. The PS has puts out more than enough juice for the fans.

Do any of those not play nice with the RA?

~Charlie
Piper
Posts: 298
Joined: Fri Jul 20, 2012 7:13 am
Location: Oakley, CA

Re: Outlet Socket Assignment?

Post by Piper »

Roberto - One more question for you. On the wifi web server, http://xxx.xxx.xx.xxx:2000/wifi, should I see both sets of relay ports? I'm only seeing the main set up relays using that but I see both sets using the portal. Do I have something configured wrong maybe?

~Charlie
binder
Posts: 2865
Joined: Fri Mar 18, 2011 6:20 pm
Location: Illinois
Contact:

Re: Outlet Socket Assignment?

Post by binder »

Piper wrote:Roberto - One more question for you. On the wifi web server, http://xxx.xxx.xx.xxx:2000/wifi, should I see both sets of relay ports? I'm only seeing the main set up relays using that but I see both sets using the portal. Do I have something configured wrong maybe?

~Charlie
The internal webserver / wifi page only shows the main relay. It's not been updated yet to show additional relays.
Piper
Posts: 298
Joined: Fri Jul 20, 2012 7:13 am
Location: Oakley, CA

Re: Outlet Socket Assignment?

Post by Piper »

I think I found the problem. The Koralia on Box1_Port6 was running backwards and I think that might have made everything go haywire once it kicked on for the first time. Where it's located in the tank I was not able to see that it wasn't running correctly and I replaced it with a desk lamp when I used the test code :)

After replacing the cover on that PH it started running normal and things seem to be working now. I might still have a problem with my fans. They don't seem to want to turn back on within a minute or two of being turned off. I don't know if that has something to do with the power adapter or not. I'll see if I can put a delayed start on that outlet and see if that makes a difference. When I got up this morning they were running to cool the tank so it seems they will come back on after a certain time period.

Curt - Thanks! That clears that up for me.
rimai
Posts: 12857
Joined: Fri Mar 18, 2011 6:47 pm

Re: Outlet Socket Assignment?

Post by rimai »

Yeah, we need new /wifi page :(
Just curious if you have any problem when it is running on auto mode or the problem only presents itself when you try to override the relays.
Roberto.
Piper
Posts: 298
Joined: Fri Jul 20, 2012 7:13 am
Location: Oakley, CA

Re: Outlet Socket Assignment?

Post by Piper »

It was acting up out as soon as I uploaded the code to the live controller but I'm fairly certain that was because of the Koralia running in reverse. It would get worse when I used the portal to go from auto to on/off. That seemed to be when I had the problems with the fans for sure. I would get a pop-up on the Portal that simply said "Error" and that was it. And that seem to be mostly (or only - can't be certain) when going from auto to on.

What are you using for the web server on the module and what did you code the /wifi page in?
rimai
Posts: 12857
Joined: Fri Mar 18, 2011 6:47 pm

Re: Outlet Socket Assignment?

Post by rimai »

Want to give it a shot?
The /wifi does nothing but return a JS file.

Code: Select all

<script language='javascript' src='http://www.reefangel.com/wifi/ra1.js'></script>
Everything is encoded inside the JS file
So, the javascript basically tells the browser to draw something and also to update the information every few seconds.
It pulls data with /r99. The data is XML encoded and all you need to do is parse it :)
Roberto.
Piper
Posts: 298
Joined: Fri Jul 20, 2012 7:13 am
Location: Oakley, CA

Re: Outlet Socket Assignment?

Post by Piper »

I'll take a look at it. I want to get my controller dialed in and clean up the mess I left in front of the tank first though :)

Hmmm - /r99 only shows me output for the first relay. Does that need to be fixed on the server first?
Piper
Posts: 298
Joined: Fri Jul 20, 2012 7:13 am
Location: Oakley, CA

Re: Outlet Socket Assignment?

Post by Piper »

rimai wrote:Just curious if you have any problem when it is running on auto mode or the problem only presents itself when you try to override the relays.
Roberto - Are there any known issues with this? I got home tonight and the fans were no-op after the lights came on this morning. They worked all night but looking at the portal today I thought the tank temp and canopy temp were too high for the fans to be on. There was a sharp increase in temp shortly after the lights kicked on and the fans usually compete with the heater on the tank.

On top of that, two of the four lights did not kick on (or kicked off at some point before I got home) either. All of the malfunctioning outlets were in auto mode. Manually switching them with the portal did not make a difference.

Still stumped...
Piper
Posts: 298
Joined: Fri Jul 20, 2012 7:13 am
Location: Oakley, CA

Re: Outlet Socket Assignment?

Post by Piper »

I loaded the test code again and it worked fine the first time through. I used the portal to flip a couple of switches and it started getting funky again. Most of the outlets on the 2nd box were not responding to the portal after a couple of minutes of toggling.

[EDIT]
Using the controller to flip through the outlets after using the portal did not have the same results. On the main box all but ports 5 and 6 worked. No response at all on 5 and 6. No response from any port an the expansion relay.
[/edit]
Piper
Posts: 298
Joined: Fri Jul 20, 2012 7:13 am
Location: Oakley, CA

Re: Outlet Socket Assignment?

Post by Piper »

Pulled everything apart, swapped the relay boxes, wired everything back up, did the happy relay box dance and I can no longer replicate the strangeness. With the relay boxes at least...

Going to leave the default wizard code in for now. I'll let you know how it goes tomorrow.

~Charlie
Piper
Posts: 298
Joined: Fri Jul 20, 2012 7:13 am
Location: Oakley, CA

Re: Outlet Socket Assignment?

Post by Piper »

Everything is working fine still. It must have been a lose wire somewhere. I'll revert back to my original code this weekend when I have time to hang out and observe how things go.

~Charlie
Post Reply