RA Gen File Size Issue

Community contributed apps
Post Reply
Rey
Posts: 36
Joined: Wed Sep 07, 2011 7:56 pm

RA Gen File Size Issue

Post by Rey »

I created a code through RA GEN and when I try to upload to the controller, I get the "Sketch too big" error

Binary sketch size: 36540 bytes (of a 30720 byte maximum)

Code: Select all

// Autogenerated file by RAGen (v1.0.4.92), (09/08/2011 11:16)
// RA_090811_1116.pde
//
// This version designed for v0.8.5 Beta 12 or later

/* The following features are enabled for this PDE File: 
#define SetupExtras
#define WavemakerSetup
#define OverheatSetup
#define DateTimeSetup
#define VersionMenu
#define ATOSetup
#define MetalHalideSetup
#define DirectTempSensor
#define DisplayLEDPWM
#define wifi
#define StandardLightSetup
*/


#include <ReefAngel_Features.h>
#include <ReefAngel_Globals.h>
#include <ReefAngel_Wifi.h>
#include <Wire.h>
#include <OneWire.h>
#include <Time.h>
#include <DS1307RTC.h>
#include <ReefAngel_EEPROM.h>
#include <ReefAngel_NokiaLCD.h>
#include <ReefAngel_ATO.h>
#include <ReefAngel_Joystick.h>
#include <ReefAngel_LED.h>
#include <ReefAngel_TempSensor.h>
#include <ReefAngel_Relay.h>
#include <ReefAngel_PWM.h>
#include <ReefAngel_Timer.h>
#include <ReefAngel_Memory.h>
#include <ReefAngel.h>

// Labels for the web banner
#include <avr/pgmspace.h>
prog_char id_label[] PROGMEM = "Rey";
prog_char probe1_label[] PROGMEM = "Water";
prog_char probe2_label[] PROGMEM = "Lights";
prog_char probe3_label[] PROGMEM = "Room";
prog_char relay1_label[] PROGMEM = "LED";
prog_char relay2_label[] PROGMEM = "Sump%20Light";
prog_char relay3_label[] PROGMEM = "Powerhead%201";
prog_char relay4_label[] PROGMEM = "Powerhead%202";
prog_char relay5_label[] PROGMEM = "Heater";
prog_char relay6_label[] PROGMEM = "Fan";
prog_char relay7_label[] PROGMEM = "Sump";
prog_char relay8_label[] PROGMEM = "Not%20Used";
PROGMEM const char *webbanner_items[] = {
    id_label, probe1_label, probe2_label, probe3_label, relay1_label, relay2_label,
	relay3_label, relay4_label, relay5_label, relay6_label, relay7_label, relay8_label};


void setup()
{
    ReefAngel.Init();  //Initialize controller
    // Initialize and start the web banner timer
    ReefAngel.LoadWebBanner(pgm_read_word(&(webbanner_items[0])), SIZE(webbanner_items));
    ReefAngel.Timer[4].SetInterval(180);  // set interval to 180 seconds
    ReefAngel.Timer[4].Start();

    ReefAngel.FeedingModePorts = B10001100;
    ReefAngel.WaterChangePorts = B10001100;
    ReefAngel.OverheatShutoffPorts = B00110000;
    ReefAngel.LightsOnPorts = B00000011;
}

void loop()
{
    ReefAngel.ShowInterface();

    // Specific functions
    ReefAngel.MHLights(Port1);
    ReefAngel.StandardLights(Port2);
    ReefAngel.Wavemaker1(Port3);
    ReefAngel.Wavemaker2(Port4);
    ReefAngel.StandardHeater(Port5);
    ReefAngel.StandardFan(Port6);
    ReefAngel.StandardATO(Port7);

    // Web Banner stuff
    if(ReefAngel.Timer[4].IsTriggered())
    {
        ReefAngel.Timer[4].Start();
        ReefAngel.WebBanner();
    }
}
Image
binder
Posts: 2871
Joined: Fri Mar 18, 2011 6:20 pm
Location: Illinois
Contact:

Re: RA Gen File Size Issue

Post by binder »

That can easily happen with all those setup screens. What I would suggest doing is removing all the setup screens and using the Client Suite or my Status App to change the memory values on the controller. Most of the time you will not ever need to change the values with the controller (it can be a little cumbersome using the up & down joystick to change the values). Removing the DateTimeSetup will save a lot of space as well. If you have a wifi module (which it sounds like you do), then I would really recommend going this route. It will definitely be worthwhile and simple for you.

You may even want to look into enabling SIMPLE_MENU (have to add in manually to the ReefAngel_Features.h file). This will strip out a lot of the extra screens and reduce the file size.

Also, you can have the Client Suite update your web banner for you automatically instead of having the controller update it. Just a thought.

curt
Rey
Posts: 36
Joined: Wed Sep 07, 2011 7:56 pm

Re: RA Gen File Size Issue

Post by Rey »

Thank you very much. I should have search the forum first before I posted this. I actually found what you're suggesting from a different thread. Thank you again.
Image
Post Reply