Controller freez

Related to the development libraries, released by Curt Binder
Post Reply
User avatar
JNieuwenhuizen
Posts: 96
Joined: Thu Feb 16, 2012 12:39 am
Location: South Africa

Controller freez

Post by JNieuwenhuizen »

Hi.

I have a little problem. My controller boots up, and then the screen flashes and the red led blinks.

I cannot go to any menu

here is my code

Code: Select all

// Autogenerated file by RAGen (v1.2.1.158), (03/29/2012 21:11)
// RA_032912_2111.ino
//
// This version designed for v0.9.0 or later

/* The following features are enabled for this File: 
#define DateTimeSetup
#define VersionMenu
#define DirectTempSensor
#define wifi
#define SaveRelayState
#define RelayExp
#define InstalledRelayExpansionModules 1
#define CUSTOM_MENU
#define CUSTOM_MENU_ENTRIES 1
#define CUSTOM_MAIN
#define COLORS_PDE
#define ENABLE_EXCEED_FLAGS
#define SALINITYEXPANSION
#define RFEXPANSION
#define IOEXPANSION
#define FONT_8x8
*/


#include <ReefAngel_Features.h>
#include <RA_Colors.h>
#include <RA_CustomColors.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 <Salinity.h>
#include <RF.h>
#include <IO.h>
#include <ReefAngel.h>


#include <avr/pgmspace.h>
prog_char menu0_label[] PROGMEM = "Item 1";
PROGMEM const char *menu_items[] = {
menu0_label  };

void MenuEntry1()
{
    ReefAngel.DisplayMenuEntry("Item 1");
}

void setup()
{
    ReefAngel.Init();  //Initialize controller
    ReefAngel.InitMenu(pgm_read_word(&(menu_items[0])),SIZE(menu_items));
    ReefAngel.SetTemperatureUnit(1);  // set to Celsius Temperature

    ReefAngel.FeedingModePorts = 0;
    ReefAngel.WaterChangePorts = Port1Bit | Port2Bit | Port3Bit | Port6Bit;
    ReefAngel.OverheatShutoffPorts = Port6Bit;
    ReefAngel.LightsOnPorts = 0;

    // Ports that are always on
    ReefAngel.Relay.On(Port1);
    ReefAngel.Relay.On(Port4);
    ReefAngel.Relay.On(Port7);
    ReefAngel.Relay.On(Port8);
    ReefAngel.Relay.On(Box1_Port1);
    ReefAngel.Relay.On(Box1_Port2);
    ReefAngel.Relay.On(Box1_Port6);
    ReefAngel.Relay.On(Box1_Port7);
    ReefAngel.Relay.On(Box1_Port8);

}

void loop()
{
    // Specific functions
    ReefAngel.Relay.DelayedOn(Port2, 1);
    ReefAngel.StandardATO(Port3);
    ReefAngel.MoonLights(Port5);
    ReefAngel.StandardHeater(Port6);
    ReefAngel.Portal("Jnieuwenhuizen");
    ReefAngel.ShowInterface();
    ReefAngel.Refresh();

 }

