Page 1 of 1

Re: Web portal and banner update issue

Posted: Tue Dec 30, 2014 7:22 am
by sesame
stare at least 20min, nothing happened in monitor window.
is there anything wrong with my RA+?

Re: Web portal and banner update issue

Posted: Tue Dec 30, 2014 7:52 am
by lnevo
Were you using teraterm or the Serial Monitor inside the Arduino app. Can you post your full code. Can you upload the code again and then monitor again via the serial monitor.

Re: Web portal and banner update issue

Posted: Tue Dec 30, 2014 7:58 am
by sesame
my code as attached

Code: Select all

#include <ReefAngel_Features.h>
#include <Globals.h>
#include <RA_Wifi.h>
#include <Wire.h>
#include <OneWire.h>
#include <Time.h>
#include <DS1307RTC.h>
#include <InternalEEPROM.h>
#include <RA_NokiaLCD.h>
#include <RA_ATO.h>
#include <RA_Joystick.h>
#include <LED.h>
#include <RA_TempSensor.h>
#include <Relay.h>
#include <RA_PWM.h>
#include <Timer.h>
#include <Memory.h>
#include <InternalEEPROM.h>
#include <RA_Colors.h>
#include <RA_CustomColors.h>
#include <Salinity.h>
#include <RF.h>
#include <IO.h>
#include <ORP.h>
#include <AI.h>
#include <PH.h>
#include <WaterLevel.h>
#include <Humidity.h>
#include <DCPump.h>
#include <ReefAngel.h>

// Define Relay Ports by Name
#define Return             1
#define ATOPump            2
#define Skimmer            3
#define Wavepump           4
#define None1              5
#define ZeovitShake        6
#define Relay_Box2         7
#define Heater             8

#define T5_Channel1        Box1_Port1
#define T5_Channel2        Box1_Port2
#define T5_Channel3        Box1_Port3
#define ZEO_ST3            Box1_Port4
#define ZEO_SP             Box1_Port5
#define CaHCO3             Box1_Port6
#define ZEO_BB             Box1_Port7
#define ZEO_KB             Box1_Port8



// Define Custom Memory Locations

////// 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.SetTemperatureUnit( Celsius );  // set to Celsius Temperature
    
    ReefAngel.Use2014Screen();  // Let's use 2014 Screen 
    
    // Ports toggled in Feeding Mode
    ReefAngel.FeedingModePorts = Port8Bit | Port4Bit | Port1Bit | Port2Bit;
    // Ports toggled in Water Change Mode
    ReefAngel.WaterChangePorts = Port1Bit | Port2Bit;
    // Ports toggled when Lights On / Off menu entry selected
    ReefAngel.LightsOnPorts = 0;
    // Ports turned off when Overheat temperature exceeded
    ReefAngel.OverheatShutoffPorts = Port8Bit;  //should be redefine to new ports
    // Use T1 probe as temperature and overheat functions
    ReefAngel.TempProbe = T3_PROBE;
    ReefAngel.OverheatProbe = T2_PROBE;
    
    // Feeeding and Water Change mode speed
    ReefAngel.DCPump.DaylightChannel = Sync;
    ReefAngel.DCPump.ActinicChannel = AntiSync;
    ReefAngel.DCPump.ExpansionChannel[0] = None;
    ReefAngel.DCPump.ExpansionChannel[1] = None;
    ReefAngel.DCPump.ExpansionChannel[2] = None;
    ReefAngel.DCPump.ExpansionChannel[3] = None;
    ReefAngel.DCPump.ExpansionChannel[4] = None;
    ReefAngel.DCPump.ExpansionChannel[5] = None;
    ReefAngel.DCPump.FeedingSpeed=0;
    ReefAngel.DCPump.WaterChangeSpeed=0;

    // Ports that are always on
    ReefAngel.Relay.On(Return);
    ReefAngel.Relay.On(Wavepump);
    ReefAngel.Relay.On(Relay_Box2);
    
    ////// Place additional initialization code below here
    
    ReefAngel.CustomLabels[0]="ReturnPump"; 
    ReefAngel.CustomLabels[1]="ATOPump"; 
    ReefAngel.CustomLabels[2]="Skimmer"; 
    ReefAngel.CustomLabels[3]="Wavepump"; 
    ReefAngel.CustomLabels[4]="None1"; 
    ReefAngel.CustomLabels[5]="ZeovitShake"; 
    ReefAngel.CustomLabels[6]="Relay_Box2"; 
    ReefAngel.CustomLabels[7]="Heater"; 

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

