Page 1 of 2

Re: RA* Unable to Update via Remote Upload

Posted: Sat Sep 29, 2018 7:07 pm
by rimai
Let me check the server log and see what the request looked like.

Re: RA* Unable to Update via Remote Upload

Posted: Sun Sep 30, 2018 9:41 pm
by rimai
I couldn't find any log.
Maybe the server doesn't log this type of error.
I don't know what to make out of this.
Does it get disconnected from the cloud server too?

Re: RA* Unable to Update via Remote Upload

Posted: Mon Oct 01, 2018 4:38 am
by ReefingHavoc
No

Re: RA* Unable to Update via Remote Upload

Posted: Sun Oct 07, 2018 5:07 pm
by ReefingHavoc
Any further thoughts on this?

Re: RA* Unable to Update via Remote Upload

Posted: Mon Oct 08, 2018 2:35 pm
by rimai
Not sure.
I don't understand how it stays connected when you are monitoring by itself and not when you bring downstairs.

Re: RA* Unable to Update via Remote Upload

Posted: Mon Oct 08, 2018 4:44 pm
by ReefingHavoc
The unit says connected and I can do things like turn on/off ports and clear alerts through my phone. The problem is that for some reason it stops connecting to the Portal after some time which prohibits me from sending remote uploads and receiving any email alerts or updates to the Portal. There is no difference on where it is located.

The reference to taking it downstairs had to do with troubleshooting. I originally thought the problem was where it was connected, thinking it was a networking issue. I proved that wrong by setting up the monitor and verifying that the device was logging a 400 error after some time. I left the monitor on for 24 hours and it never reconnected to the portal after the 400 errors started.

Re: RA* Unable to Update via Remote Upload

Posted: Mon Oct 08, 2018 10:53 pm
by rimai
I am wondering if it does the same with a very basic code with just the cloudportal function.

Re: RA* Unable to Update via Remote Upload

Posted: Tue Oct 09, 2018 8:06 am
by ReefingHavoc
Let me know if you want me to test something

Re: RA* Unable to Update via Remote Upload

Posted: Tue Oct 09, 2018 9:26 am
by rimai
Try running a new code with just the cloudportal function and monitor.

Re: RA* Unable to Update via Remote Upload

Posted: Tue Oct 23, 2018 10:49 pm
by ReefingHavoc
I uploaded the following to the RA*:

void setup()
{
// This must be the first line
ReefAngel.Init(); //Initialize controller
ReefAngel.Star();
}

void loop()
{
ReefAngel.Network.Cloud();
// This should always be the last line
ReefAngel.ShowTouchInterface();
}

After leaving it on the monitor for nearly 24 hours it looks like everything is going through fine. Here's my first and last monitor logs.

Connecting...
Connected
HTTP/1.1 200 OK
Content-Type: text/html; charset=UTF-8
Server: Microsoft-IIS/8.5
X-Powered-By: PHP/5.6.24
Date: Mon, 22 Oct 2018 23:53:10 GMT
Connection: close
Content-Length: 0

Data: 0
Header: 0
Disconnected
Portal Call
Data Sent
HTTP/1.1 200 OK
Cache-Control: private
Content-Type: text/html; charset=utf-8
Server: Microsoft-IIS/8.5
X-AspNet-Version: 4.0.30319
X-Powered-By: ASP.NET
Date: Tue, 23 Oct 2018 06:58:08 GMT
Connection: close
Content-Length: 4

DoneDisconnected

--------------------------------------------------------------------

Portal Call
Data Sent
HTTP/1.1 200 OK
Cache-Control: private
Content-Type: text/html; charset=utf-8
Server: Microsoft-IIS/8.5
X-AspNet-Version: 4.0.30319
X-Powered-By: ASP.NET
Date: Wed, 24 Oct 2018 05:42:50 GMT
Connection: close
Content-Length: 4

DoneDisconnected
Connecting...
Connected
HTTP/1.1 200 OK
Content-Type: text/html; charset=UTF-8
Server: Microsoft-IIS/8.5
X-Powered-By: PHP/5.6.24
Date: Tue, 23 Oct 2018 22:42:53 GMT
Connection: close
Content-Length: 0

Data: 0
Header: 0
Disconnected



So it looks like something with the code is causing the problem. What should my next steps be?

Re: RA* Unable to Update via Remote Upload

Posted: Tue Oct 30, 2018 10:31 am
by rimai
Sorry for the delay.
Yeap, looks like something in your code.
Let's start by adding a few things and seeing if it holds up.

Code: Select all

void setup()
{
    // This must be the first line
    ReefAngel.Init();  //Initialize controller
    ReefAngel.Star();
    // Ports toggled in Feeding Mode
    ReefAngel.FeedingModePorts = 0;
    ReefAngel.FeedingModePortsE[0] = Port2Bit | Port8Bit;
    ReefAngel.FeedingModePortsE[1] = 0;
    // Ports toggled in Water Change Mode
    ReefAngel.WaterChangePorts = 0;
    ReefAngel.WaterChangePortsE[0] = Port1Bit | Port2Bit | Port4Bit | Port5Bit | Port8Bit;
    ReefAngel.WaterChangePortsE[1] = 0;
    // Ports turned off when Overheat temperature exceeded
    ReefAngel.OverheatShutoffPorts = 0;
    ReefAngel.OverheatShutoffPortsE[0] = Port4Bit | Port6Bit;
    ReefAngel.OverheatShutoffPortsE[1] = 0;
    // Ports toggled when Lights On / Off menu entry selected
    ReefAngel.LightsOnPorts = 0;
    ReefAngel.LightsOnPortsE[0] = 0;
    ReefAngel.LightsOnPortsE[1] = 0;
    // Use T1 probe as temperature and overheat functions
    ReefAngel.TempProbe = T1_PROBE;
    ReefAngel.OverheatProbe = T1_PROBE;
    // Set the Overheat temperature setting
    InternalMemory.OverheatTemp_write( 830 );
    // Feeeding and Water Change mode speed

    // Ports that are always on
    ReefAngel.Relay.On( Box1_Port5 );
    ReefAngel.Relay.On( Box1_Port8 );

    ////// Place additional initialization code below here


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

void loop()
{
    ReefAngel.DosingPumpRepeat( Box1_Port1,0,60,83 );//Alk
    ReefAngel.SingleATO( true,Box1_Port2,1000,0 );//ATO
    ReefAngel.DosingPumpRepeat( Box1_Port3,30,60,82 );//Cal
    ReefAngel.StandardHeater( T1_PROBE,Box1_Port4,780,785 );
    ReefAngel.StandardLights( Box1_Port6,12,0,19,0 ); //T5
    ReefAngel.StandardLights( Box1_Port7,23,0,6,0 ); //Refugium Lights
    ReefAngel.PWM.SetDaylight( PWMSlope( 9,0,17,0,15,70,60,0 ) );
    ReefAngel.PWM.SetActinic( PWMSlope( 9,0,17,0,15,70,60,0 ) );
    ReefAngel.PWM.SetDaylight2( PWMSlope( 9,0,17,0,15,70,60,0 ) );
    ReefAngel.PWM.SetActinic2( PWMSlope( 9,0,17,0,15,70,60,0 ) );

    boolean buzzer=false;
    if ( ReefAngel.isATOTimeOut() ) buzzer=true;
    if ( ReefAngel.isOverheat() ) buzzer=true;
    if ( buzzer ) ReefAngel.BuzzerOn(2); else ReefAngel.BuzzerOff();

    ////// Place your custom code below here
    static unsigned long feeding;
    if (ReefAngel.DisplayedMenu==FEEDING_MODE) feeding=now();
    
    //vacation mode
    if (hour()==17 && minute()==0 && second()==0)
    {
        ReefAngel.FeedingModeStart();
    }
    
    if (hour() >= 8 || ReefAngel.Params.PH > 860)
    {
        ReefAngel.Relay.Off (Box1_Port1);
        ReefAngel.Relay.Off (Box1_Port3);
    }

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

    ReefAngel.Network.Cloud();
    // This should always be the last line
    ReefAngel.ShowTouchInterface();
}
I removed the DCPump stuff.
See if this works now.
I noticed that you had both LED dimming and DCPump control using the same channels.