Page 1 of 1

Memory Error

Posted: Thu Nov 26, 2020 6:55 pm
by hous0067
Hi Guys,

RA Plus running the same code since July without issue until yesterday when I randomly noticed the heater was on when it shouldn't be (i.e. heater off temp < T3). I tried rebooting it, checking the memory settings, and even re-uploaded the code but it's ignoring the uploaded settings and continuing to act strange.

When I say ignoring, I changed the set points for the heater through the wizard but when I look at heater on and heater off temps through the android app it still has the old numbers. That in and of itself isn't a problem for me, but it's ignoring those temps, the relay stays on unless I change the setting through the app for the heater on and off to like 3...instead of 730 and 740 (i.e. 73.0 and 74.0 F)

Any ideas? Is the memory in the unit just cooked?

The code that was stable and running is below. Using the 1.1.3 Mac .dmg.

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


////// 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 | Port7Bit | Port8Bit;
    // Ports toggled in Water Change Mode
    ReefAngel.WaterChangePorts = Port1Bit | Port3Bit | Port7Bit | Port8Bit;
    // Ports toggled when Lights On / Off menu entry selected
    ReefAngel.LightsOnPorts = Port5Bit | Port6Bit;
    // Ports turned off when Overheat temperature exceeded
    ReefAngel.OverheatShutoffPorts = Port1Bit | Port5Bit | Port6Bit;
    // Use T3 probe as temperature and overheat functions
    ReefAngel.TempProbe = T3_PROBE;
    ReefAngel.OverheatProbe = T3_PROBE;

    // Feeding and Water Change mode speed
    ReefAngel.DCPump.FeedingSpeed=0;
    ReefAngel.DCPump.WaterChangeSpeed=0;


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

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

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

void loop()
{
    ReefAngel.StandardHeater( Port1 );
    ReefAngel.StandardFan( Port3 );
    ReefAngel.ActinicLights( Port5 );
    ReefAngel.DayLights( Port6 );
    ReefAngel.Relay.DelayedOn( Port8 );
    ReefAngel.PWM.DaylightPWMParabola();
    ReefAngel.DCPump.UseMemory = true;
    ReefAngel.DCPump.DaylightChannel = None;
    ReefAngel.DCPump.ActinicChannel = Sync;
    ReefAngel.DCPump.LowATOChannel = None;
    ReefAngel.DCPump.HighATOChannel = AntiSync;
    ////// Place your custom code below here
    
   
  // WP40 Night Mode
    // go to mode defined by RF memory locations
    if (hour()<InternalMemory.StdLightsOnHour_read() || hour()>InternalMemory.StdLightsOffHour_read())
    {
      ReefAngel.DCPump.UseMemory=false;
      ReefAngel.DCPump.Duration=InternalMemory.RFDuration_read();
      ReefAngel.DCPump.Mode=InternalMemory.RFMode_read();
      ReefAngel.DCPump.Speed=InternalMemory.RFSpeed_read();
    }
      else (ReefAngel.DCPump.UseMemory=true); 
    
      //ato moonlight control
    pinMode(lowATOPin,OUTPUT); 
    analogWrite(lowATOPin, 2.55*MoonPhase());   


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

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


Re: Memory Error

Posted: Thu Nov 26, 2020 11:26 pm
by rimai
That is indeed odd.
If you change using app and then read it back, does it show the number you have saved prior to reading?
What about after rebooting, does it still show the number you saved?

Re: Memory Error

Posted: Fri Nov 27, 2020 8:41 am
by hous0067
Yeah, I can overwrite the values with the app. The numbers I write are the same ones it reads back. But, they aren't getting used or aren't getting used right. I have heater on temp at 730, heater off temp at 740, T3 is 76.4 and the heater port is on. I'm just relying on the heater's thermostat for now.

Yes, values I write from the app last through hard and soft boots.

Re: Memory Error

Posted: Fri Nov 27, 2020 8:46 am
by rimai
Sorry for the confusion....
The master branch has a bug that was fixed on the dev branch.
StandardHeater is always using T1 on the libraries you are using.
Change your code from:

Code: Select all

    ReefAngel.StandardHeater( Port1 );
To this:

Code: Select all

    ReefAngel.StandardHeater3( Port1 );
This will force it to use T3 and ignore the ReefAngel.TempProbe = T3_PROBE;

Re: Memory Error

Posted: Fri Nov 27, 2020 11:18 am
by hous0067
Compiler says, "no matching function" when I change that.

Re: Memory Error

Posted: Fri Nov 27, 2020 3:58 pm
by rimai
Ohh.... That function is also not in the master branch...
Try this:

Code: Select all

ReefAngel.StandardHeater(T3_PROBE, Port1 ,InternalMemory.HeaterTempOn_read(), InternalMemory.HeaterTempOff_read());