temp prob/heater not working right

Do you have a question on how to do something.
Ask in here.
Post Reply
jjdezek
Posts: 329
Joined: Fri May 17, 2013 1:35 pm

Re: temp prob/heater not working right

Post by jjdezek »

im not sure where your talking about the only thing I can find in my code about temp or heat was the part I posted. here is my current code that im running.

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 <ReefAngel.h>

////// Place global variable code below here
#define NUMBERS_8x16
void DrawCustomMain()
{
// the graph is drawn/updated when we exit the main menu &
// when the parameters are saved
ReefAngel.LCD.DrawDate(6, 112);
ReefAngel.LCD.DrawText(COLOR_INDIGO, COLOR_WHITE,25,5, "Jeremy's Reef");
pingSerial();

DrawStatus (20,80);
DrawParams (5,40);
DrawParamsa (0,10);
pingSerial();
byte TempRelay = ReefAngel.Relay.RelayData;
TempRelay &= ReefAngel.Relay.RelayMaskOff;
TempRelay |= ReefAngel.Relay.RelayMaskOn;
ReefAngel.LCD.DrawOutletBox(12, 93, TempRelay);
}

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

    // 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( Port5 );
    ReefAngel.Relay.On( Port6 );
    ReefAngel.Relay.On( Port8 );

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

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

