New computer -> issues...

Do you have a question on how to do something.
Ask in here.
Post Reply
gaberosenfield
Posts: 89
Joined: Thu Mar 08, 2012 5:11 pm
Location: Redwood City, California

New computer -> issues...

Post by gaberosenfield »

I'm trying to get a fairly simple PDE uploaded to a RA+ board. I recently upgraded to a 2020 macbook pro, downloaded the newest libraries and the newest version of arduino. But now I get all kinds of errors when I try to verify my code. What's going on here?

PDE:

Code: Select all

#include <ReefAngel_Features.h>
#include <Globals.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_Wifi.h>
#include <Timer.h>
#include <Memory.h>
#include <InternalEEPROM.h>
#include <RA_Colors.h>
#include <RA_CustomColors.h>
#include <AI.h>
#include <PH.h>
#include <IO.h>
#include <WaterLevel.h>
#include <ReefAngel.h>
#include <avr/pgmspace.h>

//Ports assignment:
//First relay box is for the reef system.
//Port1 - Metal Halide Daylights.
#define lights Port1
//Port2 - AWC drain pump.
#define AWCdrain Port2
//Port3 - AWC fill pump.
#define AWCfill Port3
//Port4 - Chiller, feed pump, & exhaust fans.
#define chiller Port4
//Port5 - Clockwise circulation pumps.
#define clockCirc Port5
//Port6 - Counterclockwise circulation pumps.
#define countCirc Port6
//Port7 - ATO pump.
#define ATOPump Port7
//Port8 - Return pump & skimmer pump.
#define returnPump Port8

//Change these values as needed. They are the threshold values for the low and high temperatures, respectively.
int lowTempWarning = 750; //low temp warning below 75F.
int highTempWarning = 800; //high temp warning above 80F.

//These vairable are used to control the ATO system.
static time_t ATOTimer;
int ATOTimeOut = 100;

//The following variables control when automatic water changes occur.
int AWCHour = 12;
int AWCMinute = 0;

//These variables will be used to keep track of the progress of an AWC.
int AWCCheck = 0;
boolean AWCFail = false;
boolean drained = false;

//This variable will trigger an AWC().
boolean AWC = false;

//This variable will be set to true if a water change has been done since the last midnight and will be set to false at midnight.
boolean AWCToday = false;  

//This vairable will store the current time for comparisons on when to initialize an AWC.
time_t AWCt;

//This variable will be a backup timer for AWC.
static time_t AWCTimer;

//These variables will control how long the AWC pumps should be on (in seconds) in case of float switch failure.
int AWCDrainSecs = 30;
int AWCFillSecs = 30;

//This function will check to make sure the water level in the sump is at the high float before initiating an AWC.
int AWCATOCheck()
{ 
  if (!ReefAngel.Relay.Status(returnPump))  //If the return pump is not on, don't run an AWC and return 0 (false).
    return 0; //Returning zero here is the only way for AWCCheck to equal 0 while AWC equals true. This will cause the AWC process to pause until the return pump is on again.
  
  if (!ReefAngel.HighATO.IsActive()) //If the water level is not at the maximum normal level, run the ATO.
  {
    ATOTimer = now();
    ReefAngel.Relay.On(ATOPump);  //Fill the return section to the high float with RODI.
    AWCToday = true;
    return 2;
  }
  else
  {
    AWCToday = true;
    return 1;
  }
}

//Custom Menu Code
prog_char menu0_label[] PROGMEM = "Feed for 5 Mins";
prog_char menu1_label[] PROGMEM = "Start AWC";
prog_char menu2_label[] PROGMEM = "Clear Alerts & Vars";
prog_char menu3_label[] PROGMEM = "pH Calibration";
prog_char menu4_label[] PROGMEM = "Set Date and Time";
prog_char menu5_label[] PROGMEM = "Toggle Return & Skimmer Pumps";
PROGMEM const char *menu_items[] = {
menu0_label, menu1_label, menu2_label, menu3_label, menu4_label, menu5_label
};
void MenuEntry1()
{
  ReefAngel.FeedingModeStart();
}
void MenuEntry2()
{
  AWCToday = false;
  AWC = true;
}
void MenuEntry3()
{
  //Clear portal variables.
  //ReefAngel.CustomVar[Var_AWCCountTotal] = 0;
  //ReefAngel.CustomVar[Var_AWCCountToday] = 0;
  //ReefAngel.CustomVar[Var_AWCDrainFail] = 0;
  //ReefAngel.CustomVar[Var_AWCFillFail] = 0;
  //ReefAngel.CustomVar[Var_AWCATOFail] = 0;
  
  //Clear AWC control variables.
  AWC = false;
  AWCToday = false;
  AWCFail = false;
  AWCCheck = 0;
  
  //Clear ATO timeout.
  ReefAngel.ATOClear();
  ReefAngel.DisplayMenuEntry("ATO & AWC Variables Cleared");
}
void MenuEntry4()
{
  ReefAngel.StartSetupCalibrateChoicePH();
}
void MenuEntry5()
{
  ReefAngel.SetupDateTime();
}
void MenuEntry6()
{
  ReefAngel.WaterChangeModeStart();
}

void DrawCustomMain()
{
  // the graph is drawn/updated when we exit the main menu & when the parameters are saved
  ReefAngel.LCD.DrawDate(6, 120);

  pingSerial();

  byte mainTempColor;
  //To make changes for each temp sensor, change the value of tempColor to be the appropriate color
  if ( ReefAngel.Params.Temp[T1_PROBE] < lowTempWarning ) { mainTempColor = COLOR_CYAN; }
  else if ( ReefAngel.Params.Temp[T1_PROBE] > highTempWarning ) { mainTempColor = COLOR_RED; }
  else { mainTempColor = COLOR_SEAGREEN; }
  //Display the T1 Main System temperature
  int T1y = 66; //Y-position of T1 probe reading.
  ReefAngel.LCD.DrawText(mainTempColor, DefaultBGColor, 5, T1y, "Tank Temp: ");
  ReefAngel.LCD.DrawSingleMonitor(ReefAngel.Params.Temp[T1_PROBE], mainTempColor, 65, T1y, 10);
  
  //Display the T2 Room temperature
  int T2y = 75; //Y-position of T2 probe reading.
  ReefAngel.LCD.DrawText(COLOR_BLACK, DefaultBGColor, 5, T2y, "Room Temp: ");
  ReefAngel.LCD.DrawSingleMonitor(ReefAngel.Params.Temp[T2_PROBE], COLOR_BLACK, 65, T2y, 10);

  /*byte pHColor;
  //Depending upon the pH, change the value of pHColor to be the appropriate color
  if ( ReefAngel.Params.PH < 790 ) { pHColor = COLOR_YELLOW; }
  else if ( ReefAngel.Params.PH > 810 ) { pHColor = COLOR_MAGENTA; }
  else { pHColor = COLOR_SEAGREEN; }
  //Display the pH starting at 88, 74
  ReefAngel.LCD.DrawText(pHColor, DefaultBGColor, 5, 80, "pH: ");
  ReefAngel.LCD.DrawSingleMonitor(ReefAngel.Params.PH, pHColor, 30, 80, 100);*/
  
  //Display whether the ATO high float switch is active (float away from wires) or inactive (float close to wires)
  byte floatColor; //Text color for ATO reading.
  int ATOy = 84; //Y-position for ATO reading.
  ReefAngel.LCD.Clear(DefaultBGColor, 0,ATOy, 128,ATOy);
  if (ReefAngel.HighATO.IsActive() && !ReefAngel.isATOTimeOut())
  {
    floatColor = COLOR_MEDIUMORCHID;
    ReefAngel.LCD.DrawText(floatColor, DefaultBGColor, 5, ATOy, "Water Level Low");
  }
  else if (!ReefAngel.HighATO.IsActive() && !ReefAngel.isATOTimeOut())
  {
    floatColor = COLOR_SEAGREEN;
    ReefAngel.LCD.DrawText(floatColor, DefaultBGColor, 5, ATOy, "Water Level Normal");
  }
  else {ReefAngel.LCD.DrawText(COLOR_WHITE, COLOR_RED, 5, ATOy, "ATO Failure");}

  pingSerial();

  //Display relay box 1 ports with status at 12,94
  byte TempRelay = ReefAngel.Relay.RelayData;
  TempRelay &= ReefAngel.Relay.RelayMaskOff;
  TempRelay |= ReefAngel.Relay.RelayMaskOn;
  ReefAngel.LCD.DrawOutletBox(12, 94, TempRelay);
}

void DrawCustomGraph()
{
  //Print "Pringle Lab Reef" at the top of the screen
  ReefAngel.LCD.DrawText(DefaultFGColor, DefaultBGColor, 18, 2, "Pringle Lab Reef");
  ReefAngel.LCD.DrawGraph(5,13);
}
////// Place global variable code above here


void setup()
{
  InternalMemory.LCDID_write(1);
  ReefAngel.Init();
  ReefAngel.InitMenu(pgm_read_word(&(menu_items[0])),SIZE(menu_items));
  ReefAngel.UseFlexiblePhCalibration();
  ReefAngel.FeedingModePorts = Port5Bit | Port6Bit; // Turn off Ports 5 & 6 (circulation pumps) when Feeding Mode is activated.
  ReefAngel.WaterChangePorts = Port8Bit;  // Turn off port 8 (return & skimmer pumps) when Water Change Mode is activated
  ReefAngel.Relay.On(returnPump); // Turn on return & skimmer pumps.
  //Initialize portal variables.
  //ReefAngel.CustomVar[Var_AWCCountTotal] = 0;
  //ReefAngel.CustomVar[Var_AWCCountToday] = 0;
  //ReefAngel.CustomVar[Var_AWCFillFail] = 0;
  //ReefAngel.CustomVar[Var_AWCDrainFail] = 0;
  //ReefAngel.CustomVar[Var_AWCATOFail] = 0;
  startupTimer = now();
}