//*********************************************************************************************************************************
//Custom Main, Graph & Menu
void DrawCustomMain()
{
  
  
  byte x = 6;
  byte y = 2;
  byte t;
  char text[7];
  byte vtechmode;
  
  ReefAngel.LCD.DrawDate(6, 2);
  ReefAngel.LCD.Clear(COLOR_BLACK, 1, 11, 132, 11);
  pingSerial();

  ReefAngel.LCD.DrawText(0,255,18,12,"EcoSmart Vortech");
  vtechmode=ReefAngel.RF.Mode;
  if (vtechmode == 0) ReefAngel.LCD.DrawLargeText(COLOR_LIMEGREEN,255,35,22,"Constant");
  else if(vtechmode == 1) ReefAngel.LCD.DrawLargeText(COLOR_GOLD,255,42,21,"Lagoon");
  else if (vtechmode == 2) ReefAngel.LCD.DrawLargeText(COLOR_GOLD,255,25,21,"Reef Crest");
  else if (vtechmode == 3) ReefAngel.LCD.DrawLargeText(COLOR_CORNFLOWERBLUE,255,22,21,"Short Pulse");
  else if (vtechmode == 4) ReefAngel.LCD.DrawLargeText(COLOR_PINK,255,25,21,"Long Pulse");
  else if (vtechmode == 5) ReefAngel.LCD.DrawLargeText(COLOR_MAGENTA,255,8,21,"Nutrient Trnsp.");
  else if (vtechmode == 6) ReefAngel.LCD.DrawLargeText(COLOR_MAGENTA,255,23,21,"Tidal Swell");
  else if (vtechmode == 9) ReefAngel.LCD.DrawLargeText(COLOR_WHITE,0,45,21,"Night");

  ReefAngel.LCD.DrawText(0,255,10,30,"Display");
  ConvertNumToString(text, ReefAngel.Params.Temp[T1_PROBE], 10);
  ReefAngel.LCD.DrawLargeText(COLOR_INDIANRED, 255, 10, 40, text, Num8x8);
  pingSerial();

  ReefAngel.LCD.DrawText(0,255,100,30,"pH");
  ConvertNumToString(text, ReefAngel.Params.PH, 100);
  ReefAngel.LCD.DrawLargeText(COLOR_PLUM, 255, 85, 40, text, Num8x8);
  pingSerial();

  ReefAngel.LCD.DrawText(0,255,43,48,"Salinity");
  ConvertNumToString(text, ReefAngel.Params.Salinity, 100);
  ReefAngel.LCD.DrawLargeText(COLOR_LIMEGREEN, 255, 49, 58, text, Num8x8);
  pingSerial();

  pingSerial();
  byte TempRelay = ReefAngel.Relay.RelayData;
  TempRelay &= ReefAngel.Relay.RelayMaskOff;
  TempRelay |= ReefAngel.Relay.RelayMaskOn;
  ReefAngel.LCD.DrawOutletBox(12, 77, TempRelay);

  pingSerial();
  TempRelay = ReefAngel.Relay.RelayDataE[0];
  TempRelay &= ReefAngel.Relay.RelayMaskOffE[0];
  TempRelay |= ReefAngel.Relay.RelayMaskOnE[0];
  ReefAngel.LCD.DrawOutletBox(12, 89, TempRelay);
  
  
  ReefAngel.LCD.DrawText(0,255,70,68,"Room");
  ReefAngel.LCD.DrawSingleMonitor(ReefAngel.Params.Temp[T2_PROBE], COLOR_CORNFLOWERBLUE, 99, 68, 10);
}
void DrawCustomGraph()
{
}
Any help please?
Last edited by JNieuwenhuizen on Thu Mar 29, 2012 1:54 pm, edited 1 time in total.
User avatar
jsclownfish
Posts: 375
Joined: Mon Oct 24, 2011 7:52 pm
Location: Saint Louis

Re: Controller freez

Post by jsclownfish »

Not sure if this is it or not, but I have changed these 0's to 1's in my ino file.

Code: Select all

prog_char menu0_label[] PROGMEM = "Item 1";
PROGMEM const char *menu_items[] = {
menu0_label  };
to

Code: Select all

prog_char menu1_label[] PROGMEM = "Item 1";
PROGMEM const char *menu_items[] = {
menu1_label  };
-Jon
User avatar
JNieuwenhuizen
Posts: 96
Joined: Thu Feb 16, 2012 12:39 am
Location: South Africa

Re: Controller freez

Post by JNieuwenhuizen »

Thank You, did not solve it, had to unplug everything and start again.

At least it does not freeze now
Sebyte

Re: Controller freez

Post by Sebyte »

You might try putting

ReefAngel.Portal("Jnieuwenhuizen");
ReefAngel.ShowInterface();

At the bottom of the loop. I had a problem similar to what you are saying, and it appeared to be this.
binder
Posts: 2865
Joined: Fri Mar 18, 2011 6:20 pm
Location: Illinois
Contact:

Re: Controller freez

Post by binder »

you do not need the:

Code: Select all

ReefAngel.Refresh();
line in there. That is called inside ShowInterface().
User avatar
JNieuwenhuizen
Posts: 96
Joined: Thu Feb 16, 2012 12:39 am
Location: South Africa

Re: Controller freez

Post by JNieuwenhuizen »

Thany you for the help - It was my expansion hub that made the controler freez-up
Post Reply