need help to control wp 40, first time setup

Do you have a question on how to do something.
Ask in here.
Post Reply
ReefDevil
Posts: 61
Joined: Fri Apr 12, 2013 12:33 pm

need help to control wp 40, first time setup

Post by ReefDevil »

been trying this
http://forum.reefangel.com/viewtopic.php?f=14&t=2895

it wont let me upload the code ....trying to just paste it where it says, at the bottom for the first part and inbetween the add your code below/above area have tried all the modes, cant get it to save one of them

is the the right place to start?
i have been looking at this mp40 since monday and cant get it to turn on at all
rimai
Posts: 12857
Joined: Fri Mar 18, 2011 6:47 pm

Re: need help to control wp 40, first time setup

Post by rimai »

Can you post your code?
Roberto.
ReefDevil
Posts: 61
Joined: Fri Apr 12, 2013 12:33 pm

Re: need help to control wp 40, first time setup

Post by ReefDevil »

#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 | Port6Bit;
// Ports toggled in Water Change Mode
ReefAngel.WaterChangePorts = Port1Bit | Port3Bit | Port5Bit | Port6Bit;
// Ports toggled when Lights On / Off menu entry selected
ReefAngel.LightsOnPorts = 0;
// Ports turned off when Overheat temperature exceeded
ReefAngel.OverheatShutoffPorts = Port1Bit | Port8Bit;
// Use T1 probe as temperature and overheat functions
ReefAngel.TempProbe = T1_PROBE;
ReefAngel.OverheatProbe = T1_PROBE;
// Set the Overheat temperature setting
InternalMemory.OverheatTemp_write( 835 );

// Setup ATO Port for AI communication
ReefAngel.AI.SetPort( highATOPin );


// Ports that are always on
ReefAngel.Relay.On( Port2 );
ReefAngel.Relay.On( Port3 );
ReefAngel.Relay.On( Port7 );
ReefAngel.Relay.On( Port8 );

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


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

