Page 1 of 1

Sketch too big - please help

Posted: Tue May 13, 2014 12:31 pm
by Poiromaniax
Hi guys,

I have just compiled this using the Wizard. I am getting a "too big" error. I need the features to be configured as Ive set them, but if it helps, I need next to nothing on the controller screen - PH and temp only (would be nice if the text was large but if it keeps the sketch small then i dont mind regular size text)

Thanks!

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


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


void setup()
{
    // This must be the first line
    ReefAngel.Init();  //Initialize controller
    ReefAngel.SetTemperatureUnit( Celsius );  // set to Celsius Temperature

    // Ports toggled in Feeding Mode
    ReefAngel.FeedingModePorts = Port5Bit;
    // Ports toggled in Water Change Mode
    ReefAngel.WaterChangePorts = Port5Bit | Port6Bit | Port7Bit;
    // Ports toggled when Lights On / Off menu entry selected
    ReefAngel.LightsOnPorts = Port1Bit | Port2Bit | Port3Bit;
    // Ports turned off when Overheat temperature exceeded
    ReefAngel.OverheatShutoffPorts = Port4Bit;
    // Use T1 probe as temperature and overheat functions
    ReefAngel.TempProbe = T1_PROBE;
    ReefAngel.OverheatProbe = T1_PROBE;


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

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

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

void loop()
{
    ReefAngel.DayLights( Port1 );
    ReefAngel.DayLights( Port2 );
    ReefAngel.DayLights( Port3 );
    ReefAngel.StandardHeater( Port4 );
    ReefAngel.Wavemaker1( Port5 );
    ReefAngel.PWM.SetActinic( MoonPhase() );
    ReefAngel.RF.UseMemory = true;
    ////// Place your custom code below here
    

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

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

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

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

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

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

void DrawCustomGraph()
{
}
Also, how do I set my vortech to go into feed mode when I press feed mode button? (Port 6 is my vortech)

Re: Sketch too big - please help

Posted: Tue May 13, 2014 11:00 pm
by Poiromaniax
Ok, What ive done is removed this line:

Code: Select all

ReefAngel.Portal( "poiromaniax" );
What negative effects will this have? I use dyndns for my RA and have the dyndns address defined in portal settings

it drops my sketch down to 28,000kb instead of 32,800kb

Re: Sketch too big - please help

Posted: Wed May 14, 2014 5:26 am
by lnevo
Downgrade your libraries or upgrade your board...removing the portal line will disable the wifi

Re: Sketch too big - please help

Posted: Wed May 14, 2014 5:39 am
by Poiromaniax
Even if I use dyndns directly? (with port forwarding setup correctly)

What ive noticed is that after an hour or so of using dydnds, the portal automatically changes from xxxxxx.dynds.org to my external IP address - it sometimes gets stuck like that and I have to input the dyndns address again.

Im assuming its because of this "send to portal" function? so surely if I remove the function and just stick to dyndns, it will still work?

Re: Sketch too big - please help

Posted: Wed May 14, 2014 5:46 am
by binder
the portal updates its IP address for your controller every time you send data to it. so if your IP address is different than what it has listed, the portal will update. this way the IP address is always updated and accurate. it's something that roberto added.

Re: Sketch too big - please help

Posted: Wed May 14, 2014 6:26 am
by Poiromaniax
Yeah I get that. But can't I just use dyndns instead of the "send to portal" function? It makes such a difference size wise

Re: Sketch too big - please help

Posted: Wed May 14, 2014 9:10 am
by lnevo
Having that line is what enables the wifi code. It doesnt just send to the portal...thats not whats taking up extra code. My earlier recommendation stands...downgrade to the libraries you were using before.

Re: Sketch too big - please help

Posted: Wed May 14, 2014 9:19 am
by Poiromaniax
Ok thanks. I was previously using 1.0.9 and even with those it's too big. Will try 1.0.8 else 1.0.7

Re: Sketch too big - please help

Posted: Wed May 14, 2014 9:23 am
by Poiromaniax
Do I have to rerun the wizard with those libraries or can I just paste the code?

Re: Sketch too big - please help

Posted: Wed May 14, 2014 11:14 am
by lnevo
Paste the code. You may have to remove the include for DCPump.h

Re: Sketch too big - please help

Posted: Wed May 14, 2014 12:42 pm
by Poiromaniax
I had to go back to 1.0.7 before it worked.

I'm having a weird vortech issue though. Will start a new thread