Display freeze

New members questions
Post Reply
Elevatorguy1
Posts: 42
Joined: Wed Apr 17, 2013 6:21 pm

Display freeze

Post by Elevatorguy1 »

Hello,

Just got my RA up and running on my tank and have a problem with the display. Within the first hour of it running the display froze. I could see the info on the display but could not get to the main menu. I unplugged the head unit and plugged it back in and all was normal. Temp, PH and time were updated. Then before the lights turned off the display froze again but this time it was upside down and reversed like looking at it through a mirror. Unplugged the head unit again and back to normal. Another funny thing that happened was when the display lights turned off they came back on for a very second then off then on then off. When that happened the light in my sump fuge did the same and then came on. Came home this evening and the display was frozen again. It stopped at 8:25am. Reset the head unit and now the display is upside down and reversed like looking at it through a mirror.

Here is my current code. Maybe I have something wrong?
#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
    ReefAngel.AddStandardMenu(); // Add Standard Menu

    // Ports toggled in Feeding Mode
    ReefAngel.FeedingModePorts = 0;
    // Ports toggled in Water Change Mode
    ReefAngel.WaterChangePorts = 0;
    // Ports toggled when Lights On / Off menu entry selected
    ReefAngel.LightsOnPorts = Port1Bit | Port3Bit | Port4Bit | Port8Bit;
    // Ports turned off when Overheat temperature exceeded
    ReefAngel.OverheatShutoffPorts = 0;
    // Use T1 probe as temperature and overheat functions
    ReefAngel.TempProbe = T1_PROBE;
    ReefAngel.OverheatProbe = T1_PROBE;
    // Set the Overheat temperature setting
    InternalMemory.OverheatTemp_write( 869 );


    // Ports that are always on

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

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

void loop()
{
    ReefAngel.StandardLights( Port1,22,30,13,30 ); //*sump fuge light
    ReefAngel.StandardLights( Port2,13,30,22,30 ); //*top fuge light
    ReefAngel.StandardLights( Port3,13,30,22,30 ); //*Actinic
    ReefAngel.StandardLights( Port4,13,30,22,30 ); //*Daylight
    ReefAngel.DosingPumpRepeat( Port5,0,720,60 ); //*kalk reactor
    ReefAngel.StandardATO( Port6,6000 ); //*Fresh water solenoid
    ReefAngel.StandardHeater( Port7,775,785 );
    ReefAngel.StandardLights( Port8,13,30,22,30 ); //*Light fan
    ReefAngel.PWM.SetDaylight( PWMSlope(13,30,22,30,5,60,30,5) );
    ReefAngel.PWM.SetActinic( PWMSlope(13,30,22,30,5,70,30,5) );
    ////// Place your custom code below here
    

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

    // This should always be the last line
    ReefAngel.ShowInterface();
}
void DrawCustomMain()
    {
      byte x;
      byte y = 2;
      char text[7];

    
     
      ReefAngel.LCD.DrawText(DefaultFGColor, DefaultBGColor, 30, 2, "Gonzo's Reef"); // Put a banner at the top
      ReefAngel.LCD.DrawDate(6, 119); // Put the date and time at the bottom
      ReefAngel.LCD.Clear(COLOR_BLACK, 1, 11, 132, 11); // Draw a black line under the banner
      x = 12;
      y += MENU_START_ROW+1; // MENU_START_ROW is 10, according to globals.h, so y=2+10+1=13
      ReefAngel.LCD.DrawText(COLOR_BLUE, COLOR_WHITE, x, y+6, "Tank Temp pH");
      ConvertNumToString(text, ReefAngel.Params.PH, 100); // Get pH reading and convert
      ReefAngel.LCD.DrawLargeText(PHColor, DefaultBGColor, x+75, y+18, text, Font8x16); // Put pH on the screen
      ConvertNumToString(text, ReefAngel.Params.Temp[T1_PROBE], 10); // Get T1 temp and convert
      y += MENU_START_ROW*2;
      x = 10;
      ReefAngel.LCD.DrawHugeNumbers(COLOR_WHITE, COLOR_BLACK, x, y, text); // Draw the temperature, white numbers on a colored background
      x += (16*4) + 8;
      ReefAngel.LCD.DrawText(DPColor,DefaultBGColor,8,y+25,"White %");
      ReefAngel.LCD.DrawSingleMonitor(ReefAngel.PWM.GetDaylightValue(), DPColor, 24, y+35, 1); // Draw the white light %
      ReefAngel.LCD.DrawText(APColor,DefaultBGColor,x+8,y+25,"Blue %");
      ReefAngel.LCD.DrawSingleMonitor(ReefAngel.PWM.GetActinicValue(), APColor, x+24, y+35, 1); // Draw the blue light %

      // Code for drawing the relay box
     byte TempRelay = ReefAngel.Relay.RelayData;
  TempRelay &= ReefAngel.Relay.RelayMaskOff;
  TempRelay |= ReefAngel.Relay.RelayMaskOn;
  ReefAngel.LCD.DrawOutletBox(12, 92, TempRelay);
    }

