Portal control of Dosing Pumps

Related to the Portal
Post Reply
Sebyte

Portal control of Dosing Pumps

Post by Sebyte »

I am trying to set up an RA Dosing pump so that I can fine tune the setting via the portal.

I can toggle the ports from the Dash Board, but am unable to change their operation through the memory setting page.

This is the code I have in my .ino file
    ReefAngel.DosingPumpRepeat1( Port7 );
    ReefAngel.DosingPumpRepeat2( Port8 );
Also the ports are always in an ON state when the RA is rebooted.

Any advice will be welcome.
rimai
Posts: 12881
Joined: Fri Mar 18, 2011 6:47 pm

Re: Portal control of Dosing Pumps

Post by rimai »

On as in overriden on?
Roberto.
Sebyte

Re: Portal control of Dosing Pumps

Post by Sebyte »

In the portal they show as "Auto" and I can turn them manually on and off via page.

When set to "Auto" the power packs plugged into ports 7 & 8 are live with the led on. The settings in memory are having no effect on changing the state of the relays.
rimai
Posts: 12881
Joined: Fri Mar 18, 2011 6:47 pm

Re: Portal control of Dosing Pumps

Post by rimai »

Can you post your entire code?
Roberto.
Sebyte

Re: Portal control of Dosing Pumps

Post by Sebyte »

Here is my .ino listing.
// ATO build Plus Dosing **********************************
// 14/10/2012


#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 = Port6Bit;
    
    // Ports toggled in Water Change Mode
    ReefAngel.WaterChangePorts = Port1Bit | Port2Bit | Port3Bit | Port4Bit | Port5Bit | Port6Bit;
    
    // Ports toggled when Lights On / Off menu entry selected
    ReefAngel.LightsOnPorts = 0;
    
    // Ports turned off when Overheat temperature exceeded
    ReefAngel.OverheatShutoffPorts = Port1Bit | Port3Bit;
    
    // 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 ); // Skimmer
    ReefAngel.Relay.On( Port6 ); // Pumps

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

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

void loop()
{
  
  // Specific functions that use Internal Memory values
  
    // ReefAngel.SingleATOLow( Port2 );
    
  ReefAngel.SingleATO(true,Port2,600,0);
    
    // true = Low ATO port
    // Port1 = port you are using for ATO pump
    // 600 = timeout in seconds
    // 1 = run only once per hour. To have it run many times per hour, just put 0.
    
    ReefAngel.StandardHeater( Port3 );
    ReefAngel.StandardFan( Port4 );
    ReefAngel.Wavemaker1( Port5 );
    ReefAngel.Wavemaker1(Port5);
    ReefAngel.DosingPumpRepeat1( Port7 );
    ReefAngel.DosingPumpRepeat2( Port8 );
   
    ////// Place your custom code below here
    
    
        
    //********************************************************************************************************************************
  // Activate Watch Dog Timer at 6am and 6pm

  if ((now()%86400)==21600) delay(1000);

  if ((now()%86400)==43200) delay(1000);

 //********************************************************************************************************************************
  // Wavemaker not available 9 pm to 10 am

  if ( (hour() >= 20) || (hour() <= 9) )
  {

    ReefAngel.Relay.Off(Port5);

  }

//********************************************************************************************************************************
  //LED SETUP

  ReefAngel.StandardLights(Port7,10,0,22,0); // Actinic LED Lights on at 10:00am and off at 10:00pm
  ReefAngel.StandardLights(Port8,12,0,21,0); // Daylight LED Lights on at 12:00pm and off at 9:00pm


  // PWMParabola(byte startHour, byte startMinute, byte endHour, byte endMinute, byte startPWM, byte endPWM, byte oldValue)
  // startHour - Hour of the start the slope
  // startMinute - Minute of the start the slope
  // endHour - Hour of the end of the slope
  // endMinute - Minute of the end slope
  // startPWM - Beginning PWM value
  // endPWM - Ending PWM value
  // oldValue - Should be the startPWM value or the existing/current PWM value (ReefAngel.PWM.GetActinicValue() or GetDaylightValue())

  ReefAngel.PWM.SetActinic(PWMParabola(10,0,22,0,0,70,0));
  // Actinic PWM % starts raising from 0% to 70% and back down to 0% from 10:00am to 10:00pm forming a parabola.
  ReefAngel.PWM.SetDaylight(PWMParabola(12,0,21,0,0,60,0));
  // Daylight PWM % starts raising from 0% to 60% and back down to 0% from 12:00pm to 9:00pm forming a parabola.

// NOTE light max values reduced due to algae increase. Blue from 100% to 80%, white from 80% to 70% - 26th September 2012

  /* NOTES----------------------------------->>>>
   
   If you get a compile error similar to this:
   'class ReefAngelClass' has no member named 'PWM'
   Please make sure that you enabled Display LED PWM on your features file.
   
   Open RAGen and make sure you have Display LED PWM checked under the Features tab.
   
   Or, you can manually edit the file.
   The file is located at "Documents\Arduino\libraries\ReefAngel_Features.h" file and has to include this line in it:
   #define DisplayLEDPWM
   
   */

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

    // This should always be the last line
    ReefAngel.Portal( "sebyte" );
    ReefAngel.ShowInterface();
}
 
// CODE ENDS //
Sebyte

Re: Portal control of Dosing Pumps

Post by Sebyte »

Sorry I think I can see where the problem is in the LED script I forgot to move the ports.
rimai
Posts: 12881
Joined: Fri Mar 18, 2011 6:47 pm

Re: Portal control of Dosing Pumps

Post by rimai »

Yeap. that's what it is :)
Roberto.
Post Reply