void loop()
{
  //Start an AWC once per day at AWCHour:AWCMinute if an AWC hasn't happened since midnight and there hasn't been an ATO timeout.
  AWCt = now();
  if (!AWCFail && (hour(AWCt) == AWCHour) && (minute(AWCt) == AWCMinute) && !AWCToday && !AWC && !ReefAngel.isATOTimeOut())
  {
    AWC = true;  //Sets the AWC control variable to true.
  }
    
  //Reset the automatic water change variable and AWC and dosing counts every day at midnight.  Also add the day's AWC count to the total AWC count.
  if (hour(AWCt) == 0 && minute(AWCt) == 0 && AWCToday)
  {
    AWCToday = false;
    //ReefAngel.CustomVar[Var_AWCCountTotal] += ReefAngel.CustomVar[Var_AWCCountToday];
    //ReefAngel.CustomVar[Var_AWCCountToday] = 0;
  }
    
  //Start the chain of AWC functions.
  if (AWC && !AWCToday && AWCCheck == 0)
  {
    AWCCheck = AWCATOCheck(); //If AWCATOCheck returns non-zero, it will also set AWCToday to true.
  }
  
  if (AWCCheck == 2)
  {
    if (!ReefAngel.HighATO.IsActive())
    {
      ReefAngel.Relay.Off(ATOPump);
      AWCCheck = 1;
    }
    
    if ((now() - ATOTimer) >= ATOTimeOut)
    {
      ReefAngel.Relay.Off(ATOPump);
      bitSet(ReefAngel.AlertFlags,ATOTimeOutFlag);  //Trigger ATO timeout flag.
      AWCFail = true;
      //ReefAngel.CustomVar[Var_AWCATOFail] = 1;
      AWCCheck = 0;
      AWC = false;
    }
  }
  
  if (AWCCheck == 1 && !ReefAngel.Relay.Status(AWCdrain))
  {
    AWCTimer = now();
    ReefAngel.Relay.On(AWCdrain);
  }
    
  if (ReefAngel.Relay.Status(AWCdrain))
  {
    if (ReefAngel.HighATO.IsActive())
    {
      ReefAngel.Relay.Off(AWCdrain);
      drained = true;
    }
    
    if (now()-AWCTimer >= AWCDrainSecs)
    {
      ReefAngel.Relay.Off(AWCdrain);
      AWCFail = true;
      //ReefAngel.CustomVar[Var_AWCDrainFail] = 1;
      AWCCheck = 0;
      AWC = false;
    }
  }

  if (drained)
  {
    if (!ReefAngel.Relay.Status(AWCfill))
    {
      AWCTimer = now();
      ReefAngel.Relay.On(AWCfill);
    }

    if (ReefAngel.Relay.Status(AWCfill))
    {
      if (!ReefAngel.HighATO.IsActive())
      {
        ReefAngel.Relay.Off(AWCfill);
        drained = false;
        AWC = false;
        AWCCheck = 0;
        //ReefAngel.CustomVar[Var_AWCCountToday] += 1;
      }

      if (now()-AWCTimer >= AWCFillSecs)
      {
        ReefAngel.Relay.Off(AWCfill);
        drained = false;
        AWCFail = true;
        //ReefAngel.CustomVar[Var_AWCFillFail] = 1;
        AWCCheck = 0;
        AWC = false;
      }
    }
  }
  
  //Light Control
  if (ReefAngel.Params.Temp[T1_PROBE] < highTempWarning)
  {
    ReefAngel.StandardLights(lights, 8,00, 18,00); //Lights on at 8 am and off at 6 pm.
  }
  
  //Temp control is handled by the chiller, but it and the lights will be turned off if the temp gets too high.
  if (ReefAngel.Params.Temp[T1_PROBE] >= highTempWarning)
  {
    ReefAngel.Relay.Off(lights);
    ReefAngel.Relay.Off(chiller);
  }
    
  //Wavemaker control
  ReefAngel.WavemakerRandom(clockCirc,30,300); // Turn clockwise circulation pumps on/off random cycles that lasts from 30 to 300 secs.
  ReefAngel.Relay.Set(countCirc,!ReefAngel.Relay.Status(clockCirc)); // Turn counterclockwise circulation pumps on/off on opposite cycle from clockwise circulation pumps.  
    
  //ATO
  if (!AWC) {ReefAngel.SingleATO(false, ATOPump, ATOTimeOut, 0);} //Use single high float switch (false = high) for reef ATO with 100 second timeout and no frequency limit.
  
  ReefAngel.ShowInterface();
}
Errors:

Code: Select all

In file included from /Users/Gabe/Documents/Arduino/Pringle Lab System/Pringle_Lab_Reef_Only_1/Pringle_Lab_Reef_Only_1.ino:2:0:
/Users/Gabe/Documents/Arduino/libraries/Globals/Globals.h:127:7: error: 'prog_char' does not name a type; did you mean 'putchar'?
 const prog_char NoIMCheck[] PROGMEM = "No Internal Memory";
       ^~~~~~~~~
       putchar
/Users/Gabe/Documents/Arduino/libraries/Globals/Globals.h:128:7: error: 'prog_char' does not name a type; did you mean 'putchar'?
 const prog_char NoIMCheck1[] PROGMEM = "Found";
       ^~~~~~~~~
       putchar
In file included from /Users/Gabe/Documents/Arduino/Pringle Lab System/Pringle_Lab_Reef_Only_1/Pringle_Lab_Reef_Only_1.ino:6:0:
/Users/Gabe/Documents/Arduino/libraries/DS1307RTC/DS1307RTC.h:27:19: error: 'tmElements_t' has not been declared
  static void read(tmElements_t &tm);
                   ^~~~~~~~~~~~
/Users/Gabe/Documents/Arduino/libraries/DS1307RTC/DS1307RTC.h:28:20: error: 'tmElements_t' has not been declared
  static void write(tmElements_t &tm);
                    ^~~~~~~~~~~~
In file included from /Users/Gabe/Documents/Arduino/Pringle Lab System/Pringle_Lab_Reef_Only_1/Pringle_Lab_Reef_Only_1.ino:8:0:
/Users/Gabe/Documents/Arduino/libraries/RA_NokiaLCD/RA_NokiaLCD.h:84:64: error: 'prog_uchar' does not name a type; did you mean 'getchar'?
  void DrawImage(int swidth, int sheight, byte x, byte y, const prog_uchar *iPtr);
                                                                ^~~~~~~~~~
                                                                getchar
In file included from /Users/Gabe/Documents/Arduino/Pringle Lab System/Pringle_Lab_Reef_Only_1/Pringle_Lab_Reef_Only_1.ino:14:0:
/Users/Gabe/Documents/Arduino/libraries/RA_Wifi/RA_Wifi.h:31:7: error: 'prog_char' does not name a type; did you mean 'putchar'?
 const prog_char XML_ID[] PROGMEM = "<RA><ID>";
       ^~~~~~~~~
       putchar
/Users/Gabe/Documents/Arduino/libraries/RA_Wifi/RA_Wifi.h:32:7: error: 'prog_char' does not name a type; did you mean 'putchar'?
 const prog_char XML_T1[] PROGMEM = "</ID><T1>";
       ^~~~~~~~~
       putchar
/Users/Gabe/Documents/Arduino/libraries/RA_Wifi/RA_Wifi.h:33:7: error: 'prog_char' does not name a type; did you mean 'putchar'?
 const prog_char XML_T2[] PROGMEM = "</T1><T2>";
       ^~~~~~~~~
       putchar
/Users/Gabe/Documents/Arduino/libraries/RA_Wifi/RA_Wifi.h:34:7: error: 'prog_char' does not name a type; did you mean 'putchar'?
 const prog_char XML_T3[] PROGMEM = "</T2><T3>";
       ^~~~~~~~~
       putchar
/Users/Gabe/Documents/Arduino/libraries/RA_Wifi/RA_Wifi.h:35:7: error: 'prog_char' does not name a type; did you mean 'putchar'?
 const prog_char XML_PH[] PROGMEM = "</T3><PH>";
       ^~~~~~~~~
       putchar
/Users/Gabe/Documents/Arduino/libraries/RA_Wifi/RA_Wifi.h:36:7: error: 'prog_char' does not name a type; did you mean 'putchar'?
 const prog_char XML_R[] PROGMEM = "</PH><R>";
       ^~~~~~~~~
       putchar
/Users/Gabe/Documents/Arduino/libraries/RA_Wifi/RA_Wifi.h:37:7: error: 'prog_char' does not name a type; did you mean 'putchar'?
 const prog_char XML_RON[] PROGMEM = "</R><RON>";
       ^~~~~~~~~
       putchar
/Users/Gabe/Documents/Arduino/libraries/RA_Wifi/RA_Wifi.h:38:7: error: 'prog_char' does not name a type; did you mean 'putchar'?
 const prog_char XML_ROFF[] PROGMEM = "</RON><ROFF>";
       ^~~~~~~~~
       putchar
/Users/Gabe/Documents/Arduino/libraries/RA_Wifi/RA_Wifi.h:39:7: error: 'prog_char' does not name a type; did you mean 'putchar'?
 const prog_char XML_RE_OPEN[] PROGMEM = "<R";
       ^~~~~~~~~
       putchar
/Users/Gabe/Documents/Arduino/libraries/RA_Wifi/RA_Wifi.h:40:7: error: 'prog_char' does not name a type; did you mean 'putchar'?
 const prog_char XML_RE_CLOSE[] PROGMEM = "</R";
       ^~~~~~~~~
       putchar
/Users/Gabe/Documents/Arduino/libraries/RA_Wifi/RA_Wifi.h:41:7: error: 'prog_char' does not name a type; did you mean 'putchar'?
 const prog_char XML_RE_ON[] PROGMEM = "ON";
       ^~~~~~~~~
       putchar
/Users/Gabe/Documents/Arduino/libraries/RA_Wifi/RA_Wifi.h:42:7: error: 'prog_char' does not name a type; did you mean 'putchar'?
 const prog_char XML_RE_OFF[] PROGMEM = "OFF";
       ^~~~~~~~~
       putchar
/Users/Gabe/Documents/Arduino/libraries/RA_Wifi/RA_Wifi.h:43:7: error: 'prog_char' does not name a type; did you mean 'putchar'?
 const prog_char XML_ATOLOW[] PROGMEM = "<ATOLOW>";
       ^~~~~~~~~
       putchar
/Users/Gabe/Documents/Arduino/libraries/RA_Wifi/RA_Wifi.h:44:7: error: 'prog_char' does not name a type; did you mean 'putchar'?
 const prog_char XML_ATOHIGH[] PROGMEM = "</ATOLOW><ATOHIGH>";
       ^~~~~~~~~
       putchar
/Users/Gabe/Documents/Arduino/libraries/RA_Wifi/RA_Wifi.h:45:7: error: 'prog_char' does not name a type; did you mean 'putchar'?
 const prog_char XML_EM[] PROGMEM = "</ATOHIGH><EM>";
       ^~~~~~~~~
       putchar
/Users/Gabe/Documents/Arduino/libraries/RA_Wifi/RA_Wifi.h:46:7: error: 'prog_char' does not name a type; did you mean 'putchar'?
 const prog_char XML_EM1[] PROGMEM = "</EM><EM1>";
       ^~~~~~~~~
       putchar
/Users/Gabe/Documents/Arduino/libraries/RA_Wifi/RA_Wifi.h:47:7: error: 'prog_char' does not name a type; did you mean 'putchar'?
 const prog_char XML_REM[] PROGMEM = "</EM1><REM>";
       ^~~~~~~~~
       putchar
/Users/Gabe/Documents/Arduino/libraries/RA_Wifi/RA_Wifi.h:48:7: error: 'prog_char' does not name a type; did you mean 'putchar'?
 const prog_char XML_BOARDID[] PROGMEM = "</REM><BID>";
       ^~~~~~~~~
       putchar