void DrawCustomGraph()
{
}        

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

Re: Display freeze

Post by rimai »

Roberto.
Elevatorguy1
Posts: 42
Joined: Wed Apr 17, 2013 6:21 pm

Re: Display freeze

Post by Elevatorguy1 »

Thanks Roberto.

Looks like I do. The display has the tan tab.
Elevatorguy1
Posts: 42
Joined: Wed Apr 17, 2013 6:21 pm

Re: Display freeze

Post by Elevatorguy1 »

Would the display cause the lights to flicker?
ufgators2k
Posts: 57
Joined: Sun May 12, 2013 2:21 pm

Re: Display freeze

Post by ufgators2k »

I just had the same issue (display freeze, upside down). I also had a white screen a few days ago. Here is my code:

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

////// Place global variable code below here

// Needs to be global for DrawCustomGraph()
int ScreenID=1;

// Custom Menu setup
#include <avr/pgmspace.h>
prog_char menu1_label[] PROGMEM = "Water Change";
prog_char menu2_label[] PROGMEM = "Refugium Light On/Off";
prog_char menu3_label[] PROGMEM = "Skimmer On/Off";
prog_char menu4_label[] PROGMEM = "ATO Clear";
prog_char menu5_label[] PROGMEM = "Overheat Clear";
prog_char menu6_label[] PROGMEM = "PH Calibration";
prog_char menu7_label[] PROGMEM = "Date / Time";

// Group the menu entries together
PROGMEM const char *menu_items[] = {
menu1_label, menu2_label, menu3_label,
menu4_label, menu5_label, menu6_label,
menu7_label
};

// Define Relay Ports by Name
// Port 1 - ATO
// Port 2 - Fuge Light
// Port 3 - Actinic Light
// Port 4 - Daylight
// Port 5 - Power Head
// Port 6 - Return Pump
// Port 7 - Heater
// Port 8 - Skimmer

#define Ato                1
#define Refugium           2
#define BlueLEDs           3
#define WhiteLEDs          4
#define PowerHead          5
#define ReturnPump         6
#define Heater             7
#define Skimmer            8
////// Place global variable code above here

