Is it possible to use Wifi module on RA?

New members questions
Post Reply
dadriance
Posts: 36
Joined: Sun Jun 03, 2012 11:04 am

Is it possible to use Wifi module on RA?

Post by dadriance »

I had my RA up and running for a couple months and finally got around to adding the wifi module. I've been working on it for 6 hours now and cannot come up with a sketch that will fit in the alloted memory. I have eliminated everything I can think of, you name it, it's gone. Still, I can't seem to get below 33,000.
I don't think I have all that much going, single ATO, 4 ports for lighting (moon, actinic, daylight and fuge), 2 always on and the heater, yet I still can't build a working sketch.
I need to loose 2k off of this, any ideas?

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 <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
    // Ports toggled in Feeding Mode
    ReefAngel.FeedingModePorts = 0;
    // Ports toggled in Water Change Mode
    ReefAngel.WaterChangePorts = Port1Bit | Port6Bit | Port8Bit;
    // Ports toggled when Lights On / Off menu entry selected
    ReefAngel.LightsOnPorts = Port2Bit | Port3Bit | Port4Bit | Port5Bit;
    // Ports turned off when Overheat temperature exceeded
    ReefAngel.OverheatShutoffPorts = Port4Bit | Port8Bit;
    // 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 );

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

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

void loop()
{
    ReefAngel.SingleATO( true,Port1,600,1 );
    ReefAngel.MoonLights( Port2 );
    ReefAngel.StandardLights( Port3,30 );
    ReefAngel.StandardLights( Port4 );
    ReefAngel.MoonLights( Port5 );
    ReefAngel.StandardHeater( Port8 );
    ReefAngel.PWM.ActinicPWMParabola();
    ////// Place your custom code below here
    

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

    // This should always be the last line
    ReefAngel.ShowInterface();
}
Image
dadriance
Posts: 36
Joined: Sun Jun 03, 2012 11:04 am

Re: Is it possible to use Wifi module on RA?

Post by dadriance »

Ugh... It gets worse.
I'm now stuck with "wifi setup" on my controller screen and I don't seem to have a way out of it. I've reloaded my previous sketch a half dozen times and even tried reloading the factory sketch, it just keeps going back to the wifi setup screen.
Image
rimai
Posts: 12857
Joined: Fri Mar 18, 2011 6:47 pm

Re: Is it possible to use Wifi module on RA?

Post by rimai »

If you are using it for a couple months, I recommend you uninstalling the old RA installer, remove or rename the Documents\Arduino folder to make sure you don't have old libraries and install the new RA installer which can be downloaded from the website.
The code above compiles at:
Binary sketch size: 23,122 bytes (of a 32,256 byte maximum)

With wifi, it compiles at:
Binary sketch size: 28,954 bytes (of a 32,256 byte maximum)

Check the cable connection on the USB-TTL cable when you plug into RA and make sure that it is pushed in and connected properly.
There is a photo on how to connect in here: http://www.reefangel.com/Support.Loadin ... tings.ashx
Roberto.
dadriance
Posts: 36
Joined: Sun Jun 03, 2012 11:04 am

Re: Is it possible to use Wifi module on RA?

Post by dadriance »

Thank you very much. That did the trick and got me compiled at under 31kb. Now all I have to do is figure out the port forwarding and get connected to the outside world.
Image
dadriance
Posts: 36
Joined: Sun Jun 03, 2012 11:04 am

Re: Is it possible to use Wifi module on RA?

Post by dadriance »

Done!!
Image
Post Reply