/Users/Gabe/Documents/Arduino/libraries/RA_Wifi/RA_Wifi.h:49:7: error: 'prog_char' does not name a type; did you mean 'putchar'?
 const prog_char XML_ALERTFLAG[] PROGMEM = "</BID><AF>";
       ^~~~~~~~~
       putchar
/Users/Gabe/Documents/Arduino/libraries/RA_Wifi/RA_Wifi.h:50:7: error: 'prog_char' does not name a type; did you mean 'putchar'?
 const prog_char XML_STATUSFLAG[] PROGMEM = "</AF><SF>";
       ^~~~~~~~~
       putchar
/Users/Gabe/Documents/Arduino/libraries/RA_Wifi/RA_Wifi.h:51:7: error: 'prog_char' does not name a type; did you mean 'putchar'?
 const prog_char XML_STATUSFLAG_END[] PROGMEM = "</SF>";
       ^~~~~~~~~
       putchar
/Users/Gabe/Documents/Arduino/libraries/RA_Wifi/RA_Wifi.h:54:7: error: 'prog_char' does not name a type; did you mean 'putchar'?
 const prog_char XML_PWMA[] PROGMEM = "<PWMA>";
       ^~~~~~~~~
       putchar
/Users/Gabe/Documents/Arduino/libraries/RA_Wifi/RA_Wifi.h:55:7: error: 'prog_char' does not name a type; did you mean 'putchar'?
 const prog_char XML_PWMD[] PROGMEM = "</PWMA><PWMD>";
       ^~~~~~~~~
       putchar
/Users/Gabe/Documents/Arduino/libraries/RA_Wifi/RA_Wifi.h:56:7: error: 'prog_char' does not name a type; did you mean 'putchar'?
 const prog_char XML_PWMAO[] PROGMEM = "</PWMD><PWMAO>";
       ^~~~~~~~~
       putchar
/Users/Gabe/Documents/Arduino/libraries/RA_Wifi/RA_Wifi.h:57:7: error: 'prog_char' does not name a type; did you mean 'putchar'?
 const prog_char XML_PWMDO[] PROGMEM = "</PWMAO><PWMDO>";
       ^~~~~~~~~
       putchar
/Users/Gabe/Documents/Arduino/libraries/RA_Wifi/RA_Wifi.h:58:7: error: 'prog_char' does not name a type; did you mean 'putchar'?
 const prog_char XML_PWMDO_END[] PROGMEM = "</PWMDO>";
       ^~~~~~~~~
       putchar
/Users/Gabe/Documents/Arduino/libraries/RA_Wifi/RA_Wifi.h:154:7: error: 'prog_char' does not name a type; did you mean 'putchar'?
 const prog_char XML_END[] PROGMEM = "</RA>";
       ^~~~~~~~~
       putchar
/Users/Gabe/Documents/Arduino/libraries/RA_Wifi/RA_Wifi.h:155:7: error: 'prog_char' does not name a type; did you mean 'putchar'?
 const prog_char XML_CLOSE_TAG[] PROGMEM = ">";
       ^~~~~~~~~
       putchar
/Users/Gabe/Documents/Arduino/libraries/RA_Wifi/RA_Wifi.h:158:7: error: 'prog_char' does not name a type; did you mean 'putchar'?
 const prog_char XML_P_OPEN[] PROGMEM = "<P";
       ^~~~~~~~~
       putchar
/Users/Gabe/Documents/Arduino/libraries/RA_Wifi/RA_Wifi.h:159:7: error: 'prog_char' does not name a type; did you mean 'putchar'?
 const prog_char XML_P_CLOSE[] PROGMEM = "</P";
       ^~~~~~~~~
       putchar
/Users/Gabe/Documents/Arduino/libraries/RA_Wifi/RA_Wifi.h:160:7: error: 'prog_char' does not name a type; did you mean 'putchar'?
 const prog_char XML_M_OPEN[] PROGMEM = "<M";
       ^~~~~~~~~
       putchar
/Users/Gabe/Documents/Arduino/libraries/RA_Wifi/RA_Wifi.h:161:7: error: 'prog_char' does not name a type; did you mean 'putchar'?
 const prog_char XML_M_CLOSE[] PROGMEM = "</M";
       ^~~~~~~~~
       putchar
/Users/Gabe/Documents/Arduino/libraries/RA_Wifi/RA_Wifi.h:162:7: error: 'prog_char' does not name a type; did you mean 'putchar'?
 const prog_char XML_MEM_OPEN[] PROGMEM = "<MEM>";
       ^~~~~~~~~
       putchar
/Users/Gabe/Documents/Arduino/libraries/RA_Wifi/RA_Wifi.h:163:7: error: 'prog_char' does not name a type; did you mean 'putchar'?
 const prog_char XML_MEM_CLOSE[] PROGMEM = "</MEM>";
       ^~~~~~~~~
       putchar
/Users/Gabe/Documents/Arduino/libraries/RA_Wifi/RA_Wifi.h:164:7: error: 'prog_char' does not name a type; did you mean 'putchar'?
 const prog_char XML_DATE_OPEN[] PROGMEM = "<D>";
       ^~~~~~~~~
       putchar
/Users/Gabe/Documents/Arduino/libraries/RA_Wifi/RA_Wifi.h:165:7: error: 'prog_char' does not name a type; did you mean 'putchar'?
 const prog_char XML_DATE_CLOSE[] PROGMEM = "</D>";
       ^~~~~~~~~
       putchar
/Users/Gabe/Documents/Arduino/libraries/RA_Wifi/RA_Wifi.h:166:7: error: 'prog_char' does not name a type; did you mean 'putchar'?
 const prog_char XML_MODE_OPEN[] PROGMEM = "<MODE>";
       ^~~~~~~~~
       putchar
/Users/Gabe/Documents/Arduino/libraries/RA_Wifi/RA_Wifi.h:167:7: error: 'prog_char' does not name a type; did you mean 'putchar'?
 const prog_char XML_MODE_CLOSE[] PROGMEM = "</MODE>";
       ^~~~~~~~~
       putchar
/Users/Gabe/Documents/Arduino/libraries/RA_Wifi/RA_Wifi.h:168:7: error: 'prog_char' does not name a type; did you mean 'putchar'?
 const prog_char XML_OK[] PROGMEM = "OK";
       ^~~~~~~~~
       putchar
/Users/Gabe/Documents/Arduino/libraries/RA_Wifi/RA_Wifi.h:169:7: error: 'prog_char' does not name a type; did you mean 'putchar'?
 const prog_char XML_ERR[] PROGMEM = "ERR";
       ^~~~~~~~~
       putchar
/Users/Gabe/Documents/Arduino/libraries/RA_Wifi/RA_Wifi.h:171:7: error: 'prog_char' does not name a type; did you mean 'putchar'?
 const prog_char SERVER_HEADER1[] PROGMEM = "HTTP/1.1 200 OK\r\nServer: ReefAngel\r\nCache-Control: no-store, no-cache, must-revalidate\r\nPragma: no-cache\r\nAccess-Control-Allow-Origin: *\r\nAccess-Control-Allow-Methods: GET\r\nConnection: close\r\nContent-Type: text/";
       ^~~~~~~~~
       putchar
In file included from /Users/Gabe/Documents/Arduino/Pringle Lab System/Pringle_Lab_Reef_Only_1/Pringle_Lab_Reef_Only_1.ino:14:0:
/Users/Gabe/Documents/Arduino/libraries/RA_Wifi/RA_Wifi.h:172:7: error: 'prog_char' does not name a type; did you mean 'putchar'?
 const prog_char SERVER_HEADER2[] PROGMEM = "\r\nContent-Length: ";
       ^~~~~~~~~
       putchar
/Users/Gabe/Documents/Arduino/libraries/RA_Wifi/RA_Wifi.h:173:7: error: 'prog_char' does not name a type; did you mean 'putchar'?
 const prog_char SERVER_DENY[] PROGMEM = "HTTP/1.1 401 Access Denied\r\nWWW-Authenticate: Basic realm=Reef Angel Controller\r\nContent-Length: 0\r\n";
       ^~~~~~~~~
       putchar
/Users/Gabe/Documents/Arduino/libraries/RA_Wifi/RA_Wifi.h:174:7: error: 'prog_char' does not name a type; did you mean 'putchar'?
 const prog_char SERVER_DEFAULT[] PROGMEM = "<h1>Reef Angel Controller Web Server</h1>";
       ^~~~~~~~~
       putchar
/Users/Gabe/Documents/Arduino/libraries/RA_Wifi/RA_Wifi.h:365:7: error: 'prog_char' does not name a type; did you mean 'putchar'?
 const prog_char SERVER_RA[] PROGMEM = "<object type=text/html data=http://www.reefangel.com/wifi3/content.html width=100% height=98%></object>";
       ^~~~~~~~~
       putchar
/Users/Gabe/Documents/Arduino/libraries/RA_Wifi/RA_Wifi.h:366:7: error: 'prog_char' does not name a type; did you mean 'putchar'?
 const prog_char EncodingChars[] PROGMEM = {"ABCDEFGHIJKLMNOPQRSTUVWXYZabcdefghijklmnopqrstuvwxyz0123456789+/"};
       ^~~~~~~~~
       putchar
/Users/Gabe/Documents/Arduino/libraries/RA_Wifi/RA_Wifi.h:367:7: error: 'prog_char' does not name a type; did you mean 'putchar'?
 const prog_char BannerGET[] PROGMEM = "GET /status/submitp.aspx?t1=";
       ^~~~~~~~~
       putchar
/Users/Gabe/Documents/Arduino/libraries/RA_Wifi/RA_Wifi.h:368:7: error: 'prog_char' does not name a type; did you mean 'putchar'?
 const prog_char BannerHTTP11[] PROGMEM = " HTTP/1.1\r\n";
       ^~~~~~~~~
       putchar
/Users/Gabe/Documents/Arduino/libraries/RA_Wifi/RA_Wifi.h:369:7: error: 'prog_char' does not name a type; did you mean 'putchar'?
 const prog_char BannerHost[] PROGMEM = "Host: forum.reefangel.com\r\n";
       ^~~~~~~~~
       putchar
/Users/Gabe/Documents/Arduino/libraries/RA_Wifi/RA_Wifi.h:370:7: error: 'prog_char' does not name a type; did you mean 'putchar'?
 const prog_char BannerConnectionClose[] PROGMEM = "Connection: close\r\n";
       ^~~~~~~~~
       putchar
/Users/Gabe/Documents/Arduino/libraries/RA_Wifi/RA_Wifi.h:371:7: error: 'prog_char' does not name a type; did you mean 'putchar'?
 const prog_char BannerT2[] PROGMEM = "&t2=";
       ^~~~~~~~~
       putchar