void loop()
{
      ReefAngel.DosingPumpRepeat1( Port1);
    ReefAngel.DosingPumpRepeat2( Port2);
    ReefAngel.StandardATO( Port3,30 );
    ReefAngel.StandardHeater( Port7);
    ReefAngel.PWM.Channel0PWMSlope();
    ReefAngel.PWM.Channel1PWMSlope(-5,5);
    ReefAngel.PWM.Channel2PWMSlope(-10,10);
    ReefAngel.PWM.Channel3PWMSlope(-15,15);
    ReefAngel.PWM.Channel4PWMSlope(-20,20);
    ReefAngel.PWM.Channel5PWMSlope(-25,25);
    ReefAngel.DCPump.DaylightChannel = AntiSync;
    ReefAngel.DCPump.ActinicChannel = Sync;
    ReefAngel.DCPump.ExpansionChannel[0] = None;
    ReefAngel.DCPump.ExpansionChannel[1] = None;
    ReefAngel.DCPump.ExpansionChannel[2] = None;
    ReefAngel.DCPump.ExpansionChannel[3] = None;
    ReefAngel.DCPump.ExpansionChannel[4] = None;
    ReefAngel.DCPump.ExpansionChannel[5] = None;
    ////// Place your custom code below here
       if (ReefAngel.DCPump.Mode==Custom)
  {
  ReefAngel.PWM.SetDaylight( ElseMode(70,30,true ));                     // ElseMode on sync mode, 70 +/- 30%
  ReefAngel.PWM.SetActinic( ElseMode(70,30,false ));     
  }


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

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

void DrawParamsa(int x, int y){
char buf[16];
  ReefAngel.LCD.DrawText(DPColor,DefaultBGColor,x+70,y+10,"WP40L:");
ReefAngel.LCD.DrawSingleMonitor(ReefAngel.PWM.GetDaylightValue(), DPColor, x+108, y+10,1);
ReefAngel.LCD.DrawText(APColor,DefaultBGColor,x+70,y+20,"WP40R:");
ReefAngel.LCD.DrawSingleMonitor(ReefAngel.PWM.GetActinicValue(),APColor, x+108, y+20,1);

}

void DrawParams(int x, int y) {
  char buf[16];

  ReefAngel.LCD.DrawText(COLOR_BLACK,DefaultBGColor,x+5,y,"Temp:");
  ReefAngel.LCD.DrawText(COLOR_BLACK,DefaultBGColor,x+80, y, "PH:");
  // Temp and PH
  y+=10;

  ConvertNumToString(buf, ReefAngel.Params.Temp[T1_PROBE], 10);
  ReefAngel.LCD.DrawLargeText(T1TempColor, DefaultBGColor, x+5, y, buf, Num8x16);
    ConvertNumToString(buf, ReefAngel.Params.Temp[T2_PROBE], 10);
  ReefAngel.LCD.DrawLargeText(T2TempColor, DefaultBGColor, x+5, y+12, buf, Num8x16);
    ConvertNumToString(buf, ReefAngel.Params.Temp[T3_PROBE], 10);
  ReefAngel.LCD.DrawLargeText(T3TempColor, DefaultBGColor, x+40, y+12, buf, Num8x16);
  ConvertNumToString(buf, ReefAngel.Params.PH, 100);
  ReefAngel.LCD.DrawLargeText(PHColor, DefaultBGColor, x+80, y, buf, Num8x16);
  y+=5;
   ReefAngel.LCD.DrawText( COLOR_DARKKHAKI,DefaultBGColor,10,18, "SAL:" );
    ReefAngel.LCD.DrawSingleMonitor( ReefAngel.Params.Salinity,COLOR_DARKKHAKI,33,18, 10 );   
}

void DrawStatus(int x, int y) {
  int t=x;
  
  ReefAngel.LCD.DrawLargeText(COLOR_INDIGO,DefaultBGColor,15,y,"High",Font8x16);
  ReefAngel.LCD.DrawLargeText(COLOR_INDIGO,DefaultBGColor,85,y,"Low",Font8x16);
  
  if (ReefAngel.HighATO.IsActive()) {
    ReefAngel.LCD.FillCircle(55,y+3,5,COLOR_GREEN);
  } else {
    ReefAngel.LCD.FillCircle(55,y+3,5,COLOR_RED);
  }
  
  if (ReefAngel.LowATO.IsActive()) {
    ReefAngel.LCD.FillCircle(70,y+3,5,COLOR_GREEN);
  } else {
    ReefAngel.LCD.FillCircle(70,y+3,5,COLOR_RED);
  }
}

void DrawCustomGraph()
{
}
Image
User avatar
lnevo
Posts: 5430
Joined: Fri Jul 20, 2012 9:42 am

Re: temp prob/heater not working right

Post by lnevo »

No it's a change in the libaries. You need to look for the file ReefAngel.cpp and search in there. Alternatively, you can download the fixed file from this link https://raw.githubusercontent.com/lnevo ... fAngel.cpp

and actually my fix earlier was wrong, the correct line should look just like this:

StandardHeater(TempProbe, HeaterRelay, LowTemp, HighTemp);

Let me know if this is clearer or not.

Roberto, here's the pull request I submitted in March for this issue.
https://github.com/reefangel/Libraries/pull/228
jjdezek
Posts: 329
Joined: Fri May 17, 2013 1:35 pm

Re: temp prob/heater not working right

Post by jjdezek »

ok I found that. What about the standardfan line? It also says the T1_Probe I don't have a fan but not sure if that will affect anything.
Image
jjdezek
Posts: 329
Joined: Fri May 17, 2013 1:35 pm

Re: temp prob/heater not working right

Post by jjdezek »

l.cpp:1001: error: 'TEMPPROBE' was not declared in this scope
that's the error code I get now when I try to verify my code. running original code with
ReefAngel.TempProbe = T3_PROBE;
ReefAngel.OverheatProbe = T3_PROBE;
when I change the TempProbe = T3_PROBE; to the StandardHeater3(port3) it still gives me the original errors I was getting and the StandardHeater3 stays back in color when I believe it should turn orange.
Image
User avatar
lnevo
Posts: 5430
Joined: Fri Jul 20, 2012 9:42 am

Re: temp prob/heater not working right

Post by lnevo »

The file is case sensitive. I would suggest downloading the full patched package and replacing it with your current libraries folder. https://github.com/lnevo/Libraries/archive/current.zip
jjdezek
Posts: 329
Joined: Fri May 17, 2013 1:35 pm

Re: temp prob/heater not working right

Post by jjdezek »

I removed my old libraries and replaced it with that one and it still gave me the same error when trying to verify the code. is there something else I need to do?
Image
jjdezek
Posts: 329
Joined: Fri May 17, 2013 1:35 pm

Re: temp prob/heater not working right

Post by jjdezek »

The following features were automatically added:
Watchdog Timer
Version Menu

The following features were detected:
Dimming Signal
Salinity Expansion Module
Wifi Attachment
Custom Main Screen
Extra Font - Medium Size (8x8 pixels)
Extra Font - Numbers Only - Large Font (8x16 pixels)
Dimming Expansion Module
DC Pump Control (Jebao/Tunze)
Simple Menu
C:\Users\christina\Documents\Arduino\libraries\ReefAngel\ReefAngel.cpp: In member function 'void ReefAngelClass::StandardHeater(byte, int, int)':
C:\Users\christina\Documents\Arduino\libraries\ReefAngel\ReefAngel.cpp:1001: error: 'TempPROBE' was not declared in this scope
Image
User avatar
lnevo
Posts: 5430
Joined: Fri Jul 20, 2012 9:42 am

Re: temp prob/heater not working right

Post by lnevo »

So the only way I could reproduce that error is if the spelling is wrong on line 1001 in ReefAngel.cpp.

Your first error said TEMPPROBE the second error says TempPROBE. It shoudl be TempProbe.

It should compile fine, I've checked it. If you are using the StandardHeater3 function you will need to specify the heaters. If you are using the correctly patched code and you want to use Memory, then you should set the ReefAngel.TempProbe=T3_PROBE; and then use ReefAngel.StandardHeater(Port7);

I'm convinced you are updating the file improperly.

Please take a closer look at this file and on line 1001

C:\Users\christina\Documents\Arduino\libraries\ReefAngel\ReefAngel.cpp:1001: error: 'TempPROBE' was not declared in this scope

Again, it should be

void ReefAngelClass::StandardHeater(byte HeaterRelay, int LowTemp, int HighTemp)
{
StandardHeater(TempProbe, HeaterRelay, LowTemp, HighTemp);
}

and if you use the StandardHeater3 function then you cannot use Memory at the moment. I will submit a patch for that as well.
jjdezek
Posts: 329
Joined: Fri May 17, 2013 1:35 pm

Re: temp prob/heater not working right

Post by jjdezek »

Ok that was the problem. Not sure why it didn't work when I replaced the library. Maybe because I still had the original file on my desktop?
Image
jjdezek
Posts: 329
Joined: Fri May 17, 2013 1:35 pm

Re: temp prob/heater not working right

Post by jjdezek »

Ok I put the. ReefAngel.StandardHeater(Port7); in my code and it loaded fine. The issue is it's still reading off my room temp probe.
Image
jjdezek
Posts: 329
Joined: Fri May 17, 2013 1:35 pm

Re: temp prob/heater not working right

Post by jjdezek »

I switched the code back to the TempProbe = T3_Probe; and now it's reading correctly.
Image
User avatar
lnevo
Posts: 5430
Joined: Fri Jul 20, 2012 9:42 am

Re: temp prob/heater not working right

Post by lnevo »

awesome! :)

I'll work on those patches.
User avatar
lnevo
Posts: 5430
Joined: Fri Jul 20, 2012 9:42 am

Re: temp prob/heater not working right

Post by lnevo »

Patches are in. StandardFan functions updated as well.
Post Reply