Heater not powering on, does Jebao take on UAPP setting?


Posts: 7
Joined: Mon Dec 23, 2013 2:55 pm
PostPosted: Wed Mar 28, 2018 11:35 am
I have some code that I have pieced together for my RA+ with help from Roberto and by scavenging from examples I found here.

I just uploaded the code last night and the heater is not turning on, I have to override from Auto to ON. The other issue is more of a question. Given the code shown below, would setting a Jebao mode on the UAPP cause the RA to use that mode? I know the code from the loop will use ReefCrest if I set the portal to Custom, but not sure what would happen if I set to another mode.

If I need to add code to be able to override the mode via the UAPP, what should I add? Thanks in advance for any help or insight.

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

// Here is the port assignment for this code:

// Port1 - ATO
// Port2 - Heater
// Port3 - Refugium
// Port4 - BRS Reactor
// Port5 - Skimmer
// Port6 - Main Return DC6000
// Port7 - Fuge Flow
// Port8 - LED Lights

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

//#define DC6000_Normal_Speed    50
//#define DC6000_Feeding_Speed   0
#define MaxpH_for_ATO          840
//#define Storm_Duration         10 // Number of minutes

unsigned long lastmaxph=now()-7200;
unsigned long lastfeed=now();
boolean feed=false;
//boolean storm=false;

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


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

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

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

//ReefAngel.CustomLabels[0] = "ATO";
//ReefAngel.CustomLabels[1] = "Heaters";
//ReefAngel.CustomLabels[2] = "FugeLt";
//ReefAngel.CustomLabels[3] = "Reactor";
//ReefAngel.CustomLabels[4] = "Skimmer";
//ReefAngel.CustomLabels[5] = "DCPump";
//ReefAngel.CustomLabels[6] = "FugeFlow";
//ReefAngel.CustomLabels[7] = "LEDs";


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

void loop()
{
 //   ReefAngel.StandardATO( Port1,60 );
    ReefAngel.StandardHeater( T1_PROBE,Port2,680,780 );
    ReefAngel.StandardLights( Port3,18,0,6,0 );
    ReefAngel.Relay.DelayedOn( Port5,10 );
    ReefAngel.Relay.DelayedOn( Port1,15 );
    ReefAngel.DCPump.UseMemory = false;
    ReefAngel.DCPump.DaylightChannel = Sync;
    ReefAngel.DCPump.ActinicChannel = AntiSync;
    ReefAngel.DCPump.Threshold = 20;



    ////// Place your custom code below here
if (ReefAngel.Params.PH>MaxpH_for_ATO) lastmaxph=now();
  if (now()-lastmaxph>7200)
    ReefAngel.Relay.On( Port1 ); // ATO normal
  else
    ReefAngel.Relay.Off( Port1 ); // ATO Off

//ReefAngel.DCPump.SetMode( Lagoon,50,0 );  // ReefCrest at 50% +/- 20%
//  if (hour()>=18 || hour()<6)
//    ReefAngel.DCPump.SetMode( Constant,25,0 );  // Constant at 30%
 
// Set timer when in feeding mode
static unsigned long feeding;
if (ReefAngel.DisplayedMenu==FEEDING_MODE) feeding=now();

if (now()-feeding<1800) {
// Continue NTM for the 30 minutes
    ReefAngel.DCPump.UseMemory=false;
    ReefAngel.DCPump.SetMode( NutrientTransport, 90,70 );  // Nutrient Transport at 90% with 700ms Pulse
} else if (hour()>=21 || hour()<7) { // 7am / 9pm
// Night mode (go to 30%)
ReefAngel.DCPump.UseMemory=false;
ReefAngel.DCPump.SetMode( Constant,35,0 );  // Constant at 35%
} else if (InternalMemory.DCPumpMode_read()==11) { // Custom Mode and nothing else going on
ReefAngel.DCPump.UseMemory=false;
ReefAngel.DCPump.SetMode( ReefCrest,70,20 );  // ReefCrest at 70% +/- 20%
} else {
ReefAngel.DCPump.UseMemory=true; // Will reset all values from memory
}


//ReefAngel.DCPump.SetMode( ReefCrest,70,20 );  // ReefCrest at 70% +/- 20%
//  if (hour()>=18 || hour()<6)
//    ReefAngel.DCPump.SetMode( Constant,35,0 );  // Constant at 35%
//  if (ReefAngel.DisplayedMenu!=FEEDING_MODE && feed==true)
//  {
//    feed=false;
//    lastfeed=now();
//  }
//  if (now()-lastfeed<1800)
//    ReefAngel.DCPump.SetMode( NutrientTransport, 90,70 );  // Nutrient Transport at 90% with 700ms Pulse

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

    ReefAngel.CloudPortal();
    // This should always be the last line
    ReefAngel.ShowInterface();
}