void loop()
{
  //single ATO 
    ReefAngel.SingleATO(true,ATOPump,90,1);
    ReefAngel.StandardHeater(Heater);
    ReefAngel.Relay.DelayedOn(Skimmer);

    // T5 light setup
    //ReefAngel.MoonLights(LunaLED); 
    ReefAngel.DosingPumpRepeat1(ZeovitShake);
    ReefAngel.StandardLights(T5_Channel2);
    ReefAngel.PWM.SetChannel(0,ReefAngel.Relay.Status(T5_Channel1)*100);
    ReefAngel.DayLights(T5_Channel1);
    ReefAngel.PWM.SetChannel(1,ReefAngel.Relay.Status(T5_Channel3)*100);
    ReefAngel.ActinicLights(T5_Channel3);
    ReefAngel.PWM.SetChannel(2,ReefAngel.Relay.Status(T5_Channel2)*100);


    //dosing pump setup
    ReefAngel.DosingPump(ZEO_ST3,1,22,31,28);
    ReefAngel.PWM.SetChannel(3,ReefAngel.Relay.Status(ZEO_ST3)*100);
    
    ReefAngel.DosingPump(ZEO_ST3,2,6,31,28);
    ReefAngel.PWM.SetChannel(3,ReefAngel.Relay.Status(ZEO_ST3)*100);
    
    ReefAngel.DosingPump(ZEO_SP,4,22,32,40);
    ReefAngel.PWM.SetChannel(4,ReefAngel.Relay.Status(ZEO_SP)*100);
    
    ReefAngel.DosingPumpRepeat2(CaHCO3);
    ReefAngel.PWM.SetChannel(5,ReefAngel.Relay.Status(CaHCO3)*100);

        
    
    //wave pump setup
    ReefAngel.DCPump.UseMemory = true;
    
    if (now() % SECS_PER_DAY >= 9 * SECS_PER_HOUR && now() % SECS_PER_DAY < (9 * SECS_PER_HOUR + 10 * SECS_PER_MIN) )
        {
            ReefAngel.DCPump.UseMemory=false;
            ReefAngel.DCPump.SetMode(Lagoon,90,20);//Set RW8 to 90% speed with  pulse in Lagoon Mode from 9:00~9:10
        }
        
       else if (now() % SECS_PER_DAY >= (9 * SECS_PER_HOUR + 10 * SECS_PER_MIN) && now() % SECS_PER_DAY < 10 * SECS_PER_HOUR )
        {
            ReefAngel.DCPump.UseMemory=false;
            ReefAngel.DCPump.SetMode(TidalSwell,90,20); //Set RW to 90% speed with 20ms pulse in Tidal Swell Mode
        }    
        
       else if (now() % SECS_PER_DAY >= 10 * SECS_PER_HOUR  && now() % SECS_PER_DAY < (10 * SECS_PER_HOUR + 30 * SECS_PER_MIN) )
        {
            ReefAngel.DCPump.UseMemory=false;
            ReefAngel.DCPump.SetMode(ReefCrest,85,20);//Set RW8 to 85% speed with Lagoon Pulse Mode
        } 
        
        else if (now() % SECS_PER_DAY >= (10 * SECS_PER_HOUR + 30 * SECS_PER_MIN)  && now() % SECS_PER_DAY < (11 * SECS_PER_HOUR + 10 * SECS_PER_MIN) )
        {
            ReefAngel.DCPump.UseMemory=false;
            ReefAngel.DCPump.SetMode(Lagoon,85,20);//Set RW8 to 85% speed with  pulse in Lagoon Mode 
        }
        
        else if (now() % SECS_PER_DAY >= (11 * SECS_PER_HOUR + 10 * SECS_PER_MIN)  && now() % SECS_PER_DAY < (12 * SECS_PER_HOUR + 0 * SECS_PER_MIN) )
        {
            ReefAngel.DCPump.UseMemory=false;
            ReefAngel.DCPump.SetMode(LongPulse,85,30);;//Set RW8 to 85% speed with Long pulse Mode 
        }
        
        else if (now() % SECS_PER_DAY >= (12 * SECS_PER_HOUR + 0 * SECS_PER_MIN) && now() % SECS_PER_DAY < 15 * SECS_PER_HOUR )
        {
            ReefAngel.DCPump.UseMemory=false;
            ReefAngel.DCPump.SetMode(TidalSwell,85,20); //Set RW to 85% speed with 20ms pulse in Tidal Swell Mode
        }
        
        else if (now() % SECS_PER_DAY >= 15 * SECS_PER_HOUR  && now() % SECS_PER_DAY < (17 * SECS_PER_HOUR + 0 * SECS_PER_MIN) )
        {
            ReefAngel.DCPump.UseMemory=false;
            ReefAngel.DCPump.SetMode(ReefCrest,85,20);//Set RW8 to 85% speed with Lagoon Pulse Mode
        }
        
        else if (now() % SECS_PER_DAY >= (17 * SECS_PER_HOUR + 0 * SECS_PER_MIN)  && now() % SECS_PER_DAY < (18 * SECS_PER_HOUR + 30 * SECS_PER_MIN))
        {
            ReefAngel.DCPump.UseMemory=false;
            ReefAngel.DCPump.SetMode(NutrientTransport,85,700);//Set WP40 to 90% speed with NutrientTransport Mode
        }
        
        else if (now() % SECS_PER_DAY >= (18 * SECS_PER_HOUR + 30 * SECS_PER_MIN)  && now() % SECS_PER_DAY < (18 * SECS_PER_HOUR + 30 * SECS_PER_MIN) )
        {
            ReefAngel.DCPump.UseMemory=false;
            ReefAngel.DCPump.SetMode(Lagoon,85,20);//Set RW8 to 80% speed with  pulse in Lagoon Mode 
        }        
        
        else if (now() % SECS_PER_DAY >= (19 * SECS_PER_HOUR + 0 * SECS_PER_MIN) && now() % SECS_PER_DAY < 20 * SECS_PER_HOUR )
        {
            ReefAngel.DCPump.UseMemory=false;
            ReefAngel.DCPump.SetMode(TidalSwell,85,20); //Set RW to 85% speed with 20ms pulse in Tidal Swell Mode
        }    
        
        else if (now() % SECS_PER_DAY >= 20 * SECS_PER_HOUR  && now() % SECS_PER_DAY < (22 * SECS_PER_HOUR + 30 * SECS_PER_MIN) )
        {
            ReefAngel.DCPump.UseMemory=false;
            ReefAngel.DCPump.SetMode(ReefCrest,75,20);//Set RW8 to 70% speed with Lagoon Pulse Mode
        } 
        
        else if (now() % SECS_PER_DAY >= (22 * SECS_PER_HOUR + 30 * SECS_PER_MIN)  && now() % SECS_PER_DAY < (22 * SECS_PER_HOUR + 35 * SECS_PER_MIN) )
        {
            ReefAngel.DCPump.UseMemory=false;
            ReefAngel.DCPump.SetMode(Lagoon,90,20);//Set RW8 to 90% speed with  pulse in Lagoon Mode, dossing coral feed.
        } 
                
       else 
        {
            ReefAngel.DCPump.UseMemory=false;
            ReefAngel.DCPump.SetMode(NutrientTransport,40,30);
        } 
        
    // Set timer when in feeding mode
    static unsigned long feeding;
    if (ReefAngel.DisplayedMenu==FEEDING_MODE) feeding=now();
    if (now()-feeding<1*SECS_PER_HOUR) { 
    // Continue NTM for the 60 minutes
    ReefAngel.DCPump.UseMemory=false;
    ReefAngel.DCPump.Mode=NutrientTransport;
    }
    
    //Autofeeder 
    if ( ((hour() == 18)) && (minute() == 58) &&(second() == 30) ) ReefAngel.FeedingModeStart();
 
    //Skimmer off 1.5 hours when coral feeding.
    if (now()%SECS_PER_DAY >= (22 * SECS_PER_HOUR + 30 * SECS_PER_MIN)  && now()%SECS_PER_DAY < (23 * SECS_PER_HOUR + 30 * SECS_PER_MIN) )
    {
      ReefAngel.Relay.Off(Skimmer); 
    } 

    ////// Place your custom code below here
   static boolean powerOutage=false;
    ReefAngel.UseFlexiblePhCalibration();
  // Power Outage - turn off everything
  if (!ReefAngel.Relay.IsRelayPresent(MAIN_RELAY)) // Main Relay NOT present
  {
    powerOutage=true;
    ReefAngel.Relay.Off(Return); 
    ReefAngel.Relay.Off(Skimmer); 
    ReefAngel.Relay.Off(None1); 
    ReefAngel.Relay.Off(Wavepump);
    ReefAngel.Relay.Off(ZeovitShake);
    ReefAngel.Relay.Off(Heater);  
    ReefAngel.Relay.Off(Relay_Box2); 
    ReefAngel.Relay.Off(ATOPump);
  }

  // Power Restored - Turn things back on
  if (powerOutage && ReefAngel.Relay.IsRelayPresent(MAIN_RELAY))
  {
    LastStart=now();
    powerOutage=false;
    ReefAngel.Relay.On(Return); 
    ReefAngel.Relay.On(Skimmer); 
    ReefAngel.Relay.On(Wavepump); 
  }
   
     // Turn off Skimmer if Return pump has been shutoff.   
  if (!ReefAngel.Relay.Status(Return)) {
      ReefAngel.Relay.Off(Skimmer);
      ReefAngel.Relay.Off(Heater);
  }

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

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

Re: Web portal and banner update issue

Posted: Tue Dec 30, 2014 8:11 am
by sesame
lnevo wrote:Were you using teraterm or the Serial Monitor inside the Arduino app. Can you post your full code. Can you upload the code again and then monitor again via the serial monitor.
using Arduino Serial monitor. another 10 min. but nothing popup.
may have issue with my laptop?

Re: Web portal and banner update issue

Posted: Tue Dec 30, 2014 9:14 am
by rimai
It is weird, because if you can upload codes, you should be able to get it to send data.
To make sure we are in the same page, upload this same above code one more time and right after upload, open Serial Monitor without disconnecting the cable or even touching it at all.
Do you get anything after 10 to 15mins?
If you do not, make sure that "Both NL & CR" is selected on the left side of the baud rate.
On the top part of the window, by the Send button, type "GET / HTTP" and hit enter.
Do you get anything now?

Re: Web portal and banner update issue

Posted: Tue Dec 30, 2014 9:22 am
by lnevo
Should also add some Serial.println as a test..

Re: Web portal and banner update issue

Posted: Tue Dec 30, 2014 9:33 am
by sesame
Will have another try

Re: Web portal and banner update issue

Posted: Tue Dec 30, 2014 9:39 am
by lnevo
Your code looks fine, nothing that would interfere. Just an FYI though, you can't monitor for power outages with the main relay box since the RA will also lose power in that scenario. You can monitor your expansion relay boxes only.

Re: Web portal and banner update issue

Posted: Wed Dec 31, 2014 7:01 am
by sesame
upload code again, and checked with buildin monitor, nothing happend at "both nl / cr"

type get / http shown message below:

HTTP/1.1 200 OK
Server: ReefAngel
Cache-Control: no-store, no-cache, must-revalidate
Pragma: no-cache
Connection: close
Content-Type: text/html
Content-Length: 41

<h1>Reef Angel Controller Web Server</h1>

Re: Web portal and banner update issue

Posted: Wed Dec 31, 2014 8:31 am
by lnevo
ok so I/O is working.. very odd. Did you add a Serial.println as a test?

Re: Web portal and banner update issue

Posted: Wed Dec 31, 2014 8:50 am
by sesame
lnevo wrote:ok so I/O is working.. very odd. Did you add a Serial.println as a test?
how to, no idea. thank you

Re: Web portal and banner update issue

Posted: Wed Dec 31, 2014 9:01 am
by lnevo
Add this in your loop:

Serial.println("test");

Re: Web portal and banner update issue

Posted: Wed Dec 31, 2014 9:11 am
by sesame
lnevo wrote:Add this in your loop:

Serial.println("test");
"test" popup crazy in monitor. is that means it works?

Re: Web portal and banner update issue

Posted: Wed Dec 31, 2014 9:26 am
by lnevo
Yeah. I would remove your libraries folder and re-install the ReefAngel installer at this point. Serial I/O is working and you can obviously communicate with the wifi module. Something is not right that the portal timer is not working. If a libraries re-install does not help, I would suggest regenerating a new basic code and testing.

Re: Web portal and banner update issue

Posted: Wed Dec 31, 2014 9:27 am
by rimai
Yes... You can remove that line now.
There doesn't seem to be any reason why your controller doesn't send data.

Re: Web portal and banner update issue

Posted: Wed Dec 31, 2014 11:30 am
by rimai
Jesus!!!!
I spent all morning today trying to figure out why this wasn't working...
Here is the offending line:

Code: Select all

ReefAngel.DosingPump(ZEO_SP,4,22,32,40);
The timer 4 is in charge of sending data to the Portal.
It never struck at me that you were using that function. I though that was a repeat dosing schedule for some reason.
We need to change that function to not use timers at all.
This is the same equivalent:

Code: Select all

if (hour()==22 && minute()==32 && second()<40)
{
ReefAngel.Relay.On(ZEO_SP);
}
else
{
ReefAngel.Relay.Off(ZEO_SP);
}
Try this out and let me know if that works for you.

Re: Web portal and banner update issue

Posted: Wed Dec 31, 2014 11:46 am
by lnevo
Awesome find! I was looking for it and it was completely hidden there :) I thought the DosingPump functions already had that out.. I guess only the Repeat ones have been.

