Code not generating changes !

New members questions
Post Reply
cjrudy
Posts: 135
Joined: Sat Nov 10, 2012 2:47 pm

Code not generating changes !

Post by cjrudy »

I am using the Wizard to generate code, it successfully uploads the code, the controller reboots but the changes are not there. The ports that are on/off never change from the pre-loaded settings. I have tried using the code option as well as the internal memory option. Any ideas ?
rimai
Posts: 12881
Joined: Fri Mar 18, 2011 6:47 pm

Re: Code not generating changes !

Post by rimai »

Can you try uploading the ControllerTester code?
File->Sketchbook->Example Codes->ControllerTester
Roberto.
cjrudy
Posts: 135
Joined: Sat Nov 10, 2012 2:47 pm

Re: Code not generating changes !

Post by cjrudy »

I uploaded that code, which definitely worked. I tried to upload custom code again which worked but I found the problem. For some reason the only ports that work right are the "Always On" ports, any ports with certain parameters like ATO, Heater or Lights dont seem to program correctly. For example , heater ports show off even though they are programmed to be on.
dbmet
Posts: 235
Joined: Thu Nov 10, 2011 11:49 am

Re: Code not generating changes !

Post by dbmet »

Can you copy and paste the code your here?
Image
User avatar
lnevo
Posts: 5430
Joined: Fri Jul 20, 2012 9:42 am

Code not generating changes !

Post by lnevo »

Is your date/time set correctly?
cjrudy
Posts: 135
Joined: Sat Nov 10, 2012 2:47 pm

Re: Code not generating changes !

Post by cjrudy »

Yes, date and time are correct, here is my code
#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 <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 = Port3Bit | Port4Bit | Port5Bit | Port6Bit | Port7Bit | Port8Bit;
    // Ports toggled when Lights On / Off menu entry selected
    ReefAngel.LightsOnPorts = 0;
    // Ports turned off when Overheat temperature exceeded
    ReefAngel.OverheatShutoffPorts = Port1Bit | Port2Bit | Port3Bit | 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( Port5 );
    ReefAngel.Relay.On( Port6 );
    ReefAngel.Relay.On( Port7 );

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

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

void loop()
{
    ReefAngel.ActinicLights( Port1 );
    ReefAngel.DayLights( Port2 );
    ReefAngel.StandardHeater( Port3 );
    ReefAngel.StandardHeater( Port4 );
    ReefAngel.StandardATO( Port8 );
    ////// Place your custom code below here
    

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

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


User avatar
lnevo
Posts: 5430
Joined: Fri Jul 20, 2012 9:42 am

Code not generating changes !

Post by lnevo »

The code is using memory settings for your devices. Check all your times and temp settings in the portal under internal memory
cjrudy
Posts: 135
Joined: Sat Nov 10, 2012 2:47 pm

Re: Code not generating changes !

Post by cjrudy »

Ok, well maybe I am not understanding this, the code is uploaded, the portal internal memory stettings match but the ports on the controller and the portal are different and neither is actually what I programmed

Image

Image
cjrudy
Posts: 135
Joined: Sat Nov 10, 2012 2:47 pm

Re: Code not generating changes !

Post by cjrudy »

As programmed 1&2 are lights, 3&4 are heaters, 5-7 are always on and 8 is ATO which should be on
rimai
Posts: 12881
Joined: Fri Mar 18, 2011 6:47 pm

Re: Code not generating changes !

Post by rimai »

Would it be possible to upload a code with hard coded settings to begin and move to internal memory once you get things figured out and you know that the controller and the portal all all working and communicating correctly?
Those ports on your Portal indicate that you overrode several of the ports. Off and On are overrides. The Auto is when the controller is able to control them. If you override the port to on, it will always stay on, no matter what the controller is supposed to do with that port.
Roberto.
cjrudy
Posts: 135
Joined: Sat Nov 10, 2012 2:47 pm

Re: Code not generating changes !

Post by cjrudy »

Ok, good to know about the On and Off overrides, I uploaded a code with hard coded settings and I thinks its working, all the ports show auto. My only issue now is working with a separate ATO switch. When I first set up the controller I plugged my ATO switch into port 1 and it would timeout after 60 seconds. Now that I programmed all the ports, I set the ATO on port 8 but its not on because I am using my own ATO switch.

So is there any simple way to set up a timer on any port ?
rimai
Posts: 12881
Joined: Fri Mar 18, 2011 6:47 pm

Re: Code not generating changes !

Post by rimai »

You have your own ATO system or your own float switch?
I'm not quite understanding your question.
Roberto.
cjrudy
Posts: 135
Joined: Sat Nov 10, 2012 2:47 pm

Re: Code not generating changes !

Post by cjrudy »

My own system, switches , pump etc.

When I first got the RA, I plugged my ATO pump into Port 1 which was always on but would only run for 60 seconds max. Now I have programmed all the ports and Port8 is now the ATO but it always shows off, not sure why.

I am new at this so maybe i am not fully understanding everything.
rimai
Posts: 12881
Joined: Fri Mar 18, 2011 6:47 pm

Re: Code not generating changes !

Post by rimai »

You probably just need to set port 8 to be always on, if you have your own system.
Roberto.
cjrudy
Posts: 135
Joined: Sat Nov 10, 2012 2:47 pm

Re: Code not generating changes !

Post by cjrudy »

Thats how i have it set now, looking to have a timer function on the ATO as a fail safe, any way to set that up on a specific port?
rimai
Posts: 12881
Joined: Fri Mar 18, 2011 6:47 pm

Re: Code not generating changes !

Post by rimai »

Not with your own system.
RA needs to know when to start the timer and with your own system, it would never know.
Roberto.
User avatar
lnevo
Posts: 5430
Joined: Fri Jul 20, 2012 9:42 am

Code not generating changes !

Post by lnevo »

Your code is setting the port to an ato port...if you wanted ra to backup, you would need your float switches setup and plugged in. It will turn the port on only when atolow is active and off when ato high is active or your timeout..at least thats how your code above is written. Otherwise just make it an always on port.
cjrudy
Posts: 135
Joined: Sat Nov 10, 2012 2:47 pm

Re: Code not generating changes !

Post by cjrudy »

Got it, thanks for everyone's help.

I am just using an "AutoTopOff.com" float switch setup, maybe I can just wire the two float switches I am currently using into the RA Connectors.
User avatar
lnevo
Posts: 5430
Joined: Fri Jul 20, 2012 9:42 am

Code not generating changes !

Post by lnevo »

No reason it wouldn't. Thats the way i would go :) at least then you can monitor and alert on your float switch statuses etc.
Post Reply