File Size Too Big

New members questions
Post Reply
Mike S
Posts: 82
Joined: Tue Dec 27, 2011 7:26 pm

File Size Too Big

Post by Mike S »

I've compiling a new PDE file using the new libraries and adding a second relay this morning. I've been running into some issues when trying to upload the file. I keep getting a a "sketch too big" error. Any tricks to trimming this down? I've tried removing the comments and cutting back on some of the blank lines. Also tried removing the #define datetime setup and versionmenu with the same result. Here is my complete PDE file:

Code: Select all

// Autogenerated file by RAGen (v1.2.1.158), (02/17/2012 07:54)
// RA_021712_0754.ino
//
// This version designed for v0.9.0 or later

/* The following features are enabled for this File: 
#define DisplayImages
#define DateTimeSetup
#define VersionMenu
#define DirectTempSensor
#define DisplayLEDPWM
#define wifi
#define RelayExp
#define InstalledRelayExpansionModules 1
#define WDT
#define SIMPLE_MENU
#define CUSTOM_MAIN
*/


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

void DrawCustomMain()
{
    // the graph is drawn/updated when we exit the main menu &
    // when the parameters are saved
    ReefAngel.LCD.DrawDate(6, 112);
    pingSerial();
#if defined DisplayLEDPWM && ! defined RemoveAllLights
    ReefAngel.LCD.DrawMonitor(15, 60, ReefAngel.Params,
    ReefAngel.PWM.GetDaylightValue(), ReefAngel.PWM.GetActinicValue());
#else // defined DisplayLEDPWM && ! defined RemoveAllLights
    ReefAngel.LCD.DrawMonitor(15, 60, ReefAngel.Params);
#endif // defined DisplayLEDPWM && ! defined RemoveAllLights
    pingSerial();
    byte TempRelay = ReefAngel.Relay.RelayData;
    TempRelay &= ReefAngel.Relay.RelayMaskOff;
    TempRelay |= ReefAngel.Relay.RelayMaskOn;
    ReefAngel.LCD.DrawOutletBox(12, 93, TempRelay);
}

void DrawCustomGraph()
{
    ReefAngel.LCD.DrawGraph(5, 5);
}


void setup()
{
    ReefAngel.Init();  //Initialize controller

    ReefAngel.FeedingModePorts =         B11000000;
    ReefAngel.WaterChangePortsE[0] =     B00100011;
    ReefAngel.OverheatShutoffPortsE[0] = B00000010;
    ReefAngel.LightsOnPorts =            B00001111;
    
    // Ports that are always on
    ReefAngel.Relay.On(Port7); //Vortech Slave
    ReefAngel.Relay.On(Port8); //Vortech Main
    ReefAngel.Relay.On(Box1_Port1); //Main Pump
    ReefAngel.Relay.On(Box1_Port3); //Skimmer
    ReefAngel.Relay.On(Box1_Port4); //Kalk Stirrer
    ReefAngel.Relay.On(Box1_Port7); //GFO Pump
    ReefAngel.Relay.On(Box1_Port8); //Biopellet Reacto
}

void loop()
{
    // Specific functions
    ReefAngel.MHLights(Port1); //Left Blue LEDs
    ReefAngel.MHLights(Port2); //Right Blue LEDs
    ReefAngel.StandardLights(Port3); //Left White LEDs
    ReefAngel.StandardLights(Port4); //Right White LEDs
    ReefAngel.PWM.ActinicPWMSlope();
    ReefAngel.PWM.DaylightPWMSlope(); 
    ReefAngel.StandardHeater(Box1_Port2);
    ReefAngel.Portal("Mike S");
    ReefAngel.MoonLights(Port5); //Left Moonlight
    ReefAngel.MoonLights(Port6); //Right Moonlight
    ReefAngel.MoonLights(Box1_Port5); //Fuge light on when main lights are out
    ReefAngel.SingleATOLow(Box1_Port6);
    if (ReefAngel.HighATO.IsActive()) ReefAngel.Relay.Off(Box1_Port6);
    ReefAngel.ShowInterface();
}
binder
Posts: 2865
Joined: Fri Mar 18, 2011 6:20 pm
Location: Illinois
Contact:

Re: File Size Too Big

Post by binder »

Drop the Date & Time Setup.

You have Wifi enabled so utilize one of the several apps to change the date & time if needed.
Mike S
Posts: 82
Joined: Tue Dec 27, 2011 7:26 pm

Re: File Size Too Big

Post by Mike S »

Thanks cur. I did try to remove? It looks like the file is 34680 bytes with the date and time setup remove and I only have space for 32256 byte.
TanksNStuff
Posts: 188
Joined: Fri Dec 30, 2011 6:57 am

Re: File Size Too Big

Post by TanksNStuff »

Mike, it's funny, I was about to call you about this same issue. Was wondering if you got a working .ino file since you have pretty much the same extra modules I do. Something happened with the new libraries that made the code much larger.

I'm going to make my own thread so I don't side track yours. I may still call you to see if we can work this out together.
Mike S
Posts: 82
Joined: Tue Dec 27, 2011 7:26 pm

Re: File Size Too Big

Post by Mike S »

George

I'very been just working on the code the past few days and finally just put in the extra relay this morning and tried to upload it. I've got wires running every which way to keep the tank running while I try to get the new code loaded so its sink or swim time lol. The leds are running off the new ports so i know that much works. I've ran into the file size error before when trying to use the web banner and ended up just taking it out to get it working. Ill be around if you want to call.
TanksNStuff
Posts: 188
Joined: Fri Dec 30, 2011 6:57 am

Re: File Size Too Big

Post by TanksNStuff »

Thats an idea. I guess I can do wiyhout the web banner since I'll have the android app to see whats going on remotely.
Mike S
Posts: 82
Joined: Tue Dec 27, 2011 7:26 pm

Re: File Size Too Big

Post by Mike S »

I've also tried removing #define DisplayImages, #define DateTimeSetup, #define VersionMenu, and #define DisplayLEDPWM and no luck. For some reason the file size doesn't seem to be changing when I look in the error log but if I look in windows explorer the file does appear to be getting getting smaller. I must be doing something wrong.
binder
Posts: 2865
Joined: Fri Mar 18, 2011 6:20 pm
Location: Illinois
Contact:

Re: File Size Too Big

Post by binder »

Also have Arduino CLOSED when you generate the new Features file. Arduino is notorious for keeping a working copy in memory and not forcing a recompile when it changes. Having it closed and reopen after each generate will ensure it reloads all the files and recompiles properly.
Mike S
Posts: 82
Joined: Tue Dec 27, 2011 7:26 pm

Re: File Size Too Big

Post by Mike S »

Thanks Curt,

I was manually removing that code in Arduino. I went back and redid it with Ragen and removed the custom Custom Menu, Time and Date Setup and Version features. I had to do it a few times before it worked but I was eventually able to get it to load. Each time they kept appearing in the new code, so that kind of proves that it was keeping it in memory. Now to see if everything works.
TanksNStuff
Posts: 188
Joined: Fri Dec 30, 2011 6:57 am

Re: File Size Too Big

Post by TanksNStuff »

Oh, that might be something I can try too. I've had it open the whole time by using an older pde as a reference to copy/paste from.

Thanks Curt.
Mike S
Posts: 82
Joined: Tue Dec 27, 2011 7:26 pm

Re: File Size Too Big

Post by Mike S »

My functions all seem to be working. Just need to check that the moonlights and fuge light comes on tonight. The LEDs are on, but are dim which makes sense since I set them at 50% in the internal memory. The only issues I'm having now is that I can't seem to get the Android app to connect so I can test to see if i can adjust the PWMslope functions. It just keeps saying parsing Here is the final code that I went with:

Code: Select all

// Autogenerated file by RAGen (v1.2.1.158), (02/19/2012 12:55)
// RA_021912_1255.ino
//
// This version designed for v0.9.0 or later

/* The following features are enabled for this File: 
#define DirectTempSensor
#define DisplayLEDPWM
#define wifi
#define RelayExp
#define InstalledRelayExpansionModules 1
#define WDT
#define SIMPLE_MENU
*/


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


