Avast ATO and RA+

Post Reply
Squishie89
Posts: 30
Joined: Wed Nov 21, 2012 1:46 pm

Avast ATO and RA+

Post by Squishie89 »

I upgraded my head unit to the RA+ and it was either then or shortly after my avast ato stopped working. Is there anything in the new libraries that could be doing this or did my ato just die for some reason? (Pump still works, but nothing will make the trigger unit trigger).
rimai
Posts: 12881
Joined: Fri Mar 18, 2011 6:47 pm

Re: Avast ATO and RA+

Post by rimai »

Isn't Avast ATO a standalone?
Or you have their controllable with the adapter cable?
Roberto.
Squishie89
Posts: 30
Joined: Wed Nov 21, 2012 1:46 pm

Re: Avast ATO and RA+

Post by Squishie89 »

Controllable with the adapter cable.
rimai
Posts: 12881
Joined: Fri Mar 18, 2011 6:47 pm

Re: Avast ATO and RA+

Post by rimai »

Test the ATO port with the controllertest code
Roberto.
Squishie89
Posts: 30
Joined: Wed Nov 21, 2012 1:46 pm

Re: Avast ATO and RA+

Post by Squishie89 »

I have no idea how to do that, sorry =X Can you explain or point me towards a thread?
rimai
Posts: 12881
Joined: Fri Mar 18, 2011 6:47 pm

Re: Avast ATO and RA+

Post by rimai »

File->Sketchbook->Example Codes->ControllerTester
Upload and test the ports.
Roberto.
Squishie89
Posts: 30
Joined: Wed Nov 21, 2012 1:46 pm

Re: Avast ATO and RA+

Post by Squishie89 »

So I uploaded the code. ATO showed high and low as OPEN. I pulled the ATO probe thing out of the water and it still showed as open. So I am thinking I need to buy a new ATO.
rimai
Posts: 12881
Joined: Fri Mar 18, 2011 6:47 pm

Re: Avast ATO and RA+

Post by rimai »

Just to confirm, before you go buying anything...
Can you unplug the avast ato connector from RA and use a regular float switch?
Roberto.
Squishie89
Posts: 30
Joined: Wed Nov 21, 2012 1:46 pm

Re: Avast ATO and RA+

Post by Squishie89 »

I assume you were concerned it might be the head unit? I got out my original float switches and plugged them in and it all worked fine. So it seems it is something with the Avast unit or plug.
Squishie89
Posts: 30
Joined: Wed Nov 21, 2012 1:46 pm

Re: Avast ATO and RA+

Post by Squishie89 »

I got my new ATO switch from AVAST. However I still cannot get it to trigger! Here is a copy of my code, please let me know if you see anything wrong here. I am going to run another controller test to double check things. (I am not too great with the coding yet so something might be wrong that I never noticed)

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


    // Ports that are always on
    ReefAngel.Relay.On( Port3 );
    ReefAngel.Relay.On( Port8 );
    ReefAngel.Relay.On( Port5 );
    ReefAngel.Relay.On( Port6 );

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

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