/Users/Gabe/Documents/Arduino/libraries/RA_Wifi/RA_Wifi.h:372:7: error: 'prog_char' does not name a type; did you mean 'putchar'?
 const prog_char BannerT3[] PROGMEM = "&t3=";
       ^~~~~~~~~
       putchar
/Users/Gabe/Documents/Arduino/libraries/RA_Wifi/RA_Wifi.h:373:7: error: 'prog_char' does not name a type; did you mean 'putchar'?
 const prog_char BannerPH[] PROGMEM = "&ph=";
       ^~~~~~~~~
       putchar
/Users/Gabe/Documents/Arduino/libraries/RA_Wifi/RA_Wifi.h:374:7: error: 'prog_char' does not name a type; did you mean 'putchar'?
 const prog_char BannerATOHIGH[] PROGMEM = "&atohigh=";
       ^~~~~~~~~
       putchar
/Users/Gabe/Documents/Arduino/libraries/RA_Wifi/RA_Wifi.h:375:7: error: 'prog_char' does not name a type; did you mean 'putchar'?
 const prog_char BannerATOLOW[] PROGMEM = "&atolow=";
       ^~~~~~~~~
       putchar
/Users/Gabe/Documents/Arduino/libraries/RA_Wifi/RA_Wifi.h:376:7: error: 'prog_char' does not name a type; did you mean 'putchar'?
 const prog_char BannerRelayData[] PROGMEM = "&r";
       ^~~~~~~~~
       putchar
/Users/Gabe/Documents/Arduino/libraries/RA_Wifi/RA_Wifi.h:377:7: error: 'prog_char' does not name a type; did you mean 'putchar'?
 const prog_char BannerRelayMaskOn[] PROGMEM = "&ron";
       ^~~~~~~~~
       putchar
/Users/Gabe/Documents/Arduino/libraries/RA_Wifi/RA_Wifi.h:378:7: error: 'prog_char' does not name a type; did you mean 'putchar'?
 const prog_char BannerRelayMaskOff[] PROGMEM = "&roff";
       ^~~~~~~~~
       putchar
/Users/Gabe/Documents/Arduino/libraries/RA_Wifi/RA_Wifi.h:379:7: error: 'prog_char' does not name a type; did you mean 'putchar'?
 const prog_char BannerID[] PROGMEM = "&id=";
       ^~~~~~~~~
       putchar
/Users/Gabe/Documents/Arduino/libraries/RA_Wifi/RA_Wifi.h:380:7: error: 'prog_char' does not name a type; did you mean 'putchar'?
 const prog_char BannerEM[] PROGMEM = "&em=";
       ^~~~~~~~~
       putchar
/Users/Gabe/Documents/Arduino/libraries/RA_Wifi/RA_Wifi.h:381:7: error: 'prog_char' does not name a type; did you mean 'putchar'?
 const prog_char BannerEM1[] PROGMEM = "&em1=";
       ^~~~~~~~~
       putchar
/Users/Gabe/Documents/Arduino/libraries/RA_Wifi/RA_Wifi.h:382:7: error: 'prog_char' does not name a type; did you mean 'putchar'?
 const prog_char BannerREM[] PROGMEM = "&rem=";
       ^~~~~~~~~
       putchar
/Users/Gabe/Documents/Arduino/libraries/RA_Wifi/RA_Wifi.h:383:7: error: 'prog_char' does not name a type; did you mean 'putchar'?
 const prog_char BannerCustom[] PROGMEM = "&c";
       ^~~~~~~~~
       putchar
/Users/Gabe/Documents/Arduino/libraries/RA_Wifi/RA_Wifi.h:384:7: error: 'prog_char' does not name a type; did you mean 'putchar'?
 const prog_char BannerKey[] PROGMEM = "&key=";
       ^~~~~~~~~
       putchar
/Users/Gabe/Documents/Arduino/libraries/RA_Wifi/RA_Wifi.h:385:7: error: 'prog_char' does not name a type; did you mean 'putchar'?
 const prog_char BannerAlertFlag[] PROGMEM = "&af=";
       ^~~~~~~~~
       putchar
/Users/Gabe/Documents/Arduino/libraries/RA_Wifi/RA_Wifi.h:386:7: error: 'prog_char' does not name a type; did you mean 'putchar'?
 const prog_char BannerStatusFlag[] PROGMEM = "&sf=";
       ^~~~~~~~~
       putchar
/Users/Gabe/Documents/Arduino/libraries/RA_Wifi/RA_Wifi.h:387:7: error: 'prog_char' does not name a type; did you mean 'putchar'?
 const prog_char BannerBoardID[] PROGMEM = "&bid=";
       ^~~~~~~~~
       putchar
/Users/Gabe/Documents/Arduino/libraries/RA_Wifi/RA_Wifi.h:388:7: error: 'prog_char' does not name a type; did you mean 'putchar'?
 const prog_char BannerSubdomain[] PROGMEM = "&ddns=";
       ^~~~~~~~~
       putchar
/Users/Gabe/Documents/Arduino/libraries/RA_Wifi/RA_Wifi.h:391:8: error: 'prog_char' does not name a type; did you mean 'putchar'?
  const prog_char BannerPWMA[] PROGMEM = "&pwma=";
        ^~~~~~~~~
        putchar
/Users/Gabe/Documents/Arduino/libraries/RA_Wifi/RA_Wifi.h:392:8: error: 'prog_char' does not name a type; did you mean 'putchar'?
  const prog_char BannerPWMD[] PROGMEM = "&pwmd=";
        ^~~~~~~~~
        putchar
/Users/Gabe/Documents/Arduino/libraries/RA_Wifi/RA_Wifi.h:393:8: error: 'prog_char' does not name a type; did you mean 'putchar'?
  const prog_char BannerPWMAO[] PROGMEM = "&pwmao=";
        ^~~~~~~~~
        putchar
/Users/Gabe/Documents/Arduino/libraries/RA_Wifi/RA_Wifi.h:394:8: error: 'prog_char' does not name a type; did you mean 'putchar'?
  const prog_char BannerPWMDO[] PROGMEM = "&pwmdo=";
        ^~~~~~~~~
        putchar
/Users/Gabe/Documents/Arduino/libraries/RA_Wifi/RA_Wifi.h:603:29: error: 'prog_char' does not name a type; did you mean 'putchar'?
     void WebResponse (const prog_char* response, long strsize);
                             ^~~~~~~~~
                             putchar
/Users/Gabe/Documents/Arduino/libraries/RA_Wifi/RA_Wifi.h:619:29: error: 'prog_char' does not name a type; did you mean 'putchar'?
     void PROGMEMprint(const prog_char str[]);
                             ^~~~~~~~~
                             putchar
/Users/Gabe/Documents/Arduino/Pringle Lab System/Pringle_Lab_Reef_Only_1/Pringle_Lab_Reef_Only_1.ino: In function 'int AWCATOCheck()':
Pringle_Lab_Reef_Only_1:87:16: error: 'now' was not declared in this scope
     ATOTimer = now();
                ^~~
/Users/Gabe/Documents/Arduino/Pringle Lab System/Pringle_Lab_Reef_Only_1/Pringle_Lab_Reef_Only_1.ino:87:16: note: suggested alternative: 'pow'
     ATOTimer = now();
                ^~~
                pow
/Users/Gabe/Documents/Arduino/Pringle Lab System/Pringle_Lab_Reef_Only_1/Pringle_Lab_Reef_Only_1.ino: At global scope:
Pringle_Lab_Reef_Only_1:100:1: error: 'prog_char' does not name a type; did you mean 'putchar'?
 prog_char menu0_label[] PROGMEM = "Feed for 5 Mins";
 ^~~~~~~~~
 putchar
Pringle_Lab_Reef_Only_1:101:1: error: 'prog_char' does not name a type; did you mean 'putchar'?
 prog_char menu1_label[] PROGMEM = "Start AWC";
 ^~~~~~~~~
 putchar
Pringle_Lab_Reef_Only_1:102:1: error: 'prog_char' does not name a type; did you mean 'putchar'?
 prog_char menu2_label[] PROGMEM = "Clear Alerts & Vars";
 ^~~~~~~~~
 putchar
Pringle_Lab_Reef_Only_1:103:1: error: 'prog_char' does not name a type; did you mean 'putchar'?
 prog_char menu3_label[] PROGMEM = "pH Calibration";
 ^~~~~~~~~
 putchar
Pringle_Lab_Reef_Only_1:104:1: error: 'prog_char' does not name a type; did you mean 'putchar'?
 prog_char menu4_label[] PROGMEM = "Set Date and Time";
 ^~~~~~~~~
 putchar
Pringle_Lab_Reef_Only_1:105:1: error: 'prog_char' does not name a type; did you mean 'putchar'?
 prog_char menu5_label[] PROGMEM = "Toggle Return & Skimmer Pumps";
 ^~~~~~~~~
 putchar