void CheckSwitches() {
  // Turn off protein skimmer if skimmer container is full (Low ATO)
  if (!ReefAngel.LowATO.IsActive()) { // switch on by default
           ReefAngel.Relay.Override(Port5,0);
  }
}

// RA_STRING1=null
// RA_STRING2=null
// RA_STRING3=null
// RA_LABEL LABEL_ACTINIC=WP25.2
// RA_LABEL LABEL_DAYLIGHT=WP25.1

User avatar
Posts: 2702
Joined: Fri Mar 18, 2011 6:20 pm
Location: Illinois
PostPosted: Wed Mar 28, 2018 6:31 pm
the reason for the heater not turning on is this line:
Code: Select all
ReefAngel.StandardHeater( T1_PROBE,Port2,680,780 );

this line says to turn on when the temp is at 68.0 and then shut off when it gets to 78.0. so it won't turn on until the low value is hit (aka the temp drops below 68.0).
you are allowing for a 10 degree temp drop, which is probably not what you want.
you also are using the overheat temperature line incorrectly too. you have the overheat temperature set to be 78.0. this means that when 78.0 is hit, the ports you have designated will shut off until you clear the overheat.

so, you are probably wanting your tank to be around 78.0 degrees or so. you probably also want to increase the overheat to be maybe 85.0 or maybe even 83.0 (or whatever).
the standard heater line should be something like this:
Code: Select all
 ReefAngel.StandardHeater( T1_PROBE,Port2,775,785);

this will keep the tank between 77.5 and 78.5. feel free to adapt as needed.
you will want to change the overheat temp from 780 to maybe 830.
InternalMemory.overheattemp_write(830)
(or whatever that line says specifically.... I'm on mobile device and hard to type exactly).


Sent from my XT1585 using Tapatalk

Posts: 7
Joined: Mon Dec 23, 2013 2:55 pm
PostPosted: Wed Mar 28, 2018 7:32 pm
Thanks! I had it wrong because I was thinking it would turn on at 68 or above and turn off after it got to 78. I see what you mean about the temp swing, it would be deadly to most critters. My house is A/C and we keep it at 70 all day, but you never know.

One quick question that I know you probably can answer easily. From my code, do you think it is coded properly so that if I set a mode in the UAPP it would stick? The loop is only checking for custom to set ReefCrest, but I can't point to the place where it would read from UAPP to set the mode on the pumps.

Quick edit: It is now 9:35 PM and the damn thing is still in ReefCrest mode, should have switched to night mode...

Code: Select all
if (now()-feeding<1800) {
// Continue NTM for the 30 minutes
    ReefAngel.DCPump.UseMemory=false;
    ReefAngel.DCPump.SetMode( NutrientTransport, 90,70 );  // Nutrient Transport at 90% with 700ms Pulse
} else if (hour()>=21 || hour()<7) { // 7am / 9pm
// Night mode (go to 30%)
ReefAngel.DCPump.UseMemory=false;
ReefAngel.DCPump.SetMode( Constant,35,0 );  // Constant at 35%
} else if (InternalMemory.DCPumpMode_read()==11) { // Custom Mode and nothing else going on
ReefAngel.DCPump.UseMemory=false;
ReefAngel.DCPump.SetMode( ReefCrest,70,20 );  // ReefCrest at 70% +/- 20%
} else {
ReefAngel.DCPump.UseMemory=true; // Will reset all values from memory
}


Again, working off someone else's code. Much appreciated.
User avatar
Posts: 2702
Joined: Fri Mar 18, 2011 6:20 pm
Location: Illinois
PostPosted: Thu Mar 29, 2018 7:46 pm
My first response is to just start off simple. this line will make you always use the internal memory and be able to control via the uapp.
Code: Select all
 ReefAngel.DCPump.UseMemory=true;

so remove all the other if statements and lines and just leave this line.

once you can confirm that you can control via the uapp and everything is working via internal memory, THEN we can move forward with more advanced stuff.

start off simple. get that working. add more. test. proceed.

I also want you to write down what your end/final solution we are working towards. that way we know what we want to get the controller to do.

I'm a little slow at responding at times and will do from my mobile. my schedule is very busy but we will get you going good.

Sent from my XT1585 using Tapatalk

Return to Ask anything here

Who is online

Users browsing this forum: Google [Bot] and 1 guest