void loop()
{
    ReefAngel.StandardLights( Port1,13,30,22,30 ); //set for actinic
    ReefAngel.SingleATO( false,Port2,900,0 ); //15 min time out
    ReefAngel.StandardLights( Port4,14,0,22,0 ); //set for white light
    //removed wavemaker functions because I don't want them turning off
    ReefAngel.StandardHeater( Port7,775,780 );
    ReefAngel.PWM.SetDaylight( PWMSlope(13,30,22,0,15,100,30,15) );
    //ReefAngel.PWM.SetActinic( PWMParabola(13,0,22,30,15,100,15) );
    ////// Place your custom code below here
    // prevent auto top off from 2200 to 1200
    if (hour()>12 && hour()<22)
      ReefAngel.SingleATO( false,Port2,600,0 );
    else
      ReefAngel.Relay.Off( Port2 );
	
// Skimmer delay after feed or wc, 60 minutes

     ReefAngel.Relay.DelayedOn( Port3,60 );


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

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

void DrawCustomMain()
{
    int x,y;
    char text[10];
    // Parameters
#if defined DisplayLEDPWM && ! defined RemoveAllLights
    ReefAngel.LCD.DrawMonitor( 15, 14, ReefAngel.Params,
    ReefAngel.PWM.GetDaylightValue(), ReefAngel.PWM.GetActinicValue() );
#else // defined DisplayLEDPWM && ! defined RemoveAllLights
    ReefAngel.LCD.DrawMonitor( 15, 14, ReefAngel.Params );
#endif // defined DisplayLEDPWM && ! defined RemoveAllLights
    pingSerial();

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

    // pH Expansion
    ReefAngel.LCD.DrawText( COLOR_MEDIUMSEAGREEN,DefaultBGColor,15,75, "PHE:" );
    ReefAngel.LCD.DrawText( COLOR_MEDIUMSEAGREEN,DefaultBGColor,39,75, ReefAngel.Params.PHExp );
    pingSerial();

    // Water Level
    ReefAngel.LCD.DrawText( COLOR_DARKGOLDENROD,DefaultBGColor,75,75, "WL:" );
    ReefAngel.LCD.DrawText( COLOR_DARKGOLDENROD,DefaultBGColor,99,75, ReefAngel.WaterLevel.GetLevel() );
    pingSerial();

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

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

void DrawCustomGraph()
{
}
rimai
Posts: 12881
Joined: Fri Mar 18, 2011 6:47 pm

Re: Avast ATO and RA+

Post by rimai »

Just to confirm, your ATO is disabled from 10pm to noon, right?
What time did you perform your test?
Roberto.
Squishie89
Posts: 30
Joined: Wed Nov 21, 2012 1:46 pm

Re: Avast ATO and RA+

Post by Squishie89 »

I did FINALLY figure out how to make the ATO work. However, now I cannot get my time out to work. Here is my updated code (sorry for all the notes, and the code that is //-ed out above the ATO coding is what I had before, kept it to copy it). I am wondering if the time out needs to be in the custom code in the void loop? Not sure.

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


  // Ports that are always on
  ReefAngel.Relay.On( Port3 );
  ReefAngel.Relay.On( Port8 );
  ReefAngel.Relay.On( Port5 );
  ReefAngel.Relay.On( Port6 );

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


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

void loop()
{
  ReefAngel.StandardLights( Port1,13,30,22,30 ); //set for actinic
  ReefAngel.SingleATO( false,Port2,900,0 ); //15 min time out
  ReefAngel.StandardLights( Port4,14,0,22,0 ); //set for white light
  //removed wavemaker functions because I don't want them turning off
  ReefAngel.StandardHeater( Port7,775,780 );
  ReefAngel.PWM.SetDaylight( PWMSlope(13,30,22,0,15,100,30,15) );
  //ReefAngel.PWM.SetActinic( PWMParabola(13,0,22,30,15,100,15) );
  ////// Place your custom code below here
  
  // prevent auto top off from 2200 to 1200
  //if (hour()>12 && hour()<22)
  //ReefAngel.SingleATO( false,Port2,600,0 );
  //else
  //ReefAngel.Relay.Off( Port2 );

  if (hour()>12 && hour()<22)
  ReefAngel.SingleATOLow( Port2 );
  else
  ReefAngel.Relay.Off( Port2 );
  
  // Skimmer delay after feed or wc, 30 minutes

  ReefAngel.Relay.DelayedOn( Port3,30 );


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

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

void DrawCustomMain()
{
  int x,y;
  char text[10];
  // Parameters
#if defined DisplayLEDPWM && ! defined RemoveAllLights
  ReefAngel.LCD.DrawMonitor( 15, 14, ReefAngel.Params,
  ReefAngel.PWM.GetDaylightValue(), ReefAngel.PWM.GetActinicValue() );
#else // defined DisplayLEDPWM && ! defined RemoveAllLights
  ReefAngel.LCD.DrawMonitor( 15, 14, ReefAngel.Params );
#endif // defined DisplayLEDPWM && ! defined RemoveAllLights
  pingSerial();

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

  // pH Expansion
  ReefAngel.LCD.DrawText( COLOR_MEDIUMSEAGREEN,DefaultBGColor,15,75, "PHE:" );
  ReefAngel.LCD.DrawText( COLOR_MEDIUMSEAGREEN,DefaultBGColor,39,75, ReefAngel.Params.PHExp );
  pingSerial();

  // Water Level
  ReefAngel.LCD.DrawText( COLOR_DARKGOLDENROD,DefaultBGColor,75,75, "WL:" );
  ReefAngel.LCD.DrawText( COLOR_DARKGOLDENROD,DefaultBGColor,99,75, ReefAngel.WaterLevel.GetLevel() );
  pingSerial();

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

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

void DrawCustomGraph()
{
}

User avatar
cosmith71
Posts: 1437
Joined: Fri Mar 29, 2013 3:51 pm
Location: Oklahoma City

Re: Avast ATO and RA+

Post by cosmith71 »

Code looks ok, except for this line:

Code: Select all

    if (hour()>12 && hour()<22)
Technically, it will only run from 1 PM to 9 PM.

Run the controller test again. If you can't get it to change state, then there's an issue with the topoff unit. Since you've replaced the switch, I'd suspect the cable. Check the pins on the cable and make sure they're seated properly. If you have a voltmeter you might check continuity in the wires.

--Colin
Squishie89
Posts: 30
Joined: Wed Nov 21, 2012 1:46 pm

Re: Avast ATO and RA+

Post by Squishie89 »

cosmith71 wrote:Code looks ok, except for this line:

Code: Select all

    if (hour()>12 && hour()<22)
Technically, it will only run from 1 PM to 9 PM.

Run the controller test again. If you can't get it to change state, then there's an issue with the topoff unit. Since you've replaced the switch, I'd suspect the cable. Check the pins on the cable and make sure they're seated properly. If you have a voltmeter you might check continuity in the wires.

--Colin
That is supposed to be there. My tank is near my birds and they don't get woken up till noon/1pm and I don't want the top off pump bothering them while they are sleeping.

I will check the cable, thanks so much, Colin!
rimai
Posts: 12881
Joined: Fri Mar 18, 2011 6:47 pm

Re: Avast ATO and RA+

Post by rimai »

Make sure you have the correct settings in internal memory
Roberto.
howaboutme
Posts: 245
Joined: Tue Jan 28, 2014 11:10 am
Location: Northern VA

Re: Avast ATO and RA+

Post by howaboutme »

I have an Avast ATO. If the ATO runs then the issue regarding timeout is not the ATO, most likely code related.

My code for the Avast uses internal memory and is every simple:

Code: Select all

ReefAngel.SingleATOLow( Port1) 
I control the timeout from the portal.
Jack
User avatar
cosmith71
Posts: 1437
Joined: Fri Mar 29, 2013 3:51 pm
Location: Oklahoma City

Re: Avast ATO and RA+

Post by cosmith71 »

OK, so when I replied, I somehow missed all of page 2, and missed that you'd fixed it and moved on to another problem. :oops:

So now, it won't time out? Like Roberto said, check the internal memory setting. You can do that from the Portal.

--Colin
Squishie89
Posts: 30
Joined: Wed Nov 21, 2012 1:46 pm

Re: Avast ATO and RA+

Post by Squishie89 »

It does time out, the problem is I thought I set the time out for 15 minutes, it times out in 5 min or less
User avatar
lnevo
Posts: 5430
Joined: Fri Jul 20, 2012 9:42 am

Re: Avast ATO and RA+

Post by lnevo »

Check in the portal under internal memory settings. You have 15 minutes specified in your code but the last iteration uses memory which we cant see how yours is set.
Squishie89
Posts: 30
Joined: Wed Nov 21, 2012 1:46 pm

Re: Avast ATO and RA+

Post by Squishie89 »

I was able to get into the internal memory settings through the portal, currently trying to get it to save.

I don't understand what in my code makes it use the internal memory, I would prefer to keep everything in the code and not use the portal.
User avatar
cosmith71
Posts: 1437
Joined: Fri Mar 29, 2013 3:51 pm
Location: Oklahoma City

Re: Avast ATO and RA+

Post by cosmith71 »

Squishie89 wrote:I was able to get into the internal memory settings through the portal, currently trying to get it to save.

I don't understand what in my code makes it use the internal memory, I would prefer to keep everything in the code and not use the portal.
This line makes it use memory:

Code: Select all

  ReefAngel.SingleATOLow( Port2 );
You need to change it back to this:

Code: Select all

    ReefAngel.SingleATO( false,Port2,900,0 );
That's with a 900 second (15 minute) timeout.

--Colin
Post Reply