Sketch too big - please help

Do you have a question on how to do something.
Ask in here.
Post Reply
Poiromaniax
Posts: 180
Joined: Thu Apr 05, 2012 6:20 am
Location: JHB, South Africa

Sketch too big - please help

Post 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)
Image
Poiromaniax
Posts: 180
Joined: Thu Apr 05, 2012 6:20 am
Location: JHB, South Africa

Re: Sketch too big - please help

Post 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
Image
User avatar
lnevo
Posts: 5430
Joined: Fri Jul 20, 2012 9:42 am

Re: Sketch too big - please help

Post by lnevo »

Downgrade your libraries or upgrade your board...removing the portal line will disable the wifi
Poiromaniax
Posts: 180
Joined: Thu Apr 05, 2012 6:20 am
Location: JHB, South Africa

Re: Sketch too big - please help

Post 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?
Image
binder
Posts: 2871
Joined: Fri Mar 18, 2011 6:20 pm
Location: Illinois
Contact:

Re: Sketch too big - please help

Post 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.
Poiromaniax
Posts: 180
Joined: Thu Apr 05, 2012 6:20 am
Location: JHB, South Africa

Re: Sketch too big - please help

Post 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
Image
User avatar
lnevo
Posts: 5430
Joined: Fri Jul 20, 2012 9:42 am

Re: Sketch too big - please help

Post 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.
Poiromaniax
Posts: 180
Joined: Thu Apr 05, 2012 6:20 am
Location: JHB, South Africa

Re: Sketch too big - please help

Post 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
Image
Poiromaniax
Posts: 180
Joined: Thu Apr 05, 2012 6:20 am
Location: JHB, South Africa

Re: Sketch too big - please help

Post by Poiromaniax »

Do I have to rerun the wizard with those libraries or can I just paste the code?
Image
User avatar
lnevo
Posts: 5430
Joined: Fri Jul 20, 2012 9:42 am

Re: Sketch too big - please help

Post by lnevo »

Paste the code. You may have to remove the include for DCPump.h
Poiromaniax
Posts: 180
Joined: Thu Apr 05, 2012 6:20 am
Location: JHB, South Africa

Re: Sketch too big - please help

Post 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
Image
Post Reply