Page 1 of 1

Power Control Expansion

Posted: Fri Jun 29, 2018 4:33 pm
by ucez
OK, I can't figure out how to get this installed. I've got an expansion hub with a second relay box and salinity expansion. I've set the power control expansion to a unique ID and connected to the expansion hub. There is power to the power control expansion.

The power control expansion does not show up as a new box on the head unit, but does show up on the portal. However, it does not respond to the portal. It is always off.

Any ideas.

Re: Power Control Expansion

Posted: Fri Jun 29, 2018 4:36 pm
by ucez
Correction. It does not show up on the portal, forgot that I unplugged the wireless.

When I first installed the power control expansion, it did show up, but was always ON. I thought maybe it was the ID, so I changed, but now stays OFF even when I go back to the original ID.

Re: Power Control Expansion

Posted: Fri Jun 29, 2018 8:44 pm
by rimai
Did you set the power control as id 2?
Your expansion relay box is 1 and the power control should be 2.
Just to confirm, run the i2cscanner code. I'm on my cell, but if you search, you will find.

Re: Power Control Expansion

Posted: Sat Jun 30, 2018 9:27 am
by ucez
Set PCE to ID 2. It doesn't seem to be recognizing it at all - nothing on the head unit menu.

Here is I2CScanner.

Code: Select all

ΓΏ
I2CScanner ready!
starting scanning of I2C bus from 1 to 128...
addr: 1       	addr: 2       	addr: 3       	addr: 4       
addr: 5       	addr: 6       	addr: 7       	addr: 8       
addr: 9       	addr: A       	addr: B       	addr: C       
addr: D       	addr: E       	addr: F       	addr: 10       
addr: 11       	addr: 12       	addr: 13       	addr: 14       
addr: 15       	addr: 16       	addr: 17       	addr: 18       
addr: 19       	addr: 1A       	addr: 1B       	addr: 1C       
addr: 1D       	addr: 1E       	addr: 1F       	addr: 20 found!
addr: 21       	addr: 22       	addr: 23       	addr: 24       
addr: 25       	addr: 26       	addr: 27       	addr: 28       
addr: 29       	addr: 2A       	addr: 2B       	addr: 2C       
addr: 2D       	addr: 2E       	addr: 2F       	addr: 30       
addr: 31       	addr: 32       	addr: 33       	addr: 34       
addr: 35       	addr: 36       	addr: 37       	addr: 38 found!
addr: 39       	addr: 3A       	addr: 3B       	addr: 3C found!
addr: 3D       	addr: 3E       	addr: 3F       	addr: 40       
addr: 41       	addr: 42       	addr: 43       	addr: 44       
addr: 45       	addr: 46       	addr: 47       	addr: 48       
addr: 49       	addr: 4A       	addr: 4B       	addr: 4C       
addr: 4D found!	addr: 4E       	addr: 4F       	addr: 50 found!
addr: 51       	addr: 52       	addr: 53       	addr: 54 found!
addr: 55       	addr: 56       	addr: 57       	addr: 58       
addr: 59       	addr: 5A       	addr: 5B       	addr: 5C       
addr: 5D       	addr: 5E       	addr: 5F       	addr: 60       
addr: 61       	addr: 62       	addr: 63       	addr: 64       
addr: 65       	addr: 66       	addr: 67       	addr: 68 found!
addr: 69       	addr: 6A       	addr: 6B       	addr: 6C       
addr: 6D       	addr: 6E       	addr: 6F       	addr: 70       
addr: 71       	addr: 72       	addr: 73       	addr: 74       
addr: 75       	addr: 76       	addr: 77       	addr: 78       
addr: 79       	addr: 7A       	addr: 7B       	addr: 7C       
addr: 7D       	addr: 7E       	addr: 7F       	addr: 80 

Re: Power Control Expansion

Posted: Sat Jun 30, 2018 9:41 am
by rimai
That is box5. 38 is box1 and 3c is box 5

Re: Power Control Expansion

Posted: Sat Jun 30, 2018 9:51 am
by ucez
Here is a pic of the switches, isn't this 2?

Image

Re: Power Control Expansion

Posted: Sun Jul 01, 2018 10:23 pm
by rimai
You will need to try a different combination to find out.
It looks correct.

Re: Power Control Expansion

