RA* Unable to Update via Remote Upload

Do you have a question on how to do something.
Ask in here.
ReefingHavoc
Posts: 54
Joined: Tue Jul 23, 2013 5:56 pm

RA* Unable to Update via Remote Upload

Post by ReefingHavoc »

I've got my RA* up and running with the exception of being able to update the code via Remote Upload through the wizard.
  • The unit is showing connected to the cloud
    I'm able to check the status and turn ports on/off through uapp
    If I connect via a com port on my PC I can upload code
Any thoughts?

Here's my code:

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
    ReefAngel.DCPump.FeedingSpeed=0;
    ReefAngel.DCPump.WaterChangeSpeed=0;

    // 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 ) );
    ReefAngel.DCPump.UseMemory = false;
    ReefAngel.DCPump.SetMode( LongPulse,80,60000 );
    ReefAngel.DCPump.DaylightChannel = Sync;
    ReefAngel.DCPump.ActinicChannel = None;
    ReefAngel.DCPump.Daylight2Channel = AntiSync;
    ReefAngel.DCPump.Actinic2Channel = None;

    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();
    
    //feeding mode nutrient transport time
    if (now()-feeding<3600) {
        ReefAngel.DCPump.SetMode(NutrientTransport,100,4000);
    }
    
    //vacation mode
    if (hour()==17 && minute()==0 && second()==0)
    {
        ReefAngel.FeedingModeStart();
    }
    
    if (hour() > 21 || hour() < 7)
    {
        ReefAngel.DCPump.SetMode( Lagoon,60,10 );
    }
    
    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();
}
rimai
Posts: 12881
Joined: Fri Mar 18, 2011 6:47 pm

Re: RA* Unable to Update via Remote Upload

Post by rimai »

This code seems to be missing something at the end.
Roberto.
ReefingHavoc
Posts: 54
Joined: Tue Jul 23, 2013 5:56 pm

Re: RA* Unable to Update via Remote Upload

Post by ReefingHavoc »

I didn’t paste the commented out code that includes the encrypted password. Is that what you meant?
rimai
Posts: 12881
Joined: Fri Mar 18, 2011 6:47 pm

Re: RA* Unable to Update via Remote Upload

Post by rimai »

Yes. I just wanted to make sure they were there
Roberto.
ReefingHavoc
Posts: 54
Joined: Tue Jul 23, 2013 5:56 pm

Re: RA* Unable to Update via Remote Upload

Post by ReefingHavoc »

Checking back in to see if anyone has ideas on this. I'm still unable to upload remotely. Not sure if something is going on with the unit as I see what looks like a download message periodically (see image below). It is not there all the time, but when it is, always says 1%.

Image
rimai
Posts: 12881
Joined: Fri Mar 18, 2011 6:47 pm

Re: RA* Unable to Update via Remote Upload

Post by rimai »

Not sure why it is not downloading for you.
I just tested this and it worked.
Roberto.
ReefingHavoc
Posts: 54
Joined: Tue Jul 23, 2013 5:56 pm

Re: RA* Unable to Update via Remote Upload

Post by ReefingHavoc »

Any other thought out there? It’s not only frustrating that I can’t remote upload, but can’t receive alerts either

Is there anything with my router that I should be looking at?
rimai
Posts: 12881
Joined: Fri Mar 18, 2011 6:47 pm

Re: RA* Unable to Update via Remote Upload

Post by rimai »

Connect to your computer and use Arduino to get the serial monitor log.
Roberto.
ReefingHavoc
Posts: 54
Joined: Tue Jul 23, 2013 5:56 pm

Re: RA* Unable to Update via Remote Upload

Post by ReefingHavoc »

Here is what I get:

10.0.0.23
Portal Call
MQTT Connecting...
MQTT failed
Disconnected
Connecting...
10.0.0.23
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: Wed, 12 Sep 2018 00:14:32 GMT
Connection: close
Content-Length: 0

Data: 0
Header: 0
Disconnected
MQTT Connecting...
MQTT succeeded
rimai
Posts: 12881
Joined: Fri Mar 18, 2011 6:47 pm