void loop()
{
ReefAngel.StandardHeater( Port1,751,762 );
ReefAngel.StandardLights( Port4,16,0,22,0 );
ReefAngel.WavemakerRandom( Port5,60,124 );
ReefAngel.WavemakerRandom( Port6,70,148 );
ReefAngel.AI.SetChannel( White, PWMSlope(14,0,23,0,15,100,60,15) );
ReefAngel.AI.SetChannel( Blue, PWMSlope(13,0,23,0,31,100,60,31) );
ReefAngel.AI.SetChannel( RoyalBlue, PWMParabola(13,0,23,0,37,100,37) );
////// Place your custom code below here
byte ReefCrestMode(byte WaveSpeed, byte WaveOffset, boolean PulseSync)
{
static unsigned long lastwavemillis=millis();
static int newspeed=WaveSpeed;
if ((millis()-lastwavemillis) > 5000)
{
if (random(100)<50) newspeed--; else newspeed++;
newspeed=constrain(newspeed,WaveSpeed-WaveOffset,WaveSpeed+WaveOffset);
newspeed=constrain(newspeed,0,100);
lastwavemillis=millis();
}
if (PulseSync)
return newspeed;
else
return WaveSpeed-(newspeed-WaveSpeed);
}


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

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

void DrawCustomMain()
{
int x,y;
char text[10];
// Aqua Illumination
x = 10;
y = 20;
ReefAngel.LCD.DrawText( COLOR_DODGERBLUE,DefaultBGColor,x,y,"WH:" );
ReefAngel.LCD.DrawText( COLOR_DODGERBLUE,DefaultBGColor,x+38,y,"BL:" );
ReefAngel.LCD.DrawText( COLOR_DODGERBLUE,DefaultBGColor,x+76,y,"RB:" );
for ( int a=0;a<3;a++ )
{
ReefAngel.LCD.DrawText( COLOR_DODGERBLUE,DefaultBGColor,x+18,y,ReefAngel.AI.GetChannel(a) );
x += 38;
}
pingSerial();

// Parameters
#if defined DisplayLEDPWM && ! defined RemoveAllLights
ReefAngel.LCD.DrawMonitor( 15, 48, ReefAngel.Params,
ReefAngel.PWM.GetDaylightValue(), ReefAngel.PWM.GetActinicValue() );
#else // defined DisplayLEDPWM && ! defined RemoveAllLights
ReefAngel.LCD.DrawMonitor( 15, 48, 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, 94, TempRelay );
pingSerial();

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

void DrawCustomGraph()
{
}
ReefDevil
Posts: 61
Joined: Fri Apr 12, 2013 12:33 pm

Re: need help to control wp 40, first time setup

Post by ReefDevil »

error says " a function definition is not allowed here before'{'
ReefDevil
Posts: 61
Joined: Fri Apr 12, 2013 12:33 pm

Re: need help to control wp 40, first time setup

Post by ReefDevil »

if i plug the jebo cable into the ai sol port it does turn on so i know the pump works, just cant get any waves
if that helps you any
rimai
Posts: 12857
Joined: Fri Mar 18, 2011 6:47 pm

Re: need help to control wp 40, first time setup

Post by rimai »

You are entering the wrong thing.
This is what you need to paste, just like in the post:

Code: Select all

    ////// Place your custom code below here
    
    ReefAngel.PWM.SetDaylight( ReefCrestMode(60,20,true) ); // ReefCrest at 60% +/- 20% on sync mode
    ReefAngel.PWM.SetActinic( ReefCrestMode(60,20,false) ); // ReefCrest at 60% +/- 20% on anti-sync mode

    ////// Place your custom code above here
Roberto.
ReefDevil
Posts: 61
Joined: Fri Apr 12, 2013 12:33 pm

Re: need help to control wp 40, first time setup

Post by ReefDevil »

#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 | Port6Bit;
// Ports toggled in Water Change Mode
ReefAngel.WaterChangePorts = Port1Bit | Port3Bit | Port5Bit | Port6Bit;
// Ports toggled when Lights On / Off menu entry selected
ReefAngel.LightsOnPorts = 0;
// Ports turned off when Overheat temperature exceeded
ReefAngel.OverheatShutoffPorts = Port1Bit | Port8Bit;
// Use T1 probe as temperature and overheat functions
ReefAngel.TempProbe = T1_PROBE;
ReefAngel.OverheatProbe = T1_PROBE;
// Set the Overheat temperature setting
InternalMemory.OverheatTemp_write( 835 );

// Setup ATO Port for AI communication
ReefAngel.AI.SetPort( highATOPin );


// Ports that are always on
ReefAngel.Relay.On( Port2 );
ReefAngel.Relay.On( Port3 );
ReefAngel.Relay.On( Port7 );
ReefAngel.Relay.On( Port8 );

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


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

void loop()
{
ReefAngel.StandardHeater( Port1,751,762 );
ReefAngel.StandardLights( Port4,16,0,22,0 );
ReefAngel.WavemakerRandom( Port5,60,124 );
ReefAngel.WavemakerRandom( Port6,70,148 );
ReefAngel.AI.SetChannel( White, PWMSlope(14,0,23,0,15,100,60,15) );
ReefAngel.AI.SetChannel( Blue, PWMSlope(13,0,23,0,31,100,60,31) );
ReefAngel.AI.SetChannel( RoyalBlue, PWMParabola(13,0,23,0,37,100,37) );
////// Place your custom code below here
ReefAngel.PWM.SetDaylight( ReefCrestMode(60,20,true) ); // ReefCrest at 60% +/- 20% on sync mode
ReefAngel.PWM.SetActinic( ReefCrestMode(60,20,false) ); // ReefCrest at 60% +/- 20% on anti-sync mode

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

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

void DrawCustomMain()
{
int x,y;
char text[10];
// Aqua Illumination
x = 10;
y = 20;
ReefAngel.LCD.DrawText( COLOR_DODGERBLUE,DefaultBGColor,x,y,"WH:" );
ReefAngel.LCD.DrawText( COLOR_DODGERBLUE,DefaultBGColor,x+38,y,"BL:" );
ReefAngel.LCD.DrawText( COLOR_DODGERBLUE,DefaultBGColor,x+76,y,"RB:" );
for ( int a=0;a<3;a++ )
{
ReefAngel.LCD.DrawText( COLOR_DODGERBLUE,DefaultBGColor,x+18,y,ReefAngel.AI.GetChannel(a) );
x += 38;
}
pingSerial();

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

ok changing it to this lets me save but it doesnt make any waves and pump is off




// Main Relay Box
byte TempRelay = ReefAngel.Relay.RelayData;
TempRelay &= ReefAngel.Relay.RelayMaskOff;
TempRelay |= ReefAngel.Relay.RelayMaskOn;
ReefAngel.LCD.DrawOutletBox( 12, 94, TempRelay );
pingSerial();

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

void DrawCustomGraph()
{
}
ReefDevil
Posts: 61
Joined: Fri Apr 12, 2013 12:33 pm

Re: need help to control wp 40, first time setup

Post by ReefDevil »

it doesnt work, it will save the code but the pump doesnt turn on or off...i have the little white wire plugged into the left most (farthest from center) of the 2 outlets
ReefDevil
Posts: 61
Joined: Fri Apr 12, 2013 12:33 pm

Re: need help to control wp 40, first time setup

Post by ReefDevil »

it will save the code as you have above but the pump doesnt even turn on....if i plug it in to the other slot for the ai sol it turns on but constant speed
ReefDevil
Posts: 61
Joined: Fri Apr 12, 2013 12:33 pm

Re: need help to control wp 40, first time setup

Post by ReefDevil »

do i have to go on the portal and turn it on or something like that? im totally new to the wp 40 but managed to get the new router and wifi and portal up tonight....Im gonna get some sleep and look at this with fresh eyes tomorrow night
if its really just the 2 lines of code between the 2 lines for put the code here, im at a loss.

do you have to do anything to the iphone or portal settings to make it work?
rimai
Posts: 12857
Joined: Fri Mar 18, 2011 6:47 pm

Re: need help to control wp 40, first time setup

Post by rimai »

No, just plug the cable into the relay box dimming ports and make sure you also use the power supply provided with the pump.
Roberto.
ReefDevil
Posts: 61
Joined: Fri Apr 12, 2013 12:33 pm

Re: need help to control wp 40, first time setup

Post by ReefDevil »

the pmw bars on my portal are moving before they were blank,,, but the pump is a paperweight doesnt turn at all
ReefDevil
Posts: 61
Joined: Fri Apr 12, 2013 12:33 pm

Re: need help to control wp 40, first time setup

Post by ReefDevil »

its only one white connector to the ra, the black cable to the black cable and the power cord right
thats what i have hooked up
ReefDevil
Posts: 61
Joined: Fri Apr 12, 2013 12:33 pm

Re: need help to control wp 40, first time setup

Post by ReefDevil »

if the pwm bars are moving I dont see how its not sending the signal to the pump to turn on and speed up or slow down
rimai
Posts: 12857
Joined: Fri Mar 18, 2011 6:47 pm

Re: need help to control wp 40, first time setup

Post by rimai »

Yes, but you plugged them into the dimming ports on the side of the relay box, right?
Roberto.
ReefDevil
Posts: 61
Joined: Fri Apr 12, 2013 12:33 pm

Re: need help to control wp 40, first time setup

Post by ReefDevil »

im plugging in the white cable to the top of the ra itself...i dont have a relay box unless it came with it...
its like right next to the ph probe
ReefDevil
Posts: 61
Joined: Fri Apr 12, 2013 12:33 pm

Re: need help to control wp 40, first time setup

Post by ReefDevil »

pluggin in on the other side of the ph probe from where the temp probes plug in ... there are 2 places with 2 pin taps on each one.
rimai
Posts: 12857
Joined: Fri Mar 18, 2011 6:47 pm

Re: need help to control wp 40, first time setup

Post by rimai »

Huh?
The relay box is the one you plug your equipment into.
The ports you are plugging are the ATO ports.
Roberto.
ReefDevil
Posts: 61
Joined: Fri Apr 12, 2013 12:33 pm

Re: need help to control wp 40, first time setup

Post by ReefDevil »

Bingo...Holly cow!!! my tank is ALIVE.. Im just a little slow on the computer....i can keep corals really well. lol



.. once again many thanks..... UR the BEST!!
Post Reply