void setup()
{
    // This must be the first line
    ReefAngel.Init();  //Initialize controller
    //ReefAngel.AddStandardMenu();  // Add Standard Menu
    ReefAngel.InitMenu(pgm_read_word(&(menu_items[0])),SIZE(menu_items)); // Initialize Menu
    // Ports toggled in Feeding Mode
    ReefAngel.FeedingModePorts = 0;
    // Ports toggled in Water Change Mode - turn off ATO/Power Head/Return Pump
    ReefAngel.WaterChangePorts = Port1Bit | Port5Bit | Port6Bit;
    // Ports toggled when Lights On / Off menu entry selected - Actinic/Daylight
    ReefAngel.LightsOnPorts = Port3Bit | Port4Bit;
    // Ports turned off when Overheat temperature exceeded
    ReefAngel.OverheatShutoffPorts = Port2Bit | Port3Bit | Port4Bit | Port7Bit;
    // Use T1 probe as temperature and overheat functions
    ReefAngel.TempProbe = T1_PROBE;
    ReefAngel.OverheatProbe = T1_PROBE;
    // Set the Overheat temperature setting
    InternalMemory.OverheatTemp_write( 825 );


    // Ports that are always on
    ReefAngel.Relay.On( Port5 ); // Power head
    ReefAngel.Relay.On( Port6 ); // Return Pump
    ReefAngel.Relay.On( Port8 ); // Skimmer

    ////// Place additional initialization code below here
    ReefAngel.PHMin=576;
    ReefAngel.PHMax=839;

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

void loop()
{
    ReefAngel.StandardLights( Port2,20,30,10,0 );
    ReefAngel.StandardLights( Port3,10,30,20,30 );
    ReefAngel.StandardLights( Port4,11,0,19,45 );
    ReefAngel.StandardHeater( Port7,755,770 );
    //ReefAngel.PWM.SetDaylight( PWMParabola(11,0,20,0,10,100,10) );
    //ReefAngel.PWM.SetActinic( PWMParabola(9,0,20,0,10,100,10) );
    
    ////// Place your custom code below here
    // Use one float sensor (ATOLow) for the return section and one
    // for the ATO reservoir (ATOHigh)
    ReefAngel.SingleATO(true,Port1,45,0);
    if (ReefAngel.HighATO.IsActive()) 
    {
      ReefAngel.Relay.Off(Port1);
    }
    
    ////// Place your custom code above here

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

// Custom Main Menu
// Menu Code
void MenuEntry1() {
  ReefAngel.WaterChangeModeStart();
}
void MenuEntry2() {
  // Toggle refugium light between on/auto.
  ReefAngel.Relay.Override(Refugium, ReefAngel.Relay.Status(Refugium)+1);
  ReefAngel.DisplayedMenu = RETURN_MAIN_MODE;
}
void MenuEntry3() {
  // Toggle skimmer on/off.
  ReefAngel.Relay.Toggle(Skimmer);
  ReefAngel.DisplayedMenu = RETURN_MAIN_MODE;
}
void MenuEntry4() {
  ReefAngel.OverheatClear();
  ReefAngel.DisplayMenuEntry("Clear Overheat");
}
void MenuEntry5() {
  ReefAngel.ATOClear();
  ReefAngel.DisplayMenuEntry("Clear ATO Timeout");
}
void MenuEntry6() {
  ReefAngel.SetupCalibratePH();
  ReefAngel.DisplayedMenu = ALT_SCREEN_MODE;
}
void MenuEntry7() {
  ReefAngel.SetupDateTime();
  ReefAngel.DisplayedMenu = ALT_SCREEN_MODE;  
}
// Custom Main Screen
void DrawCustomMain() {
  const int NumScreens=2;
  static boolean drawGraph=true;
  
  // Main Header
  ReefAngel.LCD.DrawText(DefaultFGColor, DefaultBGColor, 28, 2,"Kopman's Reef");
  ReefAngel.LCD.Clear(COLOR_BLACK, 1, 11, 128, 11);

  // Param Header
  DrawParams(5,14);
  
  switch (ScreenID) {
    case 0: 
    {
      if (drawGraph) { ReefAngel.LCD.DrawGraph(5,40); drawGraph=false; }
      break;
    }
    case 1: { DrawStatus(5,40); break; }
  }
  ReefAngel.LCD.DrawDate(4,122);
  // Draw Relays
  DrawRelays(12,94);

  if (ReefAngel.Joystick.IsLeft()) {
    ReefAngel.ClearScreen(DefaultBGColor);
    ScreenID--; drawGraph=true;
  }
  if (ReefAngel.Joystick.IsRight()) {
    ReefAngel.ClearScreen(DefaultBGColor);
    ScreenID++; drawGraph=true;
  }
  if (ScreenID<0) ScreenID=NumScreens-1;
  if (ScreenID>=NumScreens) ScreenID=0; 
  
}

void DrawCustomGraph() {
  if (ScreenID==0)
    ReefAngel.LCD.DrawGraph(5, 40);
}

void DrawParams(int x, int y) {
  char buf[16];

  ReefAngel.LCD.DrawText(COLOR_BLACK,DefaultBGColor,x+5,y,"Temp:");
  ReefAngel.LCD.DrawText(COLOR_BLACK,DefaultBGColor,x+80, y, "PH:");
  // Temp and PH
  y+=2;
  ConvertNumToString(buf, ReefAngel.Params.Temp[T2_PROBE], 10);
  ReefAngel.LCD.DrawText(T2TempColor, DefaultBGColor, x+45, y, buf);
  y+=6; 
  ConvertNumToString(buf, ReefAngel.Params.Temp[T1_PROBE], 10);
  ReefAngel.LCD.DrawLargeText(T1TempColor, DefaultBGColor, x+5, y, buf, Num8x16);
  ConvertNumToString(buf, ReefAngel.Params.PH, 100);
  ReefAngel.LCD.DrawLargeText(PHColor, DefaultBGColor, x+80, y, buf, Num8x16);
  y+=5;
  ConvertNumToString(buf, ReefAngel.Params.Temp[T3_PROBE], 10);
  ReefAngel.LCD.DrawText(T3TempColor, DefaultBGColor, x+45, y, buf);
}

void DrawStatus(int x, int y) {
  int t=x;
  ReefAngel.LCD.DrawText(COLOR_BLACK,DefaultBGColor,30,y,"ATO Status"); 
  ReefAngel.LCD.DrawLargeText(COLOR_INDIGO,DefaultBGColor,15,y+10,"Resv",Font8x16);
  ReefAngel.LCD.DrawLargeText(COLOR_INDIGO,DefaultBGColor,85,y+10,"Sump",Font8x16);
  
  if (ReefAngel.HighATO.IsActive()) { // ATO reservoir is empty
    ReefAngel.LCD.FillCircle(55,y+15,5,COLOR_RED);
  } else {
    ReefAngel.LCD.FillCircle(55,y+15,5,COLOR_GREEN);
  }
  
  if (ReefAngel.LowATO.IsActive()) { // Return pump water level is low
    ReefAngel.LCD.FillCircle(70,y+15,5,COLOR_RED);
  } else {
    ReefAngel.LCD.FillCircle(70,y+15,5,COLOR_GREEN);
  }
  y+=25;
  ReefAngel.LCD.DrawText(COLOR_BLACK,DefaultBGColor,15,y,"Heater Status");
  if (ReefAngel.Relay.Status(Heater) == 1) {
    ReefAngel.LCD.FillCircle(105,y+2,5,COLOR_GREEN);
  } else {
    ReefAngel.LCD.FillCircle(105,y+2,5,COLOR_RED);
  }
  // Display Water level
  //ReefAngel.LCD.DrawText(DefaultFGColor,DefaultBGColor,x,y,"AT0 Level:"); x+=65;
  //ReefAngel.LCD.DrawSingleMonitor(ReefAngel.WaterLevel.GetLevel(),DPColor,x,y,1);
  //x+=5*(intlength(ReefAngel.WaterLevel.GetLevel())+1);
  //ReefAngel.LCD.DrawText(DPColor, DefaultBGColor, x, y, "%");
  //y+=12; x=t;
}

void DrawRelays(int x, int y) {
  // Draw Relays
  byte TempRelay = ReefAngel.Relay.RelayData;
  TempRelay &= ReefAngel.Relay.RelayMaskOff;
  TempRelay |= ReefAngel.Relay.RelayMaskOn;
  ReefAngel.LCD.DrawOutletBox(x, y, TempRelay);
}
Image
rimai
Posts: 12857
Joined: Fri Mar 18, 2011 6:47 pm

Re: Display freeze

Post by rimai »

Did you check which gen screen you have?
Roberto.
ufgators2k
Posts: 57
Joined: Sun May 12, 2013 2:21 pm

Re: Display freeze

Post by ufgators2k »

I haven't opened the device yet however I did just purchase it last month. I'll check it tonight.
Image
ufgators2k
Posts: 57
Joined: Sun May 12, 2013 2:21 pm

Re: Display freeze

Post by ufgators2k »

It looks like it is a gen 3 screen
Image
rimai
Posts: 12857
Joined: Fri Mar 18, 2011 6:47 pm

Re: Display freeze

Post by rimai »

Which libraries are you running?
Roberto.
ufgators2k
Posts: 57
Joined: Sun May 12, 2013 2:21 pm

Re: Display freeze

Post by ufgators2k »

1.0.7
Image
ufgators2k
Posts: 57
Joined: Sun May 12, 2013 2:21 pm

Re: Display freeze

Post by ufgators2k »

As a note I don't have the ID line in my code but I believe you said 1.0.6 fixed that.
Image
rimai
Posts: 12857
Joined: Fri Mar 18, 2011 6:47 pm

Re: Display freeze

Post by rimai »

I think we need to change that screen then. Please PM for RMA.
Roberto.
ufgators2k
Posts: 57
Joined: Sun May 12, 2013 2:21 pm

Re: Display freeze

Post by ufgators2k »

I PM'd you but I think it is stuck in my outbox.
Image
User avatar
lnevo
Posts: 5422
Joined: Fri Jul 20, 2012 9:42 am

Re: Display freeze

Post by lnevo »

It'll be there till he reads it. No worries.
Post Reply