Time problem
-
- Posts: 67
- Joined: Tue Sep 18, 2012 8:00 pm
- Location: Spruce Pine Alabama
Time problem
I noticed that the time and date on the head unit was wrong. It shows 1/2/00 3:21 Am. I tried uploading my latest code. Nothing changed. I uninstalled the RA installer and uploaded it again. Now when I try to upload my code I get the error uploading message. Any idea what I can do?
[quote]
#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 <AI.h>
#include <RF.h>
#include <IO.h>
#include <ORP.h>
#include <Salinity.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.WaterChangePorts= Port1Bit | Port2Bit | Port3Bit | Port5Bit | Port6Bit;
// Ports that are always on
ReefAngel.Relay.On(Port1);
ReefAngel.Relay.On(Port2);
ReefAngel.Relay.On(Port3);
ReefAngel.Relay.On(Port4);
////// Place additional initialization code below here
////// Place additional initialization code above here
}
void loop()
{
// Specific functions that use Internal Memory values
ReefAngel.Wavemaker(Port5,60);
ReefAngel.Wavemaker(Port6,120);
ReefAngel.StandardHeater(Port7,757,763);
// ReefAngel.StandardLights(Port8,17,0,13,0);
if ( (hour()>=2) && (hour()<5) ) {
ReefAngel.WaterLevelATO(Port8,450,85,90); // 450 seconds timeout, turn on at 85% and turn off at 90%
}
ReefAngel.PWM.SetDaylight( MoonPhase() );
ReefAngel.PWM.SetActinic( MoonPhase() );
////// Place your custom code below here
////// Place your custom code above here
// This should always be the last line
ReefAngel.ShowInterface();
}
void DrawCustomMain()
{
int x,y;
char text[10];
// Parameters
#if defined DisplayLEDPWM && ! defined RemoveAllLights
ReefAngel.LCD.DrawMonitor( 15, 14, ReefAngel.Params,
ReefAngel.PWM.GetDaylightValue(), ReefAngel.PWM.GetActinicValue() );
#else // defined DisplayLEDPWM && ! defined RemoveAllLights
ReefAngel.LCD.DrawMonitor( 15, 14, ReefAngel.Params );
#endif // defined DisplayLEDPWM && ! defined RemoveAllLights
pingSerial();
// Salinity
ReefAngel.LCD.DrawText( COLOR_DARKKHAKI,DefaultBGColor,15,54, "SAL:" );
ReefAngel.LCD.DrawText( COLOR_BLACK,DefaultBGColor,39,54, ReefAngel.Params.Salinity );
pingSerial();
// Water Level
ReefAngel.LCD.DrawText( COLOR_DARKGOLDENROD,DefaultBGColor,75,75, "WL:" );
ReefAngel.LCD.DrawText( COLOR_DARKGOLDENROD,DefaultBGColor,99,75, ReefAngel.WaterLevel.GetLevel() );
pingSerial();
// Main Relay Box
byte TempRelay = ReefAngel.Relay.RelayData;
TempRelay &= ReefAngel.Relay.RelayMaskOff;
TempRelay |= ReefAngel.Relay.RelayMaskOn;
ReefAngel.LCD.DrawOutletBox( 12, 95, TempRelay );
pingSerial();
// Date and Time
ReefAngel.LCD.DrawDate( 6, 122 );
pingSerial();
}
void DrawCustomGraph()
{
}
[quote]
#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 <AI.h>
#include <RF.h>
#include <IO.h>
#include <ORP.h>
#include <Salinity.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.WaterChangePorts= Port1Bit | Port2Bit | Port3Bit | Port5Bit | Port6Bit;
// Ports that are always on
ReefAngel.Relay.On(Port1);
ReefAngel.Relay.On(Port2);
ReefAngel.Relay.On(Port3);
ReefAngel.Relay.On(Port4);
////// Place additional initialization code below here
////// Place additional initialization code above here
}
void loop()
{
// Specific functions that use Internal Memory values
ReefAngel.Wavemaker(Port5,60);
ReefAngel.Wavemaker(Port6,120);
ReefAngel.StandardHeater(Port7,757,763);
// ReefAngel.StandardLights(Port8,17,0,13,0);
if ( (hour()>=2) && (hour()<5) ) {
ReefAngel.WaterLevelATO(Port8,450,85,90); // 450 seconds timeout, turn on at 85% and turn off at 90%
}
ReefAngel.PWM.SetDaylight( MoonPhase() );
ReefAngel.PWM.SetActinic( MoonPhase() );
////// Place your custom code below here
////// Place your custom code above here
// This should always be the last line
ReefAngel.ShowInterface();
}
void DrawCustomMain()
{
int x,y;
char text[10];
// Parameters
#if defined DisplayLEDPWM && ! defined RemoveAllLights
ReefAngel.LCD.DrawMonitor( 15, 14, ReefAngel.Params,
ReefAngel.PWM.GetDaylightValue(), ReefAngel.PWM.GetActinicValue() );
#else // defined DisplayLEDPWM && ! defined RemoveAllLights
ReefAngel.LCD.DrawMonitor( 15, 14, ReefAngel.Params );
#endif // defined DisplayLEDPWM && ! defined RemoveAllLights
pingSerial();
// Salinity
ReefAngel.LCD.DrawText( COLOR_DARKKHAKI,DefaultBGColor,15,54, "SAL:" );
ReefAngel.LCD.DrawText( COLOR_BLACK,DefaultBGColor,39,54, ReefAngel.Params.Salinity );
pingSerial();
// Water Level
ReefAngel.LCD.DrawText( COLOR_DARKGOLDENROD,DefaultBGColor,75,75, "WL:" );
ReefAngel.LCD.DrawText( COLOR_DARKGOLDENROD,DefaultBGColor,99,75, ReefAngel.WaterLevel.GetLevel() );
pingSerial();
// Main Relay Box
byte TempRelay = ReefAngel.Relay.RelayData;
TempRelay &= ReefAngel.Relay.RelayMaskOff;
TempRelay |= ReefAngel.Relay.RelayMaskOn;
ReefAngel.LCD.DrawOutletBox( 12, 95, TempRelay );
pingSerial();
// Date and Time
ReefAngel.LCD.DrawDate( 6, 122 );
pingSerial();
}
void DrawCustomGraph()
{
}
-
- Posts: 67
- Joined: Tue Sep 18, 2012 8:00 pm
- Location: Spruce Pine Alabama
Re: Time problem
They are communicating. I don't get the com port error. The red light flashes when I plug up the cable and when it stars trying to upload.
-
- Posts: 67
- Joined: Tue Sep 18, 2012 8:00 pm
- Location: Spruce Pine Alabama
Re: Time problem
All it says is error uploading.
-
- Posts: 67
- Joined: Tue Sep 18, 2012 8:00 pm
- Location: Spruce Pine Alabama
Re: Time problem
Maybe I'm looking in the wrong spot. The screen is split. The top is the code I'm loading. The bottom is what it's loading. In between the two screens. There is a message that says error uploading. The bottom box doesn't show an error that I see. I'll try it again this even I no when I get home and if it still won't update. I'll attach a screen shot.
-
- Posts: 67
- Joined: Tue Sep 18, 2012 8:00 pm
- Location: Spruce Pine Alabama
Re: Time problem
Here is what it says. This is at the bottom and its the closest thing I see to an error message.
avrdude: stk500v2_receivemessage() timeout
avrdude: stk500v2_getsync() timeout communicating with programmer
avrdude done Thank you
avrdude: stk500v2_receivemessage() timeout
avrdude: stk500v2_getsync() timeout communicating with programmer
avrdude done Thank you
-
- Posts: 67
- Joined: Tue Sep 18, 2012 8:00 pm
- Location: Spruce Pine Alabama
Re: Time problem
I believe it the RA.
-
- Posts: 67
- Joined: Tue Sep 18, 2012 8:00 pm
- Location: Spruce Pine Alabama
Re: Time problem
It is the RA
Re: Time problem
Make sure to change the board to RA w/ optiboot and not RA+ under Tools->Board
Roberto.
-
- Posts: 67
- Joined: Tue Sep 18, 2012 8:00 pm
- Location: Spruce Pine Alabama
Re: Time problem
That worked as far as uploading to the controller. However it still didnt change the time on it?
Re: Time problem
It won't change the time.
You can do it easily with the portal or android app, but it looks like you don't have it.
Try adding this to your setup():
The standard RA has limited memory, so it may not fit.
If your code gets too big with this, you will have to upload the preloaded code, change the time and upload your code again.
You can do it easily with the portal or android app, but it looks like you don't have it.
Try adding this to your setup():
Code: Select all
ReefAngel.AddDateTimeMenu();
If your code gets too big with this, you will have to upload the preloaded code, change the time and upload your code again.
Roberto.
-
- Posts: 67
- Joined: Tue Sep 18, 2012 8:00 pm
- Location: Spruce Pine Alabama
Re: Time problem
Where does this go? code go?
-
- Posts: 67
- Joined: Tue Sep 18, 2012 8:00 pm
- Location: Spruce Pine Alabama
Re: Time problem
Im not real sure where to put it. Can you look at my first entry and show me? Thanks
-
- Posts: 67
- Joined: Tue Sep 18, 2012 8:00 pm
- Location: Spruce Pine Alabama
Re: Time problem
Nevermind I got it. Thanks it worked.
-
- Posts: 67
- Joined: Tue Sep 18, 2012 8:00 pm
- Location: Spruce Pine Alabama
Re: Time problem
I have a new problem.Since I made the change and got the time corrected. The wavemakers do not turn off during feeding mode. I tried loading the older code back to the controller and it still does not work. Ive added the code below.
#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 <AI.h>
#include <RF.h>
#include <IO.h>
#include <ORP.h>
#include <Salinity.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.WaterChangePorts= Port1Bit | Port2Bit | Port3Bit | Port5Bit | Port6Bit;
// Ports that are always on
ReefAngel.Relay.On(Port1);
ReefAngel.Relay.On(Port2);
ReefAngel.Relay.On(Port3);
ReefAngel.Relay.On(Port4);
////// Place additional initialization code below here
////// Place additional initialization code above here
}
void loop()
{
// Specific functions that use Internal Memory values
ReefAngel.Wavemaker(Port5,60);
ReefAngel.Wavemaker(Port6,120);
ReefAngel.StandardHeater(Port7,757,763);
// ReefAngel.StandardLights(Port8,17,0,13,0);
if ( (hour()>=2) && (hour()<5) ) {
ReefAngel.WaterLevelATO(Port8,450,85,90); // 450 seconds timeout, turn on at 85% and turn off at 90%
}
ReefAngel.PWM.SetDaylight( MoonPhase() );
ReefAngel.PWM.SetActinic( MoonPhase() );
////// Place your custom code below here
////// Place your custom code above here
// This should always be the last line
ReefAngel.ShowInterface();
}
void DrawCustomMain()
{
int x,y;
char text[10];
// Parameters
#if defined DisplayLEDPWM && ! defined RemoveAllLights
ReefAngel.LCD.DrawMonitor( 15, 14, ReefAngel.Params,
ReefAngel.PWM.GetDaylightValue(), ReefAngel.PWM.GetActinicValue() );
#else // defined DisplayLEDPWM && ! defined RemoveAllLights
ReefAngel.LCD.DrawMonitor( 15, 14, ReefAngel.Params );
#endif // defined DisplayLEDPWM && ! defined RemoveAllLights
pingSerial();
// Salinity
ReefAngel.LCD.DrawText( COLOR_DARKKHAKI,DefaultBGColor,15,54, "SAL:" );
ReefAngel.LCD.DrawText( COLOR_BLACK,DefaultBGColor,39,54, ReefAngel.Params.Salinity );
pingSerial();
// Water Level
ReefAngel.LCD.DrawText( COLOR_DARKGOLDENROD,DefaultBGColor,75,75, "WL:" );
ReefAngel.LCD.DrawText( COLOR_DARKGOLDENROD,DefaultBGColor,99,75, ReefAngel.WaterLevel.GetLevel() );
pingSerial();
// Main Relay Box
byte TempRelay = ReefAngel.Relay.RelayData;
TempRelay &= ReefAngel.Relay.RelayMaskOff;
TempRelay |= ReefAngel.Relay.RelayMaskOn;
ReefAngel.LCD.DrawOutletBox( 12, 95, TempRelay );
pingSerial();
// Date and Time
ReefAngel.LCD.DrawDate( 6, 122 );
pingSerial();
ReefAngel.AddDateTimeMenu();
}
void DrawCustomGraph()
{
}
Re: Time problem
Change this:
To this:
Code: Select all
ReefAngel.Wavemaker(Port5,60);
ReefAngel.Wavemaker(Port6,120);
Code: Select all
ReefAngel.Wavemaker1(Port5,60);
ReefAngel.Wavemaker2(Port6,120);
Roberto.
-
- Posts: 67
- Joined: Tue Sep 18, 2012 8:00 pm
- Location: Spruce Pine Alabama
Re: Time problem
When I deleted the old code and added the new code. I got the following error message. No matching function for call to ReefAngelClass::Wavemaker1(int,int)'
Re: Time problem
Damn... I totally misread your request.
Forget about the change... Sorry.
You need to add this:
Forget about the change... Sorry.
You need to add this:
Code: Select all
ReefAngel.FeedingModePorts= Port5Bit | Port6Bit;
Roberto.
-
- Posts: 67
- Joined: Tue Sep 18, 2012 8:00 pm
- Location: Spruce Pine Alabama
Re: Time problem
Where do I put it?
-
- Posts: 67
- Joined: Tue Sep 18, 2012 8:00 pm
- Location: Spruce Pine Alabama
Re: Time problem
Nevermind. I think I got it. It seems to work. Thanks again.
-
- Posts: 67
- Joined: Tue Sep 18, 2012 8:00 pm
- Location: Spruce Pine Alabama
Re: Time problem
My water level expansion has quit working. It reads zeros on the screen and when I try to calibrate it . All zeros. I tried unplugging it and redownloading my programming. Neither had any effect. Any ideas or will it have to be replaced?