Re: RA* Unable to Update via Remote Upload

Post by rimai »

I don't think your controller is configured correctly.
If you browse to http://10.0.0.23:2000/r99 , what do you get?
Roberto.
ReefingHavoc
Posts: 54
Joined: Tue Jul 23, 2013 5:56 pm

Re: RA* Unable to Update via Remote Upload

Post by ReefingHavoc »

<RA>
<ID>ReefingHavoc</ID>
<T1>0</T1>
<T2>0</T2>
<T3>0</T3>
<PH>852</PH>
<R>0</R>
<RON>0</RON>
<ROFF>255</ROFF>
<R1>144</R1>
<RON1>0</RON1>
<ROFF1>255</ROFF1>
<R2>0</R2>
<RON2>0</RON2>
<ROFF2>255</ROFF2>
<R3>0</R3>
<RON3>0</RON3>
<ROFF3>255</ROFF3>
<R4>0</R4>
<RON4>0</RON4>
<ROFF4>255</ROFF4>
<R5>0</R5>
<RON5>0</RON5>
<ROFF5>255</ROFF5>
<R6>0</R6>
<RON6>0</RON6>
<ROFF6>255</ROFF6>
<R7>0</R7>
<RON7>0</RON7>
<ROFF7>255</ROFF7>
<R8>0</R8>
<RON8>0</RON8>
<ROFF8>255</ROFF8>
<ATOLOW>0</ATOLOW>
<ATOHIGH>0</ATOHIGH>
<EM>1</EM>
<EM1>6</EM1>
<REM>1</REM>
<BID>4</BID>
<AF>0</AF>
<SF>0</SF>
<PWMA>0</PWMA>
<PWMD>80</PWMD>
<PWMAO>255</PWMAO>
<PWMDO>255</PWMDO>
<PWMA2>0</PWMA2>
<PWMD2>0</PWMD2>
<PWMA2O>255</PWMA2O>
<PWMD2O>255</PWMD2O>
<DCM>4</DCM>
<DCS>80</DCS>
<DCD>100</DCD>
<DCT>30</DCT>
<LEAK>0</LEAK>
<ALARM>0</ALARM>
<PWME0>0</PWME0>
<PWME0O>255</PWME0O>
<PWME1>0</PWME1>
<PWME1O>255</PWME1O>
<PWME2>0</PWME2>
<PWME2O>255</PWME2O>
<PWME3>0</PWME3>
<PWME3O>255</PWME3O>
<PWME4>0</PWME4>
<PWME4O>255</PWME4O>
<PWME5>0</PWME5>
<PWME5O>255</PWME5O>
</RA>
ReefingHavoc
Posts: 54
Joined: Tue Jul 23, 2013 5:56 pm

Re: RA* Unable to Update via Remote Upload

Post by ReefingHavoc »

More came through on the monitor:

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, 12 Sep 2018 00:19:33 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: Wed, 12 Sep 2018 00:19:33 GMT
Connection: close
Content-Length: 0

Data: 0
Header: 0
Disconnected
rimai
Posts: 12881
Joined: Fri Mar 18, 2011 6:47 pm

Re: RA* Unable to Update via Remote Upload

Post by rimai »

Ok, so whatever you did a while ago made the controller connect to the portal.
http://forum.reefangel.com/status/chart ... &filter=ph
You can see that it started sending data about half hour ago.
So, you should be able to set your email alerts now.
Try doing the remote upload again.
Roberto.
ReefingHavoc
Posts: 54
Joined: Tue Jul 23, 2013 5:56 pm

Re: RA* Unable to Update via Remote Upload

Post by ReefingHavoc »

Thought I'd close the loop on this. I had my connection running through a patch panel that was connected to a AT&T U-verse router. I did some troubleshooting to determine where the problem was as when I connected the RA* directly to a Netgear router, everything seemed to work. Patch panel and all connections turned out to be fine. Tried running the patch panel to the Netgear instead of U-verse and miraculously I'm able to able to now upload remotely and updates hitting the portal. Strange...
ReefingHavoc
Posts: 54
Joined: Tue Jul 23, 2013 5:56 pm