Re: Web portal and banner update issue

Posted: Wed Dec 31, 2014 7:44 pm
by sesame
Wahoo!!
great new year gifts. :) :) :)
change code as Roberto attached. got some thing from serial port.

GET /status/submitp.aspx?t1=187&t2=223&t3=226&ph=793&id=sesame&em=1&em1=2&rem=1&bid=1&key=&ddns=&af=0&sf=0&atohigh=0&atolow=0&r=205&ron=0&roff=255&r1=4&ron1=0&roff1=255&pwma=90&pwmd=80&pwmao=255&pwmdo=255&pwme0=0&pwme0O=255&pwme1=100&pwme1O=255&pwme2=0&pwme2O=255&pwme3=0&pwme3O=255&pwme4=0&pwme4O=255&pwme5=0&pwme5O=255&dcm=1&dcs=85&dcd=20&dct=30

waiting half an hour to see if any changes from portal.

sorry havent remember to change code this area. should be careful next time.
but im thinking if possible to add more "DosingPumpRepert" function in lib and iOS App as well.
easy to change and adjust by mobile device.

Re: Web portal and banner update issue

Posted: Wed Dec 31, 2014 9:17 pm
by sesame
portal and banner get back to work.
thank you for your support Roberto, Lee. appreciate and best support i've ever have.

Re: Web portal and banner update issue

Posted: Thu Jan 01, 2015 7:56 am
by lnevo
Glad it's working now! Happy New Year!