Power Cycling for WIFI
Posted: Wed Feb 15, 2012 6:51 pm
I keep loosing connection from my iPhone app every night until I power cycle the controller; then everything works great for 24 hours. I tried everything in this thread http://forum.reefangel.com/viewtopic.ph ... wifi#p4708 to the best of my ability but no dice (keep in mind that I am BARELY beginning to understand this thing) . This is the code I am using
Any help would be appreciated!
Code: Select all
#include <ReefAngel_Features.h>
#include <ReefAngel_Globals.h>
#include <ReefAngel_Wifi.h>
#include <Wire.h>
#include <OneWire.h>
#include <Time.h>
#include <DS1307RTC.h>
#include <ReefAngel_EEPROM.h>
#include <ReefAngel_NokiaLCD.h>
#include <ReefAngel_ATO.h>
#include <ReefAngel_Joystick.h>
#include <ReefAngel_LED.h>
#include <ReefAngel_TempSensor.h>
#include <ReefAngel_Relay.h>
#include <ReefAngel_PWM.h>
#include <ReefAngel_Timer.h>
#include <ReefAngel_Memory.h>
#include <ReefAngel.h>
void setup()
{
ReefAngel.Init(); //Initialize controller
}
void loop()
{
ReefAngel.SingleATOLow(Port1);
ReefAngel.StandardLights(Port2,14,30,20,30); // Turn Port 2 on at 14:30 and off at 20:30
ReefAngel.StandardLights(Port3,14,0,21,0); // Turn Port 3 on at 14:00 and off at 21:00
ReefAngel.StandardLights(Port4,13,30,21,30); // Turn Port 4 on at 14:00 and off at 21:00
ReefAngel.Wavemaker1(Port5);
ReefAngel.Wavemaker2(Port6);
ReefAngel.StandardHeater(Port7);
if (now()%43200<6) ReefAngel.Relay.On(Port8);
else ReefAngel.Relay.Off(Port8);
// You can only increment the dosing in seconds
// 43200 the frequency in seconds that the dosing pump will be activated. 24hrs= 86400s, 12hrs= 43200s
// 6 is the number of seconds that the dosing pump will stay on.
if (bitRead(ReefAngel.Relay.RelayData,3)==0)
{
ReefAngel.PWM.SetActinic(MoonPhase());
ReefAngel.PWM.SetDaylight(MoonPhase());
}
ReefAngel.ShowInterface();
}