Posted: Mon Jul 02, 2018 4:06 am
by ucez
Not sure I follow. Should I keep trying switch combinations until it registers as Box2? Which number is Box2?

Re: Power Control Expansion

Posted: Mon Jul 02, 2018 10:35 am
by rimai
Yeah. Box2 is 0x39

Re: Power Control Expansion

Posted: Wed Jul 04, 2018 6:44 am
by ucez
Found it, at least I think so. Still not working, doesn't show up on head unit...

Code: Select all

I2CScanner ready!
starting scanning of I2C bus from 1 to 128...
addr: 1       	addr: 2       	addr: 3       	addr: 4       
addr: 5       	addr: 6       	addr: 7       	addr: 8       
addr: 9       	addr: A       	addr: B       	addr: C       
addr: D       	addr: E       	addr: F       	addr: 10       
addr: 11       	addr: 12       	addr: 13       	addr: 14       
addr: 15       	addr: 16       	addr: 17       	addr: 18       
addr: 19       	addr: 1A       	addr: 1B       	addr: 1C       
addr: 1D       	addr: 1E       	addr: 1F       	addr: 20 found!
addr: 21       	addr: 22       	addr: 23       	addr: 24       
addr: 25       	addr: 26       	addr: 27       	addr: 28       
addr: 29       	addr: 2A       	addr: 2B       	addr: 2C       
addr: 2D       	addr: 2E       	addr: 2F       	addr: 30       
addr: 31       	addr: 32       	addr: 33       	addr: 34       
addr: 35       	addr: 36       	addr: 37       	addr: 38 found!
addr: 39 found!	addr: 3A       	addr: 3B       	addr: 3C       
addr: 3D       	addr: 3E       	addr: 3F       	addr: 40       
addr: 41       	addr: 42       	addr: 43       	addr: 44       
addr: 45       	addr: 46       	addr: 47       	addr: 48       
addr: 49       	addr: 4A       	addr: 4B       	addr: 4C       
addr: 4D found!	addr: 4E       	addr: 4F       	addr: 50 found!
addr: 51       	addr: 52       	addr: 53       	addr: 54 found!
addr: 55       	addr: 56       	addr: 57       	addr: 58       
addr: 59       	addr: 5A       	addr: 5B       	addr: 5C       
addr: 5D       	addr: 5E       	addr: 5F       	addr: 60       
addr: 61       	addr: 62       	addr: 63       	addr: 64       
addr: 65       	addr: 66       	addr: 67       	addr: 68 found!
addr: 69       	addr: 6A       	addr: 6B       	addr: 6C       
addr: 6D       	addr: 6E       	addr: 6F       	addr: 70       
addr: 71       	addr: 72       	addr: 73       	addr: 74       
addr: 75       	addr: 76       	addr: 77       	addr: 78       
addr: 79       	addr: 7A       	addr: 7B       	addr: 7C       
addr: 7D       	addr: 7E       	addr: 7F       	addr: 80 

Re: Power Control Expansion

Posted: Wed Jul 04, 2018 10:56 am
by rimai
Can I see the code?

Re: Power Control Expansion

Posted: Wed Jul 04, 2018 4:51 pm
by ucez
Here you go.

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

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

// Define Relay Ports by Name
#define Return_Pump     1
#define Extra1          2
#define Skimmer         3
#define Heater          4
#define Fuge_Light      5
#define GFO_Pump        6
#define SaltMixPump     7
#define PowerCtlExp     8



//Define Relay 1 Ports by Name
#define FragHeater      Box1_Port1
#define FragPowerhead   Box1_Port2
#define FragLED1        Box1_Port3
#define WaterChange     Box1_Port4
#define FragLED2        Box1_Port5
#define FragFilter      Box1_Port6
#define BrutePump       Box1_Port7
#define SaltUV          Box1_Port8

//Define Power Control Expansion Ports by Name


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


