WiFi Help
Posted: Mon May 02, 2011 2:41 pm
Hello Group,
Before I get into the Issue that I'm experiencing please allow me to Thank the people who are responsible for an excellent reef controller with unlimited potential. My experience with the system has only been for a short time and by NO means can I write code but with the help of the RAGEN and Roberto it has been easier then I would have guessed.
The problem that I'm current having is twofold, 1st I cannot write any new codes because RAGEN will not run on the system dedicated to the REEF ANGEL in either the static mode or installed and I'm not really sure what happen to cause this problem but I can say the PC hasn't been modified or any new software added. But the Home network did get a new wireless router to allow me to secure the connection to the WiFi adapter. The WiFi adapter is seen when I use the setup codes.
This brings me to the 2nd part of the problem I cannot create a new code and I don’t know how to modify my current code that used the USB connection to log to the computer. If anyone can help with these issues I would be very grateful. I will post my current sketch for your review and comments please keep in mind this code is currently only controlling 6 meanwells and the main pump.
Thanks for your help
Don
// Autogenerated file by RAGen (v1.0.3.79), (03/19/2011 08:12)
// RA_031911_0812.pde
//
// This version designed for v0.8.5 Beta 12 or later
/* The following features are enabled for this PDE File:
#define WavemakerSetup
#define ATOSetup
#define MetalHalideSetup
#define wifi
#define StandardLightSetup
*/
#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>
ReefAngel_TimerClass ParamTimer;
/*
----------------------------------------------------------------------------------------------------------------------------------------------------------
Give labels to your PWM channels
----------------------------------------------------------------------------------------------------------------------------------------------------------
*/
#define WhitePWM1 0
#define BluePWM1 1
#define WhitePWM2 2
#define BluePWM2 3
#define WhitePWM3 4
#define BluePWM3 5
byte PWMChannel[]={
0,0,0,0,0,0};
// Labels for the web banner
#include <avr/pgmspace.h>
prog_char id_label[] PROGMEM = "Reef Tank";
prog_char probe1_label[] PROGMEM = "Water";
prog_char probe2_label[] PROGMEM = "Room";
prog_char probe3_label[] PROGMEM = "light";
prog_char relay1_label[] PROGMEM = "Main%20pump";
prog_char relay2_label[] PROGMEM = "skimmer";
prog_char relay3_label[] PROGMEM = "Heater%201";
prog_char relay4_label[] PROGMEM = "Heater%202";
prog_char relay5_label[] PROGMEM = "Always%20on";
prog_char relay6_label[] PROGMEM = "Chiller";
prog_char relay7_label[] PROGMEM = "LED%20Royal%20Blue";
prog_char relay8_label[] PROGMEM = "LED%20Cool%20White";
PROGMEM const char *webbanner_items[] = {
id_label, probe1_label, probe2_label, probe3_label, relay1_label, relay2_label,
relay3_label, relay4_label, relay5_label, relay6_label, relay7_label, relay8_label};
void setup()
{
ReefAngel.Init(); //Initialize controller
ReefAngel.PHMin=368;
ReefAngel.PHMax=655 ;
ReefAngel.FeedingModePorts = B00001111;
ReefAngel.WaterChangePorts = B00001111;
ReefAngel.OverheatShutoffPorts = B11001100;
ReefAngel.LightsOnPorts = B11000000;
// Ports that are always on
ReefAngel.Relay.On(Port1);
// Initialize and start the Parameter timer
ParamTimer.SetInterval(15); // set interval to 15 seconds
ParamTimer.Start();
}
void loop()
{
ReefAngel.ShowInterface();
if ( ParamTimer.IsTriggered() )
{
ParamTimer.Start();
ReefAngel.PCLogging();
}
//This section calculates the slope
PWMChannel[WhitePWM1]=2.55*PWMSlope(12,15,21,00,0,30,60,PWMChannel[WhitePWM1]); // calculate slope for 0 to 50% starting at 12:30pm with duration of 60min, then from 50% to 0 from 17:00pm with duration of 60min
PWMChannel[BluePWM1]=2.55*PWMSlope(06,45,21,15,0,50,60,PWMChannel[BluePWM1]);
PWMChannel[WhitePWM2]=2.55*PWMSlope(12,16,21,00,0,30,60,PWMChannel[WhitePWM2]);
PWMChannel[BluePWM2]=2.55*PWMSlope(06,46,22,15,0,50,60,PWMChannel[BluePWM2]);
PWMChannel[WhitePWM3]=2.55*PWMSlope(12,17,21,00,0,30,60,PWMChannel[WhitePWM3]);
PWMChannel[BluePWM3]=2.55*PWMSlope(06,47,21,15,0,50,60, PWMChannel[BluePWM3]);
// this section sends the data to the PWM expansion module
PWMExpansion(WhitePWM1,PWMChannel[WhitePWM1]);
PWMExpansion(BluePWM1,PWMChannel[BluePWM1]);
PWMExpansion(WhitePWM2,PWMChannel[WhitePWM2]);
PWMExpansion(BluePWM2,PWMChannel[BluePWM2]);
PWMExpansion(WhitePWM3,PWMChannel[WhitePWM3]);
PWMExpansion(BluePWM3,PWMChannel[BluePWM3]);
}
void PWMExpansion(byte cmd, byte data)
{
Wire.beginTransmission(2); // transmit to device #2
Wire.send('$'); // sends $
Wire.send('$'); // sends $
Wire.send('$'); // sends $
Wire.send(cmd); // sends a value
Wire.send(data); // sends 255
Wire.endTransmission(); // stop transmitting
}
Before I get into the Issue that I'm experiencing please allow me to Thank the people who are responsible for an excellent reef controller with unlimited potential. My experience with the system has only been for a short time and by NO means can I write code but with the help of the RAGEN and Roberto it has been easier then I would have guessed.
The problem that I'm current having is twofold, 1st I cannot write any new codes because RAGEN will not run on the system dedicated to the REEF ANGEL in either the static mode or installed and I'm not really sure what happen to cause this problem but I can say the PC hasn't been modified or any new software added. But the Home network did get a new wireless router to allow me to secure the connection to the WiFi adapter. The WiFi adapter is seen when I use the setup codes.
This brings me to the 2nd part of the problem I cannot create a new code and I don’t know how to modify my current code that used the USB connection to log to the computer. If anyone can help with these issues I would be very grateful. I will post my current sketch for your review and comments please keep in mind this code is currently only controlling 6 meanwells and the main pump.
Thanks for your help
Don
// Autogenerated file by RAGen (v1.0.3.79), (03/19/2011 08:12)
// RA_031911_0812.pde
//
// This version designed for v0.8.5 Beta 12 or later
/* The following features are enabled for this PDE File:
#define WavemakerSetup
#define ATOSetup
#define MetalHalideSetup
#define wifi
#define StandardLightSetup
*/
#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>
ReefAngel_TimerClass ParamTimer;
/*
----------------------------------------------------------------------------------------------------------------------------------------------------------
Give labels to your PWM channels
----------------------------------------------------------------------------------------------------------------------------------------------------------
*/
#define WhitePWM1 0
#define BluePWM1 1
#define WhitePWM2 2
#define BluePWM2 3
#define WhitePWM3 4
#define BluePWM3 5
byte PWMChannel[]={
0,0,0,0,0,0};
// Labels for the web banner
#include <avr/pgmspace.h>
prog_char id_label[] PROGMEM = "Reef Tank";
prog_char probe1_label[] PROGMEM = "Water";
prog_char probe2_label[] PROGMEM = "Room";
prog_char probe3_label[] PROGMEM = "light";
prog_char relay1_label[] PROGMEM = "Main%20pump";
prog_char relay2_label[] PROGMEM = "skimmer";
prog_char relay3_label[] PROGMEM = "Heater%201";
prog_char relay4_label[] PROGMEM = "Heater%202";
prog_char relay5_label[] PROGMEM = "Always%20on";
prog_char relay6_label[] PROGMEM = "Chiller";
prog_char relay7_label[] PROGMEM = "LED%20Royal%20Blue";
prog_char relay8_label[] PROGMEM = "LED%20Cool%20White";
PROGMEM const char *webbanner_items[] = {
id_label, probe1_label, probe2_label, probe3_label, relay1_label, relay2_label,
relay3_label, relay4_label, relay5_label, relay6_label, relay7_label, relay8_label};
void setup()
{
ReefAngel.Init(); //Initialize controller
ReefAngel.PHMin=368;
ReefAngel.PHMax=655 ;
ReefAngel.FeedingModePorts = B00001111;
ReefAngel.WaterChangePorts = B00001111;
ReefAngel.OverheatShutoffPorts = B11001100;
ReefAngel.LightsOnPorts = B11000000;
// Ports that are always on
ReefAngel.Relay.On(Port1);
// Initialize and start the Parameter timer
ParamTimer.SetInterval(15); // set interval to 15 seconds
ParamTimer.Start();
}
void loop()
{
ReefAngel.ShowInterface();
if ( ParamTimer.IsTriggered() )
{
ParamTimer.Start();
ReefAngel.PCLogging();
}
//This section calculates the slope
PWMChannel[WhitePWM1]=2.55*PWMSlope(12,15,21,00,0,30,60,PWMChannel[WhitePWM1]); // calculate slope for 0 to 50% starting at 12:30pm with duration of 60min, then from 50% to 0 from 17:00pm with duration of 60min
PWMChannel[BluePWM1]=2.55*PWMSlope(06,45,21,15,0,50,60,PWMChannel[BluePWM1]);
PWMChannel[WhitePWM2]=2.55*PWMSlope(12,16,21,00,0,30,60,PWMChannel[WhitePWM2]);
PWMChannel[BluePWM2]=2.55*PWMSlope(06,46,22,15,0,50,60,PWMChannel[BluePWM2]);
PWMChannel[WhitePWM3]=2.55*PWMSlope(12,17,21,00,0,30,60,PWMChannel[WhitePWM3]);
PWMChannel[BluePWM3]=2.55*PWMSlope(06,47,21,15,0,50,60, PWMChannel[BluePWM3]);
// this section sends the data to the PWM expansion module
PWMExpansion(WhitePWM1,PWMChannel[WhitePWM1]);
PWMExpansion(BluePWM1,PWMChannel[BluePWM1]);
PWMExpansion(WhitePWM2,PWMChannel[WhitePWM2]);
PWMExpansion(BluePWM2,PWMChannel[BluePWM2]);
PWMExpansion(WhitePWM3,PWMChannel[WhitePWM3]);
PWMExpansion(BluePWM3,PWMChannel[BluePWM3]);
}
void PWMExpansion(byte cmd, byte data)
{
Wire.beginTransmission(2); // transmit to device #2
Wire.send('$'); // sends $
Wire.send('$'); // sends $
Wire.send('$'); // sends $
Wire.send(cmd); // sends a value
Wire.send(data); // sends 255
Wire.endTransmission(); // stop transmitting
}