void setup()
{
    ReefAngel.Init();  //Initialize controller

    ReefAngel.FeedingModePorts =         B11000000;
    ReefAngel.WaterChangePortsE[0] =     B00100011;
    ReefAngel.OverheatShutoffPortsE[0] = B00000010;
    ReefAngel.LightsOnPorts =            B00001111;
    
    // Ports that are always on
    ReefAngel.Relay.On(Port7); //Vortech Slave
    ReefAngel.Relay.On(Port8); //Vortech Main
    ReefAngel.Relay.On(Box1_Port1); //Main Pump
    ReefAngel.Relay.On(Box1_Port3); //Skimmer
    ReefAngel.Relay.On(Box1_Port4); //Kalk Stirrer
    ReefAngel.Relay.On(Box1_Port7); //GFO Pump
    ReefAngel.Relay.On(Box1_Port8); //Biopellet Reactor
}

void loop()
{
    // Specific functions
    ReefAngel.MHLights(Port1); //Left Blue LEDs
    ReefAngel.MHLights(Port2); //Right Blue LEDs
    ReefAngel.StandardLights(Port3); //Left White LEDs
    ReefAngel.StandardLights(Port4); //Right White LEDs
    ReefAngel.PWM.ActinicPWMSlope();
    ReefAngel.PWM.DaylightPWMSlope(); 
    ReefAngel.StandardHeater(Box1_Port2);
    ReefAngel.MoonLights(Port5); //Left Moonlight
    ReefAngel.MoonLights(Port6); //Right Moonlight
    ReefAngel.MoonLights(Box1_Port5); //Fuge light on when main lights are out
    ReefAngel.SingleATOLow(Box1_Port6);
    if (ReefAngel.HighATO.IsActive()) ReefAngel.Relay.Off(Box1_Port6);
    
    ReefAngel.Portal("Mike S");
    ReefAngel.ShowInterface();
}
rimai
Posts: 12857
Joined: Fri Mar 18, 2011 6:47 pm

Re: File Size Too Big

Post by rimai »

Welcome to the club :(
I've been waiting on this one too... lol
You can still use the internal memory and feeding and water change mode.
Just the parameters are not updating on the app right now.
You can even try toggling relays. It works for me.
Roberto.
binder
Posts: 2865
Joined: Fri Mar 18, 2011 6:20 pm
Location: Illinois
Contact:

Re: File Size Too Big

Post by binder »

Well crap. Guess I need to shift things over to the Android App now too and fix up the problems with that stuff not working. Always something. :?
Mike S
Posts: 82
Joined: Tue Dec 27, 2011 7:26 pm

Re: File Size Too Big

Post by Mike S »

Well what do you know it does seem to change the parameters. So we can't receive any status info on the android app yet? It also looks like we are limited to just the ports on the main relays? I think we need to send Curt some NoDoz and/or beer to help move along the updates. :)

At least I'm up and running and can get out of the house and take the kids to the playground to burn off some steam! :) I'll have to play with Client and the Portal tonight.
binder
Posts: 2865
Joined: Fri Mar 18, 2011 6:20 pm
Location: Illinois
Contact:

Re: File Size Too Big

Post by binder »

Glad you are at least up and running. I'm starting to work on the problem. I have to track it down first and reproduce it (which won't be hard to reproduce). Then I'll be starting on a fix. :)
binder
Posts: 2865
Joined: Fri Mar 18, 2011 6:20 pm
Location: Illinois
Contact:

Re: File Size Too Big

Post by binder »

I'm testing things out on my controllers and cannot reproduce the problem. I've got expansion relays enabled on my other test controller and the Android App is working like a champ.

The latest Android App is v0.4.3
Confirm you have the latest version installed.

If you do, please test your app against my 0.9.0 test controller:
host: curtbinder.dyndns.info
port: 2010
Mike S
Posts: 82
Joined: Tue Dec 27, 2011 7:26 pm

Re: File Size Too Big

Post by Mike S »

Yep I'm using v0.4.3 and am able to see your test controller. Your water is chilly. :)