void setup()
{
  // This must be the first line
  ReefAngel.Init();  //Initialize controller
  ReefAngel.Use2014Screen();  // Let's use 2014 Screen 
  ReefAngel.AddSalinityExpansion();  // Salinity Expansion Module
  // Ports toggled in Feeding Mode
  ReefAngel.FeedingModePorts = Port1Bit | Port3Bit;
  // Ports toggled in Water Change Mode
  ReefAngel.WaterChangePorts = Port1Bit | Port3Bit;
  // Ports toggled when Lights On / Off menu entry selected
  ReefAngel.LightsOnPorts = 0;
  // Ports turned off when Overheat temperature exceeded
  ReefAngel.OverheatShutoffPorts = Port4Bit;
  // Use T1 probe as temperature and overheat functions
  ReefAngel.TempProbe = T1_PROBE;
  ReefAngel.OverheatProbe = T1_PROBE;
  // Set the Overheat temperature setting
  InternalMemory.OverheatTemp_write( 869 );


  // Ports that are always on
  ReefAngel.Relay.On( Return_Pump );
  ReefAngel.Relay.On( FragPowerhead);
  ReefAngel.Relay.On( WaterChange);
  ReefAngel.Relay.On( BrutePump);
  ReefAngel.Relay.On( FragFilter);
  ReefAngel.Relay.On( GFO_Pump);
  ReefAngel.Relay.On( SaltMixPump);
  ReefAngel.Relay.On( Extra1);
  ReefAngel.Relay.On( PowerCtlExp);
  ReefAngel.Relay.On( SaltUV);
  ////// Place additional initialization code below here


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

void loop()
{
  ReefAngel.Relay.DelayedOn( Skimmer,10 );
  ReefAngel.StandardHeater( Heater,750,790 );
  ReefAngel.StandardLights( Fuge_Light,21,0,11,0 );
  ReefAngel.StandardLights( FragLED1,12,0,21,0);
  ReefAngel.StandardLights( FragLED2,15,0,18,0);

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

  //if Display Water Level Sensor Active, then turn off Return pump
  if (!ReefAngel.HighATO.IsActive()) ReefAngel.Relay.Off(Return_Pump);
  else ReefAngel.Relay.On(Return_Pump);
 
  //If Skimmate Water Level Sensor Active, then turn of Skimmer pump
  if (!ReefAngel.LowATO.IsActive()) ReefAngel.Relay.Off(Skimmer);
  else ReefAngel.Relay.On(Skimmer);

  //frag tank heater control with T2 probe
  if (ReefAngel.Params.Temp[T2_PROBE]>790) ReefAngel.Relay.Off( FragHeater );
  if (ReefAngel.Params.Temp[T2_PROBE]<750) ReefAngel.Relay.On( FragHeater );
  
  //Enter feeding mode to correspond with automatic feeder at 11AM and 2PM
  if(hour()==11 && minute()==0 && second()==0) ReefAngel.FeedingModeStart();
  if(hour()==14 && minute()==0 && second()==0) ReefAngel.FeedingModeStart();

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

  // This should always be the last line
  ReefAngel.Portal( "XXXXXXXXXXX" );
  ReefAngel.DDNS( "Reef" ); // Your DDNS is XXXXXXXXXXXXX
  ReefAngel.ShowInterface();
}




Re: Power Control Expansion

Posted: Wed Jul 04, 2018 7:10 pm
by rimai
You don't have any box2 port in the code.

Re: Power Control Expansion

Posted: Thu Jul 05, 2018 5:16 pm
by ucez
I added a test line, but still not working. What am I missing? Still not showing up in head unit either.
#define Dose1 Box2_Port1
ReefAngel.Relay.On( Dose1);

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

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

// Define Relay Ports by Name
#define Return_Pump     1
#define Extra1          2
#define Skimmer         3
#define Heater          4
#define Fuge_Light      5
#define GFO_Pump        6
#define SaltMixPump     7
#define PowerCtlExp     8



//Define Relay 1 Ports by Name
#define FragHeater      Box1_Port1
#define FragPowerhead   Box1_Port2
#define FragLED1        Box1_Port3
#define WaterChange     Box1_Port4
#define FragLED2        Box1_Port5
#define FragFilter      Box1_Port6
#define BrutePump       Box1_Port7
#define SaltUV          Box1_Port8

//Define Power Control Expansion Ports by Name
#define Dose1           Box2_Port1
#define Dose2           Box2_Port2
#define Dose3           Box2_Port3
#define Dose4           Box2_Port4

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


void setup()
{
  // This must be the first line
  ReefAngel.Init();  //Initialize controller
  ReefAngel.Use2014Screen();  // Let's use 2014 Screen 
  ReefAngel.AddSalinityExpansion();  // Salinity Expansion Module
  // Ports toggled in Feeding Mode
  ReefAngel.FeedingModePorts = Port1Bit | Port3Bit;
  // Ports toggled in Water Change Mode
  ReefAngel.WaterChangePorts = Port1Bit | Port3Bit;
  // Ports toggled when Lights On / Off menu entry selected
  ReefAngel.LightsOnPorts = 0;
  // Ports turned off when Overheat temperature exceeded
  ReefAngel.OverheatShutoffPorts = Port4Bit;
  // Use T1 probe as temperature and overheat functions
  ReefAngel.TempProbe = T1_PROBE;
  ReefAngel.OverheatProbe = T1_PROBE;
  // Set the Overheat temperature setting
  InternalMemory.OverheatTemp_write( 869 );


  // Ports that are always on
  ReefAngel.Relay.On( Return_Pump );
  ReefAngel.Relay.On( FragPowerhead);
  ReefAngel.Relay.On( WaterChange);
  ReefAngel.Relay.On( BrutePump);
  ReefAngel.Relay.On( FragFilter);
  ReefAngel.Relay.On( GFO_Pump);
  ReefAngel.Relay.On( SaltMixPump);
  ReefAngel.Relay.On( Extra1);
  ReefAngel.Relay.On( PowerCtlExp);
  ReefAngel.Relay.On( SaltUV);
  ReefAngel.Relay.On( Dose1);
  ////// Place additional initialization code below here


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

void loop()
{
  ReefAngel.Relay.DelayedOn( Skimmer,10 );
  ReefAngel.StandardHeater( Heater,750,790 );
  ReefAngel.StandardLights( Fuge_Light,21,0,11,0 );
  ReefAngel.StandardLights( FragLED1,12,0,21,0);
  ReefAngel.StandardLights( FragLED2,15,0,18,0);

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

  //if Display Water Level Sensor Active, then turn off Return pump
  if (!ReefAngel.HighATO.IsActive()) ReefAngel.Relay.Off(Return_Pump);
  else ReefAngel.Relay.On(Return_Pump);
 
  //If Skimmate Water Level Sensor Active, then turn of Skimmer pump
  if (!ReefAngel.LowATO.IsActive()) ReefAngel.Relay.Off(Skimmer);
  else ReefAngel.Relay.On(Skimmer);

  //frag tank heater control with T2 probe
  if (ReefAngel.Params.Temp[T2_PROBE]>790) ReefAngel.Relay.Off( FragHeater );
  if (ReefAngel.Params.Temp[T2_PROBE]<750) ReefAngel.Relay.On( FragHeater );
  
  //Enter feeding mode to correspond with automatic feeder at 11AM and 2PM
  if(hour()==11 && minute()==0 && second()==0) ReefAngel.FeedingModeStart();
  if(hour()==14 && minute()==0 && second()==0) ReefAngel.FeedingModeStart();

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

  // This should always be the last line
  ReefAngel.Portal( "" );
  ReefAngel.DDNS( "Reef" ); // Your DDNS is .myreefangel.com
  ReefAngel.ShowInterface();
}




Re: Power Control Expansion

Posted: Thu Jul 05, 2018 5:54 pm
by rimai
When I load this code, I get the 3 relay screens on the head unit.
One thing I noticed is the DDNS line. Remove that. The server is not working with that feature anymore and that may be why the portal is not accepting your requests.

Re: Power Control Expansion

Posted: Mon Jul 09, 2018 4:14 am
by ucez
Success! Thank you!

Re: Power Control Expansion

Posted: Mon Jul 09, 2018 4:43 am
by binder
here's an alternate way to do the dynamic dns for your controller.

https://r.tapatalk.com/shareLink?url=ht ... are_type=t

Sent from my XT1585 using Tapatalk

Re: Power Control Expansion

Posted: Mon Jul 09, 2018 5:26 pm
by ucez
The dynamic DNS allows you to control via the universal app? However, the data on the universal app is still correct?

Re: Power Control Expansion

Posted: Mon Jul 09, 2018 6:41 pm
by binder
ucez wrote:The dynamic DNS allows you to control via the universal app? However, the data on the universal app is still correct?
Yes it should be.
I'm not sure you will need to use the dynamic dns with the universal app. I was sharing it in case you needed it (since you had been using the reefangel dynamic dns).