Pringle_Lab_Reef_Only_1:106:32: error: variable 'menu_items' must be const in order to be put into read-only section by means of '__attribute__((progmem))'
 PROGMEM const char *menu_items[] = {
                                ^
Pringle_Lab_Reef_Only_1:107:1: error: 'menu0_label' was not declared in this scope
 menu0_label, menu1_label, menu2_label, menu3_label, menu4_label, menu5_label
 ^~~~~~~~~~~
Pringle_Lab_Reef_Only_1:107:14: error: 'menu1_label' was not declared in this scope
 menu0_label, menu1_label, menu2_label, menu3_label, menu4_label, menu5_label
              ^~~~~~~~~~~
/Users/Gabe/Documents/Arduino/Pringle Lab System/Pringle_Lab_Reef_Only_1/Pringle_Lab_Reef_Only_1.ino:107:14: note: suggested alternative: 'Temp1Label'
 menu0_label, menu1_label, menu2_label, menu3_label, menu4_label, menu5_label
              ^~~~~~~~~~~
              Temp1Label
Pringle_Lab_Reef_Only_1:107:27: error: 'menu2_label' was not declared in this scope
 menu0_label, menu1_label, menu2_label, menu3_label, menu4_label, menu5_label
                           ^~~~~~~~~~~
/Users/Gabe/Documents/Arduino/Pringle Lab System/Pringle_Lab_Reef_Only_1/Pringle_Lab_Reef_Only_1.ino:107:27: note: suggested alternative: 'Temp2Label'
 menu0_label, menu1_label, menu2_label, menu3_label, menu4_label, menu5_label
                           ^~~~~~~~~~~
                           Temp2Label
Pringle_Lab_Reef_Only_1:107:40: error: 'menu3_label' was not declared in this scope
 menu0_label, menu1_label, menu2_label, menu3_label, menu4_label, menu5_label
                                        ^~~~~~~~~~~
/Users/Gabe/Documents/Arduino/Pringle Lab System/Pringle_Lab_Reef_Only_1/Pringle_Lab_Reef_Only_1.ino:107:40: note: suggested alternative: 'Temp3Label'
 menu0_label, menu1_label, menu2_label, menu3_label, menu4_label, menu5_label
                                        ^~~~~~~~~~~
                                        Temp3Label
Pringle_Lab_Reef_Only_1:107:53: error: 'menu4_label' was not declared in this scope
 menu0_label, menu1_label, menu2_label, menu3_label, menu4_label, menu5_label
                                                     ^~~~~~~~~~~
Pringle_Lab_Reef_Only_1:107:66: error: 'menu5_label' was not declared in this scope
 menu0_label, menu1_label, menu2_label, menu3_label, menu4_label, menu5_label
                                                                  ^~~~~~~~~~~
/Users/Gabe/Documents/Arduino/Pringle Lab System/Pringle_Lab_Reef_Only_1/Pringle_Lab_Reef_Only_1.ino: In function 'void setup()':
Pringle_Lab_Reef_Only_1:219:13: error: 'class ReefAngelClass' has no member named 'InitMenu'; did you mean 'InitMenus'?
   ReefAngel.InitMenu(pgm_read_word(&(menu_items[0])),SIZE(menu_items));
             ^~~~~~~~
             InitMenus
Pringle_Lab_Reef_Only_1:230:3: error: 'startupTimer' was not declared in this scope
   startupTimer = now();
   ^~~~~~~~~~~~
/Users/Gabe/Documents/Arduino/Pringle Lab System/Pringle_Lab_Reef_Only_1/Pringle_Lab_Reef_Only_1.ino:230:3: note: suggested alternative: 'strupr'
   startupTimer = now();
   ^~~~~~~~~~~~
   strupr
Pringle_Lab_Reef_Only_1:230:18: error: 'now' was not declared in this scope
   startupTimer = now();
                  ^~~
/Users/Gabe/Documents/Arduino/Pringle Lab System/Pringle_Lab_Reef_Only_1/Pringle_Lab_Reef_Only_1.ino:230:18: note: suggested alternative: 'pow'
   startupTimer = now();
                  ^~~
                  pow
/Users/Gabe/Documents/Arduino/Pringle Lab System/Pringle_Lab_Reef_Only_1/Pringle_Lab_Reef_Only_1.ino: In function 'void loop()':
Pringle_Lab_Reef_Only_1:236:10: error: 'now' was not declared in this scope
   AWCt = now();
          ^~~
/Users/Gabe/Documents/Arduino/Pringle Lab System/Pringle_Lab_Reef_Only_1/Pringle_Lab_Reef_Only_1.ino:236:10: note: suggested alternative: 'pow'
   AWCt = now();
          ^~~
          pow
Pringle_Lab_Reef_Only_1:237:20: error: 'hour' was not declared in this scope
   if (!AWCFail && (hour(AWCt) == AWCHour) && (minute(AWCt) == AWCMinute) && !AWCToday && !AWC && !ReefAngel.isATOTimeOut())
                    ^~~~
Pringle_Lab_Reef_Only_1:237:47: error: 'minute' was not declared in this scope
   if (!AWCFail && (hour(AWCt) == AWCHour) && (minute(AWCt) == AWCMinute) && !AWCToday && !AWC && !ReefAngel.isATOTimeOut())
                                               ^~~~~~
/Users/Gabe/Documents/Arduino/Pringle Lab System/Pringle_Lab_Reef_Only_1/Pringle_Lab_Reef_Only_1.ino:237:47: note: suggested alternative: 'init'
   if (!AWCFail && (hour(AWCt) == AWCHour) && (minute(AWCt) == AWCMinute) && !AWCToday && !AWC && !ReefAngel.isATOTimeOut())
                                               ^~~~~~
                                               init
Pringle_Lab_Reef_Only_1:243:7: error: 'hour' was not declared in this scope
   if (hour(AWCt) == 0 && minute(AWCt) == 0 && AWCToday)
       ^~~~
Pringle_Lab_Reef_Only_1:243:26: error: 'minute' was not declared in this scope
   if (hour(AWCt) == 0 && minute(AWCt) == 0 && AWCToday)
                          ^~~~~~
/Users/Gabe/Documents/Arduino/Pringle Lab System/Pringle_Lab_Reef_Only_1/Pringle_Lab_Reef_Only_1.ino:243:26: note: suggested alternative: 'init'
   if (hour(AWCt) == 0 && minute(AWCt) == 0 && AWCToday)
                          ^~~~~~
                          init
exit status 1
'now' was not declared in this scope
It seems like the errors are occuring in library files??? I'm assuming I'm doing something stupid here. Any help would be greatly appreciated!

Thanks,
Gabe
binder
Posts: 2871
Joined: Fri Mar 18, 2011 6:20 pm
Location: Illinois
Contact:

Re: New computer -> issues...

Post by binder »

you mentioned the newest version of arduino and the libraries. what version did you download? did you get the main branch or dev branch from the github repository? you will need that version.
also, if you are using arduino, make sure you followed my post about the plugin to do all the preprocessing of the pde/ino file for the features.

Sent from my Pixel 2 using Tapatalk
gaberosenfield
Posts: 89
Joined: Thu Mar 08, 2012 5:11 pm
Location: Redwood City, California

Re: New computer -> issues...

Post by gaberosenfield »

Thank you for the direction, binder!

I read your post and added the boards and feature generation plugin per your instructions. That seems to have worked. But now I get the following error message when I try to compile:

Code: Select all

Users/Gabe/Documents/Arduino/libraries/EthernetUtils/EthernetBonjour.cpp:31:13: fatal error: wiring.h: No such file or directory
    #include <wiring.h>
Multiple libraries were found for "Ethernet.h"
             ^~~~~~~~~~
compilation terminated.
 Used: /Users/Gabe/Documents/Arduino/libraries/Ethernet
 Not used: /Applications/Arduino.app/Contents/Java/libraries/Ethernet
exit status 1
Error compiling for board Reef Angel Plus Controller.
Searching through my libraries folder, there does not appear to be a wiring.h file. Thoughts on how to fix this problem? Is it a problem that multiple libraries were found for Ethernet.h?

Thanks again,
Gabe
binder
Posts: 2871
Joined: Fri Mar 18, 2011 6:20 pm
Location: Illinois
Contact:

Re: New computer -> issues...

Post by binder »

That library may not be included by default. I think it's assumed to be included by arduino. you may have to look closer at the libraries folder.
Or it may have to be moved to a different location. not sure off hand.
I'll have to look at my installation on my mac.

Sent from my Pixel 2 using Tapatalk
binder
Posts: 2871
Joined: Fri Mar 18, 2011 6:20 pm
Location: Illinois
Contact:

Re: New computer -> issues...

Post by binder »

yeah, it's possible that the multiple ethernet libraries are the culprit. not positive though.

Sent from my Pixel 2 using Tapatalk
gaberosenfield
Posts: 89
Joined: Thu Mar 08, 2012 5:11 pm
Location: Redwood City, California

Re: New computer -> issues...

Post by gaberosenfield »

Ok, I confirmed the problem isn't that two Ethernet libraries were found by removing one.

The problem is that wiring.h does not exist in either the Reef Angel libraries or the libraries that came with my installation of Arduino (1.8.13). I did find the following in EthernetDHCP.cpp:

Code: Select all

extern "C" {
   #include <wiring.h>
   #include <utility/EthernetUtil.h>
}
Forgive my limited understanding, but does this mean wiring.h should be in some C library somewhere? Would this be in a separate location from my reef angel libraries or the libraries that came with my installation of Arduino?
binder
Posts: 2871
Joined: Fri Mar 18, 2011 6:20 pm
Location: Illinois
Contact:

Re: New computer -> issues...

Post by binder »

this just means that the wiring library is expected but not found in the library locations. I think it was included by arduino in the past and therefore reefangel didn't include it. I am not positive. I'm getting ready to check my mac and see how mine is setup.

Sent from my Pixel 2 using Tapatalk
binder
Posts: 2871
Joined: Fri Mar 18, 2011 6:20 pm
Location: Illinois
Contact:

Re: New computer -> issues...

Post by binder »

I just looked at my setup. I do not have wiring.h and everything works just fine. So, that makes me think that there's something wrong with your configuration.
I'm using the libraries from github that is the commit version '3c145e7' which is one commit behind the latest but doesn't matter because of the changes made (they were minor). I just installed in my Libraries folder. I'm also running 1.8.13 arduino and macOS 10.15.7.
Make sure you have the correct board chosen AND that you run my Process Sketch plugin before you compile. I never once had an error looking for the wiring.h file.

There were a couple issues compiling your code. Here's what I had to change:

Code: Select all

// Inside setup, comment out this line:
//startupTimer = now()
  
//Custom Menu Code
const unsigned PROGMEM char menu0_label[] = "Feed for 5 Mins";
const unsigned PROGMEM char menu1_label[] = "Start AWC";
const unsigned PROGMEM char menu2_label[] = "Clear Alerts & Vars";
const unsigned PROGMEM char menu3_label[] = "pH Calibration";
const unsigned PROGMEM char menu4_label[] = "Set Date and Time";
const unsigned PROGMEM char menu5_label[] = "Toggle Return & Skimmer Pumps";
const unsigned char *menu_items[] = {
menu0_label, menu1_label, menu2_label, menu3_label, menu4_label, menu5_label
};
There was a change in the libraries to handle the custom menu and the whole prog_char ... PROGMEM variable. That had to do with a change in Arduino.
And here's the full code:

Code: Select all

#include <ReefAngel_Features.h>
#include <Globals.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_Wifi.h>
#include <Timer.h>
#include <Memory.h>
#include <InternalEEPROM.h>
#include <RA_Colors.h>
#include <RA_CustomColors.h>
#include <AI.h>
#include <PH.h>
#include <IO.h>
#include <WaterLevel.h>
#include <ReefAngel.h>
#include <avr/pgmspace.h>

//Ports assignment:
//First relay box is for the reef system.
//Port1 - Metal Halide Daylights.
#define lights Port1
//Port2 - AWC drain pump.
#define AWCdrain Port2
//Port3 - AWC fill pump.
#define AWCfill Port3
//Port4 - Chiller, feed pump, & exhaust fans.
#define chiller Port4
//Port5 - Clockwise circulation pumps.
#define clockCirc Port5
//Port6 - Counterclockwise circulation pumps.
#define countCirc Port6
//Port7 - ATO pump.
#define ATOPump Port7
//Port8 - Return pump & skimmer pump.
#define returnPump Port8

//Change these values as needed. They are the threshold values for the low and high temperatures, respectively.
int lowTempWarning = 750; //low temp warning below 75F.
int highTempWarning = 800; //high temp warning above 80F.

//These vairable are used to control the ATO system.
static time_t ATOTimer;
int ATOTimeOut = 100;

//The following variables control when automatic water changes occur.
int AWCHour = 12;
int AWCMinute = 0;

//These variables will be used to keep track of the progress of an AWC.
int AWCCheck = 0;
boolean AWCFail = false;
boolean drained = false;

//This variable will trigger an AWC().
boolean AWC = false;

//This variable will be set to true if a water change has been done since the last midnight and will be set to false at midnight.
boolean AWCToday = false; 

//This vairable will store the current time for comparisons on when to initialize an AWC.
time_t AWCt;

//This variable will be a backup timer for AWC.
static time_t AWCTimer;

//These variables will control how long the AWC pumps should be on (in seconds) in case of float switch failure.
int AWCDrainSecs = 30;
int AWCFillSecs = 30;

//This function will check to make sure the water level in the sump is at the high float before initiating an AWC.
int AWCATOCheck()
{
  if (!ReefAngel.Relay.Status(returnPump))  //If the return pump is not on, don't run an AWC and return 0 (false).
    return 0; //Returning zero here is the only way for AWCCheck to equal 0 while AWC equals true. This will cause the AWC process to pause until the return pump is on again.
 
  if (!ReefAngel.HighATO.IsActive()) //If the water level is not at the maximum normal level, run the ATO.
  {
    ATOTimer = now();
    ReefAngel.Relay.On(ATOPump);  //Fill the return section to the high float with RODI.
    AWCToday = true;
    return 2;
  }
  else
  {
    AWCToday = true;
    return 1;
  }
}

//Custom Menu Code
const unsigned PROGMEM char menu0_label[] = "Feed for 5 Mins";
const unsigned PROGMEM char menu1_label[] = "Start AWC";
const unsigned PROGMEM char menu2_label[] = "Clear Alerts & Vars";
const unsigned PROGMEM char menu3_label[] = "pH Calibration";
const unsigned PROGMEM char menu4_label[] = "Set Date and Time";
const unsigned PROGMEM char menu5_label[] = "Toggle Return & Skimmer Pumps";
const unsigned char *menu_items[] = {
menu0_label, menu1_label, menu2_label, menu3_label, menu4_label, menu5_label
};
void MenuEntry1()
{
  ReefAngel.FeedingModeStart();
}
void MenuEntry2()
{
  AWCToday = false;
  AWC = true;
}
void MenuEntry3()
{
  //Clear portal variables.
  //ReefAngel.CustomVar[Var_AWCCountTotal] = 0;
  //ReefAngel.CustomVar[Var_AWCCountToday] = 0;
  //ReefAngel.CustomVar[Var_AWCDrainFail] = 0;
  //ReefAngel.CustomVar[Var_AWCFillFail] = 0;
  //ReefAngel.CustomVar[Var_AWCATOFail] = 0;
 
  //Clear AWC control variables.
  AWC = false;
  AWCToday = false;
  AWCFail = false;
  AWCCheck = 0;
 
  //Clear ATO timeout.
  ReefAngel.ATOClear();
  ReefAngel.DisplayMenuEntry("ATO & AWC Variables Cleared");
}
void MenuEntry4()
{
  ReefAngel.StartSetupCalibrateChoicePH();
}
void MenuEntry5()
{
  ReefAngel.SetupDateTime();
}
void MenuEntry6()
{
  ReefAngel.WaterChangeModeStart();
}

void DrawCustomMain()
{
  // the graph is drawn/updated when we exit the main menu & when the parameters are saved
  ReefAngel.LCD.DrawDate(6, 120);

  pingSerial();

  byte mainTempColor;
  //To make changes for each temp sensor, change the value of tempColor to be the appropriate color
  if ( ReefAngel.Params.Temp[T1_PROBE] < lowTempWarning ) { mainTempColor = COLOR_CYAN; }
  else if ( ReefAngel.Params.Temp[T1_PROBE] > highTempWarning ) { mainTempColor = COLOR_RED; }
  else { mainTempColor = COLOR_SEAGREEN; }
  //Display the T1 Main System temperature
  int T1y = 66; //Y-position of T1 probe reading.
  ReefAngel.LCD.DrawText(mainTempColor, DefaultBGColor, 5, T1y, "Tank Temp: ");
  ReefAngel.LCD.DrawSingleMonitor(ReefAngel.Params.Temp[T1_PROBE], mainTempColor, 65, T1y, 10);
 
  //Display the T2 Room temperature
  int T2y = 75; //Y-position of T2 probe reading.
  ReefAngel.LCD.DrawText(COLOR_BLACK, DefaultBGColor, 5, T2y, "Room Temp: ");
  ReefAngel.LCD.DrawSingleMonitor(ReefAngel.Params.Temp[T2_PROBE], COLOR_BLACK, 65, T2y, 10);

  /*byte pHColor;
  //Depending upon the pH, change the value of pHColor to be the appropriate color
  if ( ReefAngel.Params.PH < 790 ) { pHColor = COLOR_YELLOW; }
  else if ( ReefAngel.Params.PH > 810 ) { pHColor = COLOR_MAGENTA; }
  else { pHColor = COLOR_SEAGREEN; }
  //Display the pH starting at 88, 74
  ReefAngel.LCD.DrawText(pHColor, DefaultBGColor, 5, 80, "pH: ");
  ReefAngel.LCD.DrawSingleMonitor(ReefAngel.Params.PH, pHColor, 30, 80, 100);*/
 
  //Display whether the ATO high float switch is active (float away from wires) or inactive (float close to wires)
  byte floatColor; //Text color for ATO reading.
  int ATOy = 84; //Y-position for ATO reading.
  ReefAngel.LCD.Clear(DefaultBGColor, 0,ATOy, 128,ATOy);
  if (ReefAngel.HighATO.IsActive() && !ReefAngel.isATOTimeOut())
  {
    floatColor = COLOR_MEDIUMORCHID;
    ReefAngel.LCD.DrawText(floatColor, DefaultBGColor, 5, ATOy, "Water Level Low");
  }
  else if (!ReefAngel.HighATO.IsActive() && !ReefAngel.isATOTimeOut())
  {
    floatColor = COLOR_SEAGREEN;
    ReefAngel.LCD.DrawText(floatColor, DefaultBGColor, 5, ATOy, "Water Level Normal");
  }
  else {ReefAngel.LCD.DrawText(COLOR_WHITE, COLOR_RED, 5, ATOy, "ATO Failure");}

  pingSerial();

  //Display relay box 1 ports with status at 12,94
  byte TempRelay = ReefAngel.Relay.RelayData;
  TempRelay &= ReefAngel.Relay.RelayMaskOff;
  TempRelay |= ReefAngel.Relay.RelayMaskOn;
  ReefAngel.LCD.DrawOutletBox(12, 94, TempRelay);
}

void DrawCustomGraph()
{
  //Print "Pringle Lab Reef" at the top of the screen
  ReefAngel.LCD.DrawText(DefaultFGColor, DefaultBGColor, 18, 2, "Pringle Lab Reef");
  ReefAngel.LCD.DrawGraph(5,13);
}
////// Place global variable code above here


void setup()
{
  InternalMemory.LCDID_write(1);
  ReefAngel.Init();
  ReefAngel.InitMenu(pgm_read_word(&(menu_items[0])),SIZE(menu_items));
  ReefAngel.UseFlexiblePhCalibration();
  ReefAngel.FeedingModePorts = Port5Bit | Port6Bit; // Turn off Ports 5 & 6 (circulation pumps) when Feeding Mode is activated.
  ReefAngel.WaterChangePorts = Port8Bit;  // Turn off port 8 (return & skimmer pumps) when Water Change Mode is activated
  ReefAngel.Relay.On(returnPump); // Turn on return & skimmer pumps.
  //Initialize portal variables.
  //ReefAngel.CustomVar[Var_AWCCountTotal] = 0;
  //ReefAngel.CustomVar[Var_AWCCountToday] = 0;
  //ReefAngel.CustomVar[Var_AWCFillFail] = 0;
  //ReefAngel.CustomVar[Var_AWCDrainFail] = 0;
  //ReefAngel.CustomVar[Var_AWCATOFail] = 0;
  //startupTimer = now();
}

void loop()
{
  //Start an AWC once per day at AWCHour:AWCMinute if an AWC hasn't happened since midnight and there hasn't been an ATO timeout.
  AWCt = now();
  if (!AWCFail && (hour(AWCt) == AWCHour) && (minute(AWCt) == AWCMinute) && !AWCToday && !AWC && !ReefAngel.isATOTimeOut())
  {
    AWC = true;  //Sets the AWC control variable to true.
  }
   
  //Reset the automatic water change variable and AWC and dosing counts every day at midnight.  Also add the day's AWC count to the total AWC count.
  if (hour(AWCt) == 0 && minute(AWCt) == 0 && AWCToday)
  {
    AWCToday = false;
    //ReefAngel.CustomVar[Var_AWCCountTotal] += ReefAngel.CustomVar[Var_AWCCountToday];
    //ReefAngel.CustomVar[Var_AWCCountToday] = 0;
  }
   
  //Start the chain of AWC functions.
  if (AWC && !AWCToday && AWCCheck == 0)
  {
    AWCCheck = AWCATOCheck(); //If AWCATOCheck returns non-zero, it will also set AWCToday to true.
  }
 
  if (AWCCheck == 2)
  {
    if (!ReefAngel.HighATO.IsActive())
    {
      ReefAngel.Relay.Off(ATOPump);
      AWCCheck = 1;
    }
   
    if ((now() - ATOTimer) >= ATOTimeOut)
    {
      ReefAngel.Relay.Off(ATOPump);
      bitSet(ReefAngel.AlertFlags,ATOTimeOutFlag);  //Trigger ATO timeout flag.
      AWCFail = true;
      //ReefAngel.CustomVar[Var_AWCATOFail] = 1;
      AWCCheck = 0;
      AWC = false;
    }
  }
 
  if (AWCCheck == 1 && !ReefAngel.Relay.Status(AWCdrain))
  {
    AWCTimer = now();
    ReefAngel.Relay.On(AWCdrain);
  }
   
  if (ReefAngel.Relay.Status(AWCdrain))
  {
    if (ReefAngel.HighATO.IsActive())
    {
      ReefAngel.Relay.Off(AWCdrain);
      drained = true;
    }
   
    if (now()-AWCTimer >= AWCDrainSecs)
    {
      ReefAngel.Relay.Off(AWCdrain);
      AWCFail = true;
      //ReefAngel.CustomVar[Var_AWCDrainFail] = 1;
      AWCCheck = 0;
      AWC = false;
    }
  }

  if (drained)
  {
    if (!ReefAngel.Relay.Status(AWCfill))
    {
      AWCTimer = now();
      ReefAngel.Relay.On(AWCfill);
    }

    if (ReefAngel.Relay.Status(AWCfill))
    {
      if (!ReefAngel.HighATO.IsActive())
      {
        ReefAngel.Relay.Off(AWCfill);
        drained = false;
        AWC = false;
        AWCCheck = 0;
        //ReefAngel.CustomVar[Var_AWCCountToday] += 1;
      }

      if (now()-AWCTimer >= AWCFillSecs)
      {
        ReefAngel.Relay.Off(AWCfill);
        drained = false;
        AWCFail = true;
        //ReefAngel.CustomVar[Var_AWCFillFail] = 1;
        AWCCheck = 0;
        AWC = false;
      }
    }
  }
 
  //Light Control
  if (ReefAngel.Params.Temp[T1_PROBE] < highTempWarning)
  {
    ReefAngel.StandardLights(lights, 8,00, 18,00); //Lights on at 8 am and off at 6 pm.
  }
 
  //Temp control is handled by the chiller, but it and the lights will be turned off if the temp gets too high.
  if (ReefAngel.Params.Temp[T1_PROBE] >= highTempWarning)
  {
    ReefAngel.Relay.Off(lights);
    ReefAngel.Relay.Off(chiller);
  }
   
  //Wavemaker control
  ReefAngel.WavemakerRandom(clockCirc,30,300); // Turn clockwise circulation pumps on/off random cycles that lasts from 30 to 300 secs.
  ReefAngel.Relay.Set(countCirc,!ReefAngel.Relay.Status(clockCirc)); // Turn counterclockwise circulation pumps on/off on opposite cycle from clockwise circulation pumps. 
   
  //ATO
  if (!AWC) {ReefAngel.SingleATO(false, ATOPump, ATOTimeOut, 0);} //Use single high float switch (false = high) for reef ATO with 100 second timeout and no frequency limit.
 
  ReefAngel.ShowInterface();
}
gaberosenfield
Posts: 89
Joined: Thu Mar 08, 2012 5:11 pm
Location: Redwood City, California

Re: New computer -> issues...

Post by gaberosenfield »

I'm running the same versions of mac OS and Arduino.

Using the updated code you sent back (thank you so much for your efforts on that!) and the 2e3f279 libraries (newest from dev branch), it compiles after running your reef angel processing tool. Thank you so much for your help, binder!

A suggestion for whoever controls the reefangel.com site (rimai?), the link to the libraries on Github probably shouldn't default to a master branch that hasn't been updated in 4 years. Obviously I had additional problems in this case, but I suspect other users will also download this old version of the libraries by accident.

Thanks again,
Gabe
binder
Posts: 2871
Joined: Fri Mar 18, 2011 6:20 pm
Location: Illinois
Contact:

Re: New computer -> issues...

Post by binder »

first, you're welcome. :)

second, everyone is actually being pushed towards using the webwizard (https://forum.reefangel.com/webwizard/) instead of arduino app. the app keeps changing faster than can be kept up and the processing that my plugin does was simply incorporated into a custom build (hard to maintain).
plus there was lots of issues just with compiling and updating libraries, etc that Roberto created the webwizard so you don't need to install anything except a plugin for your computer to communicate with your controller and you can code on the web from any device AND your sketch is backed up remotely. all in all, it's a great tool.
I don't personally use it much since I tweak my libraries and test out custom stuff. so, I figured out how to get the "old way" to work reliably (since macos got rid of 32bit running apps).
anyways, I'm sure he will read your comments and possibly update the site accordingly.

Sent from my Pixel 2 using Tapatalk
gaberosenfield
Posts: 89
Joined: Thu Mar 08, 2012 5:11 pm
Location: Redwood City, California

Re: New computer -> issues...

Post by gaberosenfield »

Ahh, thanks for the update.

I saw a lot of references to the web wizard, but I've been out of the loop for over a year... I'll have to give the web wizard a try.

Thanks again for your help!

Best,
Gabe
gaberosenfield
Posts: 89
Joined: Thu Mar 08, 2012 5:11 pm
Location: Redwood City, California

Re: New computer -> issues...

Post by gaberosenfield »

New problem: the custom menu shows a jumbled overlapping combination of all menu options on one line of the RA+ screen. I would upload an image to illustrate the point, but for some reason every time I try it just erases whatever I type here...

I tried reviewing the RA Custom Menus guide made by binder, but to no avail. It seems that must be out of date, and changing my code to match the examples in that guide resulted in failures to compile.

One thing I find suspicious is that my ReefAngel_Features.h file contains the following two lines:

Code: Select all

#define CUSTOM_MENU_ENTRIES 6
#define CUSTOM_MENU_ENTRIES 7
My code actually has 7 menu entries.
If I delete the line with "6" and compile the code again, the line with "6" reappears in my ReefAngel_Features.h file.
If I delete the line with "7" and compile the code again, it does not reappear. However, If I run the CB ReefAngel Process Sketch plugin and then compile, the line with "7" reappears in my features file.
As far as I can tell though, none of this fixes my problem, I just find it strange.

I tried using the webwizard, but it seems that doesn't provide support for custom menus. Also, I was unable to install the webwizard plugin on my computer (at the very end of the process it just says installation failed).

So I'm back to throwing myself upon the mercy of those who understand more about the RA programming and libraries.
My code is below:

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 <ReefAngel.h>
#include <RA_Colors.h>
#include <RA_CustomColors.h>
#include <RA_CustomLabels.h>
#include <RA_CustomSettings.h>
#include <PH.h>
#include <avr/pgmspace.h>

//Ports assignment:
//First relay box is for the reef system.
//Port1 - Metal Halide Daylights.
#define lights Port1
//Port2 - AWC drain pump.
#define AWCdrain Port2
//Port3 - AWC fill pump.
#define AWCfill Port3
//Port4 - Chiller, feed pump, & exhaust fans.
#define chiller Port4
//Port5 - Clockwise circulation pumps.
#define clockCirc Port5
//Port6 - Counterclockwise circulation pumps.
#define countCirc Port6
//Port7 - ATO pump.
#define ATOPump Port7
//Port8 - Return pump & skimmer pump.
#define returnPump Port8

//Change these values as needed. They are the threshold values for the low and high temperatures, respectively.
int lowTempWarning = 750; //low temp warning below 75F.
int highTempWarning = 800; //high temp warning above 80F.

//These vairable are used to control the ATO system.
static time_t ATOTimer;
int ATOTimeOut = 100;

//The following variables control when automatic water changes occur.
int AWCHour = 12;
int AWCMinute = 0;
char AWCChar[] = "AWC Scheduled: 1200"; //This string will be printed to the display until an AWC is attempted each day.

//These variables will be used to keep track of the progress of an AWC.
int AWCCheck = 0;
boolean AWCFail = false;
boolean drained = false;

//This variable will trigger an AWC().
boolean AWC = false;

//This variable will be set to true if a water change has been done since the last midnight and will be set to false at midnight.
boolean AWCToday = false;

//This vairable will store the current time for comparisons on when to initialize an AWC.
time_t AWCt;

//This variable will be a backup timer for AWC.
static time_t AWCTimer;

//These variables will control how long the AWC pumps should be on (in seconds) in case of float switch failure.
int AWCDrainSecs = 30;
int AWCFillSecs = 30;

//This function will check to make sure the water level in the sump is at the high float before initiating an AWC.
int AWCATOCheck()
{
  if (!ReefAngel.Relay.Status(returnPump))  //If the return pump is not on, don't run an AWC and return 0 (false).
    return 0; //Returning zero here is the only way for AWCCheck to equal 0 while AWC equals true. This will cause the AWC process to pause until the return pump is on again.
 
  if (!ReefAngel.HighATO.IsActive()) //If the water level is not at the maximum normal level, run the ATO.
  {
    ATOTimer = now();
    ReefAngel.Relay.On(ATOPump);  //Fill the return section to the high float with RODI.
    AWCToday = true;
    return 2;
  }
  else
  {
    AWCToday = true;
    return 1;
  }
}

//Custom Menu Code
const unsigned PROGMEM char menu1_label[] = "Feed for 5 Mins";
const unsigned PROGMEM char menu2_label[] = "Start AWC";
const unsigned PROGMEM char menu3_label[] = "Clear Alerts & Vars";
const unsigned PROGMEM char menu4_label[] = "pH Calibration";
const unsigned PROGMEM char menu5_label[] = "Set Date & Time";
const unsigned PROGMEM char menu6_label[] = "Return & Skimmer";
const unsigned PROGMEM char menu7_label[] = "Version";
const unsigned char *menu_items[] = {
menu1_label, menu2_label, menu3_label, menu4_label, menu5_label, menu6_label, menu7_label
};
void MenuEntry1()
{
  ReefAngel.FeedingModeStart();
}
void MenuEntry2()
{
  AWCToday = false;
  AWC = true;
}
void MenuEntry3()
{
  //Clear portal variables.
  //ReefAngel.CustomVar[Var_AWCCountTotal] = 0;
  //ReefAngel.CustomVar[Var_AWCCountToday] = 0;
  //ReefAngel.CustomVar[Var_AWCDrainFail] = 0;
  //ReefAngel.CustomVar[Var_AWCFillFail] = 0;
  //ReefAngel.CustomVar[Var_AWCATOFail] = 0;
 
  //Clear AWC control variables.
  AWC = false;
  AWCToday = false;
  AWCFail = false;
  AWCCheck = 0;
 
  //Clear ATO timeout.
  ReefAngel.ATOClear();
  ReefAngel.DisplayMenuEntry("ATO & AWC Variables Cleared");
}
void MenuEntry4()
{
  ReefAngel.StartSetupCalibrateChoicePH();
  ReefAngel.DisplayedMenu = ALT_SCREEN_MODE;
}
void MenuEntry5()
{
  ReefAngel.SetupDateTime();
  ReefAngel.DisplayedMenu = ALT_SCREEN_MODE;
}
void MenuEntry6()
{
  ReefAngel.WaterChangeModeStart();
}
void MenuEntry7()
{
ReefAngel.DisplayVersion();
}

void DrawCustomMain()
{
  // the graph is drawn/updated when we exit the main menu & when the parameters are saved
  ReefAngel.LCD.DrawDate(6, 120);

  pingSerial();

  byte mainTempColor;
  //To make changes for each temp sensor, change the value of tempColor to be the appropriate color
  if ( ReefAngel.Params.Temp[T1_PROBE] < lowTempWarning ) { mainTempColor = COLOR_CYAN; }
  else if ( ReefAngel.Params.Temp[T1_PROBE] > highTempWarning ) { mainTempColor = COLOR_RED; }
  else { mainTempColor = COLOR_SEAGREEN; }
  //Display the T1 Main System temperature
  int T1y = 66; //Y-position of T1 probe reading.
  ReefAngel.LCD.DrawText(mainTempColor, DefaultBGColor, 5, T1y, "Tank Temp: ");
  ReefAngel.LCD.DrawSingleMonitor(ReefAngel.Params.Temp[T1_PROBE], mainTempColor, 65, T1y, 10);
 
  //Display the T2 Room temperature
  int T2y = 75; //Y-position of T2 probe reading.
  ReefAngel.LCD.DrawText(COLOR_BLACK, DefaultBGColor, 5, T2y, "Room Temp: ");
  ReefAngel.LCD.DrawSingleMonitor(ReefAngel.Params.Temp[T2_PROBE], COLOR_BLACK, 65, T2y, 10);

  /*byte pHColor;
  //Depending upon the pH, change the value of pHColor to be the appropriate color
  if ( ReefAngel.Params.PH < 790 ) { pHColor = COLOR_YELLOW; }
  else if ( ReefAngel.Params.PH > 810 ) { pHColor = COLOR_MAGENTA; }
  else { pHColor = COLOR_SEAGREEN; }
  //Display the pH starting at 88, 74
  ReefAngel.LCD.DrawText(pHColor, DefaultBGColor, 5, 80, "pH: ");
  ReefAngel.LCD.DrawSingleMonitor(ReefAngel.Params.PH, pHColor, 30, 80, 100);*/
 
  //Display whether the ATO high float switch is active (float away from wires) or inactive (float close to wires)
  byte floatColor; //Text color for ATO reading.
  int ATOy = 84; //Y-position for ATO reading.
  ReefAngel.LCD.Clear(DefaultBGColor, 0,ATOy, 128,ATOy+7); //Default font size is 5 pixels wide by 8 pixels high.
  if (ReefAngel.HighATO.IsActive() && !ReefAngel.isATOTimeOut())
  {
    floatColor = COLOR_MEDIUMORCHID;
    ReefAngel.LCD.DrawText(floatColor, DefaultBGColor, 5, ATOy, "Water Level Low");
  }
  else if (!ReefAngel.HighATO.IsActive() && !ReefAngel.isATOTimeOut())
  {
    floatColor = COLOR_SEAGREEN;
    ReefAngel.LCD.DrawText(floatColor, DefaultBGColor, 5, ATOy, "Water Level Normal");
  }
  else {ReefAngel.LCD.DrawText(COLOR_WHITE, COLOR_RED, 5, ATOy, "ATO Failure");}

  //Display whether an AWC has occurred today, or when today's AWC is scheduled, 
  //or that an AWC is in progress, or that an AWC failure has occurred:
  //byte AWCColor; //Text color for AWC info.
  int AWCy = 95; //Y-position for AWC info.
  ReefAngel.LCD.Clear(DefaultBGColor, 0,AWCy, 128,AWCy+7); //Default font size is 5 pixels wide by 8 pixels high.
  if (AWCFail)
  {
    ReefAngel.LCD.DrawText(COLOR_WHITE, COLOR_RED, 2, AWCy, "AWC Failure");
  }
  else
  {
    if (AWC)
    {
      ReefAngel.LCD.DrawText(COLOR_BLACK, COLOR_YELLOW, 2, AWCy, "AWC In Progress");
    }
    else if (AWCToday)
    {
      ReefAngel.LCD.DrawText(COLOR_GREEN, COLOR_WHITE, 2, AWCy, "AWC Completed Today");
    }
    else {ReefAngel.LCD.DrawText(COLOR_BLUE, COLOR_WHITE, 2, AWCy, AWCChar);}
  }

  //Display relay box 1 ports with status at 12,94
  byte TempRelay = ReefAngel.Relay.RelayData;
  TempRelay &= ReefAngel.Relay.RelayMaskOff;
  TempRelay |= ReefAngel.Relay.RelayMaskOn;
  ReefAngel.LCD.DrawOutletBox(12, 105, TempRelay);
}

void DrawCustomGraph()
{
  //Print "Pringle Lab Reef" at the top of the screen
  ReefAngel.LCD.DrawText(DefaultFGColor, DefaultBGColor, 18, 2, "Pringle Lab Reef");
  ReefAngel.LCD.DrawGraph(5,13);
}
////// Place global variable code above here


void setup()
{
  InternalMemory.LCDID_write(1);
  ReefAngel.Init();
  ReefAngel.InitMenu(pgm_read_word(&(menu_items[0])), SIZE(menu_items));
  ReefAngel.UseFlexiblePhCalibration();
  ReefAngel.FeedingModePorts = Port5Bit | Port6Bit; // Turn off Ports 5 & 6 (circulation pumps) when Feeding Mode is activated.
  ReefAngel.WaterChangePorts = Port8Bit;  // Turn off port 8 (return & skimmer pumps) when Water Change Mode is activated
  ReefAngel.Relay.On(returnPump); // Turn on return & skimmer pumps.
  //Initialize portal variables.
  //ReefAngel.CustomVar[Var_AWCCountTotal] = 0;
  //ReefAngel.CustomVar[Var_AWCCountToday] = 0;
  //ReefAngel.CustomVar[Var_AWCFillFail] = 0;
  //ReefAngel.CustomVar[Var_AWCDrainFail] = 0;
  //ReefAngel.CustomVar[Var_AWCATOFail] = 0;
  //startupTimer = now();
}

void loop()
{
  //Start an AWC once per day at AWCHour:AWCMinute if an AWC hasn't happened since midnight and there hasn't been an ATO timeout.
  AWCt = now();
  if (!AWCFail && (hour(AWCt) == AWCHour) && (minute(AWCt) == AWCMinute) && !AWCToday && !AWC && !ReefAngel.isATOTimeOut())
  {
    AWC = true;  //Sets the AWC control variable to true.
  }
   
  //Reset the automatic water change variable and AWC and dosing counts every day at midnight.  Also add the day's AWC count to the total AWC count.
  if (hour(AWCt) == 0 && minute(AWCt) == 0 && AWCToday)
  {
    AWCToday = false;
    //ReefAngel.CustomVar[Var_AWCCountTotal] += ReefAngel.CustomVar[Var_AWCCountToday];
    //ReefAngel.CustomVar[Var_AWCCountToday] = 0;
  }
   
  //Start the chain of AWC functions.
  if (AWC && !AWCToday && AWCCheck == 0)
  {
    AWCCheck = AWCATOCheck(); //If AWCATOCheck returns non-zero, it will also set AWCToday to true.
  }
 
  if (AWCCheck == 2)
  {
    if (!ReefAngel.HighATO.IsActive())
    {
      ReefAngel.Relay.Off(ATOPump);
      AWCCheck = 1;
    }
   
    if ((now() - ATOTimer) >= ATOTimeOut)
    {
      ReefAngel.Relay.Off(ATOPump);
      bitSet(ReefAngel.AlertFlags,ATOTimeOutFlag);  //Trigger ATO timeout flag.
      AWCFail = true;
      //ReefAngel.CustomVar[Var_AWCATOFail] = 1;
      AWCCheck = 0;
      AWC = false;
    }
  }
 
  if (AWCCheck == 1 && !ReefAngel.Relay.Status(AWCdrain))
  {
    AWCTimer = now();
    ReefAngel.Relay.On(AWCdrain);
  }
   
  if (ReefAngel.Relay.Status(AWCdrain))
  {
    if (ReefAngel.HighATO.IsActive())
    {
      ReefAngel.Relay.Off(AWCdrain);
      drained = true;
    }
   
    if (now()-AWCTimer >= AWCDrainSecs)
    {
      ReefAngel.Relay.Off(AWCdrain);
      AWCFail = true;
      //ReefAngel.CustomVar[Var_AWCDrainFail] = 1;
      AWCCheck = 0;
      AWC = false;
    }
  }

  if (drained)
  {
    if (!ReefAngel.Relay.Status(AWCfill))
    {
      AWCTimer = now();
      ReefAngel.Relay.On(AWCfill);
    }

    if (ReefAngel.Relay.Status(AWCfill))
    {
      if (!ReefAngel.HighATO.IsActive())
      {
        ReefAngel.Relay.Off(AWCfill);
        drained = false;
        AWC = false;
        AWCCheck = 0;
        //ReefAngel.CustomVar[Var_AWCCountToday] += 1;
      }

      if (now()-AWCTimer >= AWCFillSecs)
      {
        ReefAngel.Relay.Off(AWCfill);
        drained = false;
        AWCFail = true;
        //ReefAngel.CustomVar[Var_AWCFillFail] = 1;
        AWCCheck = 0;
        AWC = false;
      }
    }
  }
 
  //Light Control
  if (ReefAngel.Params.Temp[T1_PROBE] < highTempWarning)
  {
    ReefAngel.StandardLights(lights, 8,00, 18,00); //Lights on at 8 am and off at 6 pm.
  }
 
  //Temp control is handled by the chiller, but it and the lights will be turned off if the temp gets too high.
  if (ReefAngel.Params.Temp[T1_PROBE] >= highTempWarning)
  {
    ReefAngel.Relay.Off(lights);
    ReefAngel.Relay.Off(chiller);
  }
   
  //Wavemaker control
  ReefAngel.WavemakerRandom(clockCirc,30,300); // Turn clockwise circulation pumps on/off random cycles that lasts from 30 to 300 secs.
  ReefAngel.Relay.Set(countCirc,!ReefAngel.Relay.Status(clockCirc)); // Turn counterclockwise circulation pumps on/off on opposite cycle from clockwise circulation pumps.
   
  //ATO
  if (!AWC) {ReefAngel.SingleATO(false, ATOPump, ATOTimeOut, 0);} //Use single high float switch (false = high) for reef ATO with 100 second timeout and no frequency limit.
 
  ReefAngel.ShowInterface();
}
Any help will be much appreciated!

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

Re: New computer -> issues...

Post by rimai »

It is due to the changes Arduino updated PROGMEM.
Look at the changes for the IDE here: https://forum.reefangel.com/viewtopic.php?f=7&t=5993
I just tested your code and changed the PROGMEM stuff and it worked fine.
Roberto.
gaberosenfield
Posts: 89
Joined: Thu Mar 08, 2012 5:11 pm
Location: Redwood City, California

Re: New computer -> issues...

Post by gaberosenfield »

Thanks rimai!

It works now. I just needed to change the menu labels and initialization sections to:

Code: Select all

//Custom Menu Code
const unsigned char menu1_label[] PROGMEM = "Feed for 5 Mins";
const unsigned char menu2_label[] PROGMEM = "Start AWC";
const unsigned char menu3_label[] PROGMEM = "Clear Alerts & Vars";
const unsigned char menu4_label[] PROGMEM = "pH Calibration";
const unsigned char menu5_label[] PROGMEM = "Set Date & Time";
const unsigned char menu6_label[] PROGMEM = "Return & Skimmer";
const unsigned char menu7_label[] PROGMEM = "Version";
PROGMEM const char * const menu_items[] = {
menu1_label, menu2_label, menu3_label, menu4_label, menu5_label, menu6_label, menu7_label
};

Code: Select all

//Initialize menu in setup section
for (int a=0;a<SIZE(menu_items);a++)
  {
    ReefAngel.InitMenu(pgm_read_word(&(menu_items[a])),a);
  }
Thanks again,
Gabe
Post Reply