When I put in my local ip 192.168.1.101 port 2000 I get an error 23:XML SAX Parser error. It just said parsing before. Going to try to reboot my wifi adapter again and see what happens. Although I can type 192.168.1.101:2000 into my browser and see the controller.
rimai
Posts: 12857
Joined: Fri Mar 18, 2011 6:47 pm

Re: File Size Too Big

Post by rimai »

Well, I found out that my problem was that I had not updated my app.
I uninstalled from the phone and downloaded again and everything is working now. :)
I've been missing out all this time. :roll:
Roberto.
binder
Posts: 2865
Joined: Fri Mar 18, 2011 6:20 pm
Location: Illinois
Contact:

Re: File Size Too Big

Post by binder »

Mike S wrote:Yep I'm using v0.4.3 and am able to see your test controller. Your water is chilly. :)
Haha...yeah, my "water" isn't really water....just the room temperature in my office. :)
When I put in my local ip 192.168.1.101 port 2000 I get an error 23:XML SAX Parser error. It just said parsing before. Going to try to reboot my wifi adapter again and see what happens. Although I can type 192.168.1.101:2000 into my browser and see the controller.
If it's giving that error, then it's parsing the data but erroring out. Your best bet is to try again. I've seen it do that from time to time if there are too many requests going to it or if it is in the middle of processing data when the request comes through.
Mike S
Posts: 82
Joined: Tue Dec 27, 2011 7:26 pm

Re: File Size Too Big

Post by Mike S »

I've had that'll issue in the past and normally if I unplug my wifi adapter briefly it goes away. Tried that a few times this evening and it worked briefly each time but then back to the parsing error.

I'm also having some trouble with port forwarding and getting the portal to work but a I've at least confirmed that the code is functioning properly . Baby steps
TanksNStuff
Posts: 188
Joined: Fri Dec 30, 2011 6:57 am

Re: File Size Too Big

Post by TanksNStuff »

Glad to hear things are working out for you Mike. Did the moonlights ever come on when they were supposed to? Your banner shows them off right now, but your blues/whites are on so the moonlights should be off.
Mike S
Posts: 82
Joined: Tue Dec 27, 2011 7:26 pm

Re: File Size Too Big

Post by Mike S »

Yep George I used the moonlight function for both my moonlights and my fuge light and they both came on and went off on schedule. I am notice that my LED are cutting off around 9 or 10% so I need to tweak that a bit. All the other schedules and functions seem to be working fine.

For some reason I'm not able to get my banner to update or access the portal. It updated once yesterday and its just showing that one set of data. Not sure what is going on. I thought I had my port forwarding setup up properly in my router, but that didn't work. Tried setting up dns web address also, but no luck. I just get an unreachable address on my portal status. Also tired turning off my router's firewall with the same outcome. I'm going to look at my modem to see if there is some firewall in there that is causing issues.
TanksNStuff
Posts: 188
Joined: Fri Dec 30, 2011 6:57 am

Re: File Size Too Big

Post by TanksNStuff »

Nice. At least the moonlights and fuge light worked as intended. That's a start anyway. The portal stuff is nice, but as long as the tank equipment is running right it's not urgent to fix the portal stuff.

I noticed in the android client (or maybe it was the internal memory file?) where there was a data field for the low end of the PWM signal. If I recall correctly, it was set at 15 as default. Maybe you need to change that to 10 (or maybe zero?) instead? Try that and see if that helps with the cut off issue.

Yea, I set my wifi up for the first time last night and was getting similar problems with it not updating. I still have to get a dyndns.info address and setup the port forwarding too, so I'll probably hit you up on tips for that when I get to it.

I guess there might be an issue with the modem (sometimes they have their own firewall built in.) Between the two of us, we can probably figure that out.
Mike S
Posts: 82
Joined: Tue Dec 27, 2011 7:26 pm

Re: File Size Too Big

Post by Mike S »

Yep I just need to change the cutoff to 10% and that should take care of the issue.

I'm at home playing with it today. I did realize that I have a Ooma VOIP adapter between the modem and the router. I pulled that out and can now navigate using my external IP to that port and some of the online port forwarding testing tools are now showing that it is open. There must be something with the Ooma adapter that is blocking it. I still can't seem to get the portal to work or my banner to update, but I'm getting closer.
Post Reply