update

Related to the development libraries, released by Curt Binder
Post Reply
Seedlessone
Posts: 135
Joined: Tue Jan 24, 2012 6:20 pm

update

Post by Seedlessone »

Just updated to new libraries but now sketch it to big. What can I shave off?
// Autogenerated file by RAGen (v1.1.0.126), (01/27/2012 19:39)
// RA_012712_1939.pde
//
// This version designed for v0.8.5 Beta 17 or later

/* The following features are enabled for this PDE File: 
#define DisplayImages
#define DateTimeSetup
#define VersionMenu
#define DirectTempSensor
#define wifi
#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 = B10000000;
  ReefAngel.WaterChangePorts = B10000000;
  ReefAngel.OverheatShutoffPorts = B00000000;
  ReefAngel.LightsOnPorts = B00000011;

  // Ports that are always on
  ReefAngel.Relay.On(Port8);
  randomSeed(analogRead(0));
  ReefAngel.Timer[1].SetInterval(random(15,35));
  ReefAngel.Timer[1].Start();
  ReefAngel.Relay.On(Port5);
}

void loop()
{
  // Specific functions
  ReefAngel.StandardLights(Port1);
  ReefAngel.MHLights(Port2);
  ReefAngel.StandardHeater(Port7);
  ReefAngel.StandardATO(Port4);

  if (!bitRead(ReefAngel.Relay.RelayData,0)) ReefAngel.Relay.On(Port3);
  else ReefAngel.Relay.Off(Port3);
  if (ReefAngel.HighATO.IsActive()) ReefAngel.SingleATOLow(Port4);
  else ReefAngel.Relay.Off(Port4);
  if ( ReefAngel.Timer[1].IsTriggered() )
  {
    ReefAngel.Timer[1].SetInterval(random(15,35));
    ReefAngel.Timer[1].Start();
    ReefAngel.Relay.Toggle(Port5);
    ReefAngel.Relay.Toggle(Port6);
  }

  ReefAngel.ShowInterface();
}


rimai
Posts: 12881
Joined: Fri Mar 18, 2011 6:47 pm

Re: update

Post by rimai »

Open RAGen

Click features tab

Select the following:
wifi
wdt
simple menu
version menu

Click Save button
Roberto.
Seedlessone
Posts: 135
Joined: Tue Jan 24, 2012 6:20 pm

Re: update

Post by Seedlessone »

THAT did the trick. What is the best way to check these moonlights out? Is there something in the feature tab or does it need to be added to my sketch? Thanks for everything.

Wifi attachment was a breeze. You guys just changed the GUI for that in the update as well correct?
Seedlessone
Posts: 135
Joined: Tue Jan 24, 2012 6:20 pm

Re: update

Post by Seedlessone »

Also just looked and now controller is stating no internal memory settings found. So i tried to upload my last internal memory settings but getting an error.
// Autogenerated file by RAGen (v1.2.0.152), (02/15/2012 17:46)
// Memory_021512_1746.ino
//
// This file sets the default values to the Internal Memory
//


#include <ReefAngel_Features.h>
#include <Globals.h>
#include <Time.h>
#include <OneWire.h>
#include <RA_NokiaLCD.h>
#include <avr/pgmspace.h>
#include <InternalEEPROM.h>
#include <Wire.h>
#include <Memory.h>


RA_NokiaLCD e;

void setup()
{
    e.lcd_init();
    e.lcd_clear(COLOR_WHITE,0,0,132,132);
    e.lcd_BacklightOn();

    InternalMemory.MHOnHour_write(8);
    InternalMemory.MHOnMinute_write(0);
    InternalMemory.MHOffHour_write(15);
    InternalMemory.MHOffMinute_write(0);
    InternalMemory.MHDelay_write(5);
    InternalMemory.StdLightsOnHour_write(8);
    InternalMemory.StdLightsOnMinute_write(0);
    InternalMemory.StdLightsOffHour_write(15);
    InternalMemory.StdLightsOffMinute_write(0);
    InternalMemory.DP1OnHour_write(20);
    InternalMemory.DP1OnMinute_write(0);
    InternalMemory.DP2OnHour_write(22);
    InternalMemory.DP2OnMinute_write(30);
    InternalMemory.DP1Timer_write(10);
    InternalMemory.DP2Timer_write(10);
    InternalMemory.DP1RepeatInterval_write(60);
    InternalMemory.DP2RepeatInterval_write(60);
    InternalMemory.ATOTimeout_write(60);
    InternalMemory.ATOHighTimeout_write(60);
    InternalMemory.ATOHourInterval_write(0);
    InternalMemory.ATOHighHourInterval_write(0);
    InternalMemory.FeedingTimer_write(900);
    InternalMemory.LCDTimer_write(600);
    InternalMemory.LEDPWMActinic_write(50);
    InternalMemory.LEDPWMDaylight_write(50);
    InternalMemory.WM1Timer_write(200);
    InternalMemory.WM2Timer_write(354);
    InternalMemory.HeaterTempOn_write(780);
    InternalMemory.HeaterTempOff_write(791);
    InternalMemory.ChillerTempOn_write(810);
    InternalMemory.ChillerTempOff_write(785);
    InternalMemory.OverheatTemp_write(1500);
    InternalMemory.PHMax_write(840);
    InternalMemory.PHMin_write(550);
    InternalMemory.SalMax_write(2550);
    InternalMemory.RFMode_write(Constant);
    InternalMemory.RFSpeed_write(140);
    InternalMemory.RFDuration_write(8);
    InternalMemory.RFDuration_write(8);
    InternalMemory.PWMSlopeStartD_write(15);
    InternalMemory.PWMSlopeEndD_write(128);
    InternalMemory.PWMSlopeDurationD_write(60);
    InternalMemory.PWMSlopeStartA_write(15);
    InternalMemory.PWMSlopeEndA_write(128);
    InternalMemory.PWMSlopeDurationA_write(60);
    InternalMemory.IMCheck_write(0x5241494D);
}

void loop()
{
    // display the values
    char buf[128];
    sprintf(buf, "MH %2d:%02d-%2d:%02d,%d", InternalMemory.MHOnHour_read(), InternalMemory.MHOnMinute_read(),
                                         InternalMemory.MHOffHour_read(), InternalMemory.MHOffMinute_read(),
                                         InternalMemory.MHDelay_read());
    e.lcd_draw_text(COLOR_BLACK, COLOR_WHITE, MENU_START_COL, MENU_START_ROW, buf);
    sprintf(buf, "Std %2d:%02d-%2d:%02d", InternalMemory.StdLightsOnHour_read(), InternalMemory.StdLightsOnMinute_read(),
                                          InternalMemory.StdLightsOffHour_read(), InternalMemory.StdLightsOffMinute_read());
    e.lcd_draw_text(COLOR_BLACK, COLOR_WHITE, MENU_START_COL, MENU_START_ROW*2, buf);
    sprintf(buf, "LED A: %d%% D: %d%%", InternalMemory.LEDPWMActinic_read(), InternalMemory.LEDPWMDaylight_read());
    e.lcd_draw_text(COLOR_BLACK, COLOR_WHITE, MENU_START_COL, MENU_START_ROW*3, buf);
    sprintf(buf, "WM1: %ds", InternalMemory.WM1Timer_read());
    e.lcd_draw_text(COLOR_BLACK, COLOR_WHITE, MENU_START_COL, MENU_START_ROW*4, buf);
    sprintf(buf, "WM2: %ds", InternalMemory.WM2Timer_read());
    e.lcd_draw_text(COLOR_BLACK, COLOR_WHITE, MENU_START_COL, MENU_START_ROW*5, buf);
    sprintf(buf, "F: %ds", InternalMemory.FeedingTimer_read());
    e.lcd_draw_text(COLOR_BLACK, COLOR_WHITE, MENU_START_COL, MENU_START_ROW*6, buf);
    sprintf(buf, "S: %ds", InternalMemory.LCDTimer_read());
    e.lcd_draw_text(COLOR_BLACK, COLOR_WHITE, MENU_START_COL, MENU_START_ROW*7, buf);
    sprintf(buf, "H On: %d -> %d", InternalMemory.HeaterTempOn_read(), InternalMemory.HeaterTempOff_read());
    e.lcd_draw_text(COLOR_BLACK, COLOR_WHITE, MENU_START_COL, MENU_START_ROW*9, buf);
    sprintf(buf, "C On: %d -> %d", InternalMemory.ChillerTempOn_read(), InternalMemory.ChillerTempOff_read());
    e.lcd_draw_text(COLOR_BLACK, COLOR_WHITE, MENU_START_COL, MENU_START_ROW*10, buf);
    sprintf(buf, "PH %d - %d", InternalMemory.PHMax_read(), InternalMemory.PHMin_read());
    e.lcd_draw_text(COLOR_BLACK, COLOR_WHITE, MENU_START_COL, MENU_START_ROW*11, buf);

    delay(10000);
    e.lcd_clear(COLOR_WHITE,0,0,132,132);

    sprintf(buf, "OH: %dF", InternalMemory.OverheatTemp_read());
    e.lcd_draw_text(COLOR_BLACK, COLOR_WHITE, MENU_START_COL, MENU_START_ROW, buf);
    sprintf(buf, "ATO L: %ds (%dh)", InternalMemory.ATOTimeout_read(), InternalMemory.ATOHourInterval_read());
    e.lcd_draw_text(COLOR_BLACK, COLOR_WHITE, MENU_START_COL, MENU_START_ROW*2, buf);
    sprintf(buf, "ATO H: %ds (%dh)", InternalMemory.ATOHighTimeout_read(), InternalMemory.ATOHighHourInterval_read());
    e.lcd_draw_text(COLOR_BLACK, COLOR_WHITE, MENU_START_COL, MENU_START_ROW*3, buf);

    sprintf(buf, "DP1: %2d:%02d", InternalMemory.DP1OnHour_read(), InternalMemory.DP1OnMinute_read());
    e.lcd_draw_text(COLOR_BLACK, COLOR_WHITE, MENU_START_COL, MENU_START_ROW*5, buf);
    sprintf(buf, " %ds", InternalMemory.DP1Timer_read());
    e.lcd_draw_text(COLOR_BLACK, COLOR_WHITE, MENU_START_COL, MENU_START_ROW*6, buf);
    sprintf(buf, "DP2: %2d:%02d", InternalMemory.DP2OnHour_read(), InternalMemory.DP2OnMinute_read());
    e.lcd_draw_text(COLOR_BLACK, COLOR_WHITE, MENU_START_COL, MENU_START_ROW*7, buf);
    sprintf(buf, " %ds", InternalMemory.DP2Timer_read());
    e.lcd_draw_text(COLOR_BLACK, COLOR_WHITE, MENU_START_COL, MENU_START_ROW*8, buf);

    delay(10000);
    e.lcd_clear(COLOR_WHITE,0,0,132,132);
}

rimai
Posts: 12881
Joined: Fri Mar 18, 2011 6:47 pm

Re: update

Post by rimai »

For moonlights use this:

Code: Select all

ReefAngel.PWM.SetActinic(MoonPhase());
ReefAngel.PWM.SetDaylight(MoonPhase());
For the internal memory, there is a bug found today.
http://forum.reefangel.com/viewtopic.php?p=5914#p5914
Internal memory files are not being generated properly.
Use the InitialInternalMemory code that is on your example codes.
File->Sketchbook->Examples
Roberto.
Seedlessone
Posts: 135
Joined: Tue Jan 24, 2012 6:20 pm

Re: update

Post by Seedlessone »

Okay a little lost on that one. So I found the example sketches but unsure where to go from there. Uploading that sketch did nothing for me. As of now my entire tank is off.
rimai
Posts: 12881
Joined: Fri Mar 18, 2011 6:47 pm

Re: update

Post by rimai »

That is just an internal memory file to initialize memory.
This is our way to force everyone to upload an internal memory file at least once.
Most people were not doing that and getting all sorts of odd behaviors from uninitialized memory.
By forcing everyone to do this, we ensure the controller has known values in the memory.
The code will do absolutely nothing but write values in the memory.
You can now load your code and it will go past the "No Internal Memory Found" message.
Roberto.
Seedlessone
Posts: 135
Joined: Tue Jan 24, 2012 6:20 pm

Re: update

Post by Seedlessone »

that is what I thought was going on but still not working. I tried to upload my internal memory again and still getting the same error. class ra_nokialcd has no member named lcd_init
rimai
Posts: 12881
Joined: Fri Mar 18, 2011 6:47 pm

Re: update

Post by rimai »

You can't upload your old memory file. The libraries have changed and your old memory file needs to be updated. You can use the one I mentioned earlier, which is made for the new libraries.
Either the one in the example code, wait for Curt to fix the bug on RAGen so you can generate a new one or update your old one.
If the code you posted above is your old file, it needs to be updated to this:

Code: Select all

#include <ReefAngel_Features.h>
#include <Globals.h>
#include <Time.h>
#include <OneWire.h>
#include <RA_NokiaLCD.h>
#include <avr/pgmspace.h>
#include <InternalEEPROM.h>
#include <Wire.h>
#include <Memory.h>

RA_NokiaLCD e;

void setup()
{
    e.Init();
    e.Clear(COLOR_WHITE,0,0,132,132);
    e.BacklightOn();
    InternalMemory.MHOnHour_write(8);
    InternalMemory.MHOnMinute_write(0);
    InternalMemory.MHOffHour_write(15);
    InternalMemory.MHOffMinute_write(0);
    InternalMemory.MHDelay_write(5);
    InternalMemory.StdLightsOnHour_write(8);
    InternalMemory.StdLightsOnMinute_write(0);
    InternalMemory.StdLightsOffHour_write(15);
    InternalMemory.StdLightsOffMinute_write(0);
    InternalMemory.DP1OnHour_write(20);
    InternalMemory.DP1OnMinute_write(0);
    InternalMemory.DP2OnHour_write(22);
    InternalMemory.DP2OnMinute_write(30);
    InternalMemory.DP1Timer_write(10);
    InternalMemory.DP2Timer_write(10);
    InternalMemory.DP1RepeatInterval_write(60);
    InternalMemory.DP2RepeatInterval_write(60);
    InternalMemory.ATOTimeout_write(60);
    InternalMemory.ATOHighTimeout_write(60);
    InternalMemory.ATOHourInterval_write(0);
    InternalMemory.ATOHighHourInterval_write(0);
    InternalMemory.FeedingTimer_write(900);
    InternalMemory.LCDTimer_write(600);
    InternalMemory.LEDPWMActinic_write(50);
    InternalMemory.LEDPWMDaylight_write(50);
    InternalMemory.WM1Timer_write(200);
    InternalMemory.WM2Timer_write(354);
    InternalMemory.HeaterTempOn_write(780);
    InternalMemory.HeaterTempOff_write(791);
    InternalMemory.ChillerTempOn_write(810);
    InternalMemory.ChillerTempOff_write(785);
    InternalMemory.OverheatTemp_write(1500);
    InternalMemory.PHMax_write(840);
    InternalMemory.PHMin_write(550);
    InternalMemory.SalMax_write(2550);
    InternalMemory.RFMode_write(Constant);
    InternalMemory.RFSpeed_write(140);
    InternalMemory.RFDuration_write(8);
    InternalMemory.RFDuration_write(8);
    InternalMemory.PWMSlopeStartD_write(15);
    InternalMemory.PWMSlopeEndD_write(128);
    InternalMemory.PWMSlopeDurationD_write(60);
    InternalMemory.PWMSlopeStartA_write(15);
    InternalMemory.PWMSlopeEndA_write(128);
    InternalMemory.PWMSlopeDurationA_write(60);
    InternalMemory.IMCheck_write(0x5241494D);
}

void loop()
{
    // display the values
    char buf[128];
    sprintf(buf, "MH %2d:%02d-%2d:%02d,%d", InternalMemory.MHOnHour_read(), InternalMemory.MHOnMinute_read(),
                                         InternalMemory.MHOffHour_read(), InternalMemory.MHOffMinute_read(),
                                         InternalMemory.MHDelay_read());
    e.DrawText(COLOR_BLACK, COLOR_WHITE, MENU_START_COL, MENU_START_ROW, buf);
    sprintf(buf, "Std %2d:%02d-%2d:%02d", InternalMemory.StdLightsOnHour_read(), InternalMemory.StdLightsOnMinute_read(),
                                          InternalMemory.StdLightsOffHour_read(), InternalMemory.StdLightsOffMinute_read());
    e.DrawText(COLOR_BLACK, COLOR_WHITE, MENU_START_COL, MENU_START_ROW*2, buf);
    sprintf(buf, "LED A: %d%% D: %d%%", InternalMemory.LEDPWMActinic_read(), InternalMemory.LEDPWMDaylight_read());
    e.DrawText(COLOR_BLACK, COLOR_WHITE, MENU_START_COL, MENU_START_ROW*3, buf);
    sprintf(buf, "WM1: %ds", InternalMemory.WM1Timer_read());
    e.DrawText(COLOR_BLACK, COLOR_WHITE, MENU_START_COL, MENU_START_ROW*4, buf);
    sprintf(buf, "WM2: %ds", InternalMemory.WM2Timer_read());
    e.DrawText(COLOR_BLACK, COLOR_WHITE, MENU_START_COL, MENU_START_ROW*5, buf);
    sprintf(buf, "F: %ds", InternalMemory.FeedingTimer_read());
    e.DrawText(COLOR_BLACK, COLOR_WHITE, MENU_START_COL, MENU_START_ROW*6, buf);
    sprintf(buf, "S: %ds", InternalMemory.LCDTimer_read());
    e.DrawText(COLOR_BLACK, COLOR_WHITE, MENU_START_COL, MENU_START_ROW*7, buf);
    sprintf(buf, "H On: %d -> %d", InternalMemory.HeaterTempOn_read(), InternalMemory.HeaterTempOff_read());
    e.DrawText(COLOR_BLACK, COLOR_WHITE, MENU_START_COL, MENU_START_ROW*9, buf);
    sprintf(buf, "C On: %d -> %d", InternalMemory.ChillerTempOn_read(), InternalMemory.ChillerTempOff_read());
    e.DrawText(COLOR_BLACK, COLOR_WHITE, MENU_START_COL, MENU_START_ROW*10, buf);
    sprintf(buf, "PH %d - %d", InternalMemory.PHMax_read(), InternalMemory.PHMin_read());
    e.DrawText(COLOR_BLACK, COLOR_WHITE, MENU_START_COL, MENU_START_ROW*11, buf);

    delay(10000);
    e.Clear(COLOR_WHITE,0,0,132,132);

    sprintf(buf, "OH: %dF", InternalMemory.OverheatTemp_read());
    e.DrawText(COLOR_BLACK, COLOR_WHITE, MENU_START_COL, MENU_START_ROW, buf);
    sprintf(buf, "ATO L: %ds (%dh)", InternalMemory.ATOTimeout_read(), InternalMemory.ATOHourInterval_read());
    e.DrawText(COLOR_BLACK, COLOR_WHITE, MENU_START_COL, MENU_START_ROW*2, buf);
    sprintf(buf, "ATO H: %ds (%dh)", InternalMemory.ATOHighTimeout_read(), InternalMemory.ATOHighHourInterval_read());
    e.DrawText(COLOR_BLACK, COLOR_WHITE, MENU_START_COL, MENU_START_ROW*3, buf);

    sprintf(buf, "DP1: %2d:%02d", InternalMemory.DP1OnHour_read(), InternalMemory.DP1OnMinute_read());
    e.DrawText(COLOR_BLACK, COLOR_WHITE, MENU_START_COL, MENU_START_ROW*5, buf);
    sprintf(buf, "     %ds", InternalMemory.DP1Timer_read());
    e.DrawText(COLOR_BLACK, COLOR_WHITE, MENU_START_COL, MENU_START_ROW*6, buf);
    sprintf(buf, "DP2: %2d:%02d", InternalMemory.DP2OnHour_read(), InternalMemory.DP2OnMinute_read());
    e.DrawText(COLOR_BLACK, COLOR_WHITE, MENU_START_COL, MENU_START_ROW*7, buf);
    sprintf(buf, "     %ds", InternalMemory.DP2Timer_read());
    e.DrawText(COLOR_BLACK, COLOR_WHITE, MENU_START_COL, MENU_START_ROW*8, buf);

    delay(10000);
    e.Clear(COLOR_WHITE,0,0,132,132);
}
Roberto.
Seedlessone
Posts: 135
Joined: Tue Jan 24, 2012 6:20 pm

Re: update

Post by Seedlessone »

Okay got it somewhat figured out. Lights are not on for some reason still. The fuge light is the only light on.

Also getting a netframe work issue when trying to launch the service dash in the RA Client.

Iphone app getting an error which blocks me from using "modes". It tells me to update to v8.5.1.9.

Just letting you know of a few things I finding.

LOL you ready for me to leave you alone yet?
Last edited by Seedlessone on Wed Feb 15, 2012 5:15 pm, edited 1 time in total.
rimai
Posts: 12881
Joined: Fri Mar 18, 2011 6:47 pm

Re: update

Post by rimai »

It's much easier to do it over wifi using one of the smart phone apps or Client.
But if you really want to use the controller, you can always put date/time back into the features and load a smaller code and the remove date/time and load your code back.
For RA Client, you need .Net 3.5 and 4 installed in your computer.
Roberto.
Seedlessone
Posts: 135
Joined: Tue Jan 24, 2012 6:20 pm

Re: update

Post by Seedlessone »

Date and time are acutally still showing on my controllers LCD. So now Im really unsure why my lights are not on schedule.

Netframe 3.5 and 4 are installed. Everything was working prior to the update.
binder
Posts: 2871
Joined: Fri Mar 18, 2011 6:20 pm
Location: Illinois
Contact:

Re: update

Post by binder »

Post Reply