Re: RA* Unable to Update via Remote Upload

Post by ReefingHavoc »

ReefingHavoc wrote:Thought I'd close the loop on this. I had my connection running through a patch panel that was connected to a AT&T U-verse router. I did some troubleshooting to determine where the problem was as when I connected the RA* directly to a Netgear router, everything seemed to work. Patch panel and all connections turned out to be fine. Tried running the patch panel to the Netgear instead of U-verse and miraculously I'm able to able to now upload remotely and updates hitting the portal. Strange...
I guess it was too good to be true. I haven't touched the RA* since Sunday, but it looks like it stopped communicating yesterday (see attached)
Attachments
Portal.PNG
Portal.PNG (1.85 KiB) Viewed 7326 times
ReefingHavoc
Posts: 54
Joined: Tue Jul 23, 2013 5:56 pm

Re: RA* Unable to Update via Remote Upload

Post by ReefingHavoc »

Any thoughts on what is going on? The unit will connect for short periods of time and all of a sudden stop updating to the portal (still shows connected on the unit). I've tried swapping out power cables, ethernet cables, connecting to different routers, observing traffic through a serial monitor. Just today the unit had a black screen and unresponsive to touch. I had to reboot it by unplugging and when it did, saw that the temperature in the tank dropped by 3 degrees. The RA+ was rock solid for years; not sure why I'm having so many issues.
rimai
Posts: 12881
Joined: Fri Mar 18, 2011 6:47 pm

Re: RA* Unable to Update via Remote Upload

Post by rimai »

When you were watching the monitor, what did you get when it was not communicating?
Roberto.
ReefingHavoc
Posts: 54
Joined: Tue Jul 23, 2013 5:56 pm

Re: RA* Unable to Update via Remote Upload

Post by ReefingHavoc »

rimai wrote:When you were watching the monitor, what did you get when it was not communicating?
I had it connected to a monitor for a couple hours and did not see issues, but when I plugged it back in to the power supply it stopped updating shortly after. I'll run a monitor on it for 24hrs to see what happens. The problem has been that my tank is in the basement and my PC is on the first floor so I have to disconnect the RA* from my system to monitor. I'll figure out how to keep it connected to the system with monitoring in place.

Thanks for the follow up

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

Re: RA* Unable to Update via Remote Upload

Post by ReefingHavoc »

rimai wrote:When you were watching the monitor, what did you get when it was not communicating?

I ran the monitor for 24 hours and did capture a 400 error at the time the Portal stopped being updated.


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: Sun, 23 Sep 2018 14:20:17 GMT - This is the time when Portal last updated
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: Sun, 23 Sep 2018 14:20:18 GMT
Connection: close
Content-Length: 0

Data: 0
Header: 0
Disconnected
Portal Call
Actinic 2Data Sent
Actinic 2HTTP/1.1 400 Bad Request
Content-Type: text/html; charset=us-ascii
Server: Microsoft-HTTPAPI/2.0
Date: Sun, 23 Sep 2018 14:25:18 GMT
Connection: close
Content-Length: 311

<!DOCTYPE HTML PUBLIC "-//W3C//DTD HTML 4.01//EN""http://www.w3.org/TR/html4/strict.dtd">
<HTML><HEAD><TITLE>Bad Request</TITLE>
<META HTTP-EQUIV="Content-Type" Content="text/html; charset=us-ascii"></HEAD>
<BODY><h2>Bad Request</h2>
<hr><p>HTTP Error 400. The request is badly formed.</p>
</BODY></HTML>
ÿDisconnected
Actinic 2Connecting...
Actinic 2Connected
Actinic 2HTTP/1.1 400 Bad Request
Content-Type: text/html; charset=us-ascii
Server: Microsoft-HTTPAPI/2.0
Date: Sun, 23 Sep 2018 14:25:19 GMT
Connection: close
Content-Length: 339

Data: 339
Actinic 2Header: 0
Actinic 2Disconnected
Actinic 2Portal Call
Actinic 2Data Sent
Actinic 2HTTP/1.1 400 Bad Request
Content-Type: text/html; charset=us-ascii
Server: Microsoft-HTTPAPI/2.0
Date: Sun, 23 Sep 2018 14:30:19 GMT
Connection: close
Content-Length: 311

<!DOCTYPE HTML PUBLIC "-//W3C//DTD HTML 4.01//EN""http://www.w3.org/TR/html4/strict.dtd">
<HTML><HEAD><TITLE>Bad Request</TITLE>
<META HTTP-EQUIV="Content-Type" Content="text/html; charset=us-ascii"></HEAD>
<BODY><h2>Bad Request</h2>
<hr><p>HTTP Error 400. The request is badly formed.</p>
</BODY></HTML>
ÿDisconnected
Actinic 2Connecting...
Actinic 2Connected
Actinic 2HTTP/1.1 400 Bad Request
Content-Type: text/html; charset=us-ascii
Server: Microsoft-HTTPAPI/2.0
Date: Sun, 23 Sep 2018 14:30:20 GMT
Connection: close
Content-Length: 339

Data: 339
Actinic 2Header: 0
Actinic 2Disconnected
Actinic 2Portal Call
Actinic 2Data Sent
Actinic 2HTTP/1.1 400 Bad Request
Content-Type: text/html; charset=us-ascii
Server: Microsoft-HTTPAPI/2.0
Date: Sun, 23 Sep 2018 14:35:20 GMT
Connection: close
Content-Length: 311

<!DOCTYPE HTML PUBLIC "-//W3C//DTD HTML 4.01//EN""http://www.w3.org/TR/html4/strict.dtd">
<HTML><HEAD><TITLE>Bad Request</TITLE>
<META HTTP-EQUIV="Content-Type" Content="text/html; charset=us-ascii"></HEAD>
<BODY><h2>Bad Request</h2>
<hr><p>HTTP Error 400. The request is badly formed.</p>
</BODY></HTML>
ÿDisconnected
Actinic 2Connecting...
Actinic 2Connected
Actinic 2HTTP/1.1 400 Bad Request
Content-Type: text/html; charset=us-ascii
Server: Microsoft-HTTPAPI/2.0
Date: Sun, 23 Sep 2018 14:35:21 GMT
Connection: close
Content-Length: 339

Data: 339
Actinic 2Header: 0
Actinic 2Disconnected
Actinic 2Portal Call
Actinic 2Data Sent
Actinic 2HTTP/1.1 400 Bad Request
Content-Type: text/html; charset=us-ascii
Server: Microsoft-HTTPAPI/2.0
Date: Sun, 23 Sep 2018 14:40:21 GMT
Connection: close
Content-Length: 311

<!DOCTYPE HTML PUBLIC "-//W3C//DTD HTML 4.01//EN""http://www.w3.org/TR/html4/strict.dtd">
<HTML><HEAD><TITLE>Bad Request</TITLE>
<META HTTP-EQUIV="Content-Type" Content="text/html; charset=us-ascii"></HEAD>
<BODY><h2>Bad Request</h2>
<hr><p>HTTP Error 400. The request is badly formed.</p>
</BODY></HTML>
ÿDisconnected
Actinic 2Connecting...
Actinic 2Connected
Actinic 2HTTP/1.1 400 Bad Request
Content-Type: text/html; charset=us-ascii
Server: Microsoft-HTTPAPI/2.0
Date: Sun, 23 Sep 2018 14:40:22 GMT
Connection: close
Content-Length: 339




The 400 error captured repeats until 6 PM EST when I disconnected the monitor
ReefingHavoc
Posts: 54
Joined: Tue Jul 23, 2013 5:56 pm

Re: RA* Unable to Update via Remote Upload

Post by ReefingHavoc »

Any thoughts on the 400 error?
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?
Post Reply