RA* Unable to Update via Remote Upload

Do you have a question on how to do something.
Ask in here.
rimai
Posts: 12881
Joined: Fri Mar 18, 2011 6:47 pm

Re: RA* Unable to Update via Remote Upload

Post by rimai »

Let me check the server log and see what the request looked like.
Roberto.
rimai
Posts: 12881
Joined: Fri Mar 18, 2011 6:47 pm

Re: RA* Unable to Update via Remote Upload

Post 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?
Roberto.
ReefingHavoc
Posts: 54
Joined: Tue Jul 23, 2013 5:56 pm

Re: RA* Unable to Update via Remote Upload

Post by ReefingHavoc »

No
ReefingHavoc
Posts: 54
Joined: Tue Jul 23, 2013 5:56 pm

Re: RA* Unable to Update via Remote Upload

Post by ReefingHavoc »

Any further thoughts on this?
rimai
Posts: 12881
Joined: Fri Mar 18, 2011 6:47 pm

Re: RA* Unable to Update via Remote Upload

Post by rimai »

Not sure.
I don't understand how it stays connected when you are monitoring by itself and not when you bring downstairs.
Roberto.
ReefingHavoc
Posts: 54
Joined: Tue Jul 23, 2013 5:56 pm

Re: RA* Unable to Update via Remote Upload

Post 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.
rimai
Posts: 12881
Joined: Fri Mar 18, 2011 6:47 pm

Re: RA* Unable to Update via Remote Upload

Post by rimai »

I am wondering if it does the same with a very basic code with just the cloudportal function.
Roberto.
ReefingHavoc
Posts: 54
Joined: Tue Jul 23, 2013 5:56 pm

Re: RA* Unable to Update via Remote Upload

Post by ReefingHavoc »

Let me know if you want me to test something
rimai
Posts: 12881
Joined: Fri Mar 18, 2011 6:47 pm

Re: RA* Unable to Update via Remote Upload

Post by rimai »

Try running a new code with just the cloudportal function and monitor.
Roberto.
ReefingHavoc
Posts: 54
Joined: Tue Jul 23, 2013 5:56 pm

Re: RA* Unable to Update via Remote Upload

Post 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?
rimai
Posts: 12881
Joined: Fri Mar 18, 2011 6:47 pm

Re: RA* Unable to Update via Remote Upload

Post 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.
Roberto.
Post Reply