Page 1 of 2

RA portal charts does not have new data

Posted: Mon Dec 26, 2016 8:27 pm
by Diverjoe
It appears that on my portal, the data for the relay graphs end at 4pm on DEC 23rd. Same goes for Temp and PH. Is there something that I have done to make it stop?


Here is my code:

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 <PAR.h>
#include <ReefAngel.h>

////// Place global variable code below here
// Define Custom Memory Locations
#define Mem_B_MoonOffset      100
#define Mem_B_Vacation        101
#define Mem_B_AutoFeed        102
#define Mem_B_AutoFeedPress   103
#define Mem_B_AutoFeedRepeat  104
#define Mem_B_AutoFeedOffset  105
#define Mem_I_WCFillTime      106

byte wc_status = 0;

time_t ato_endfill;
byte ato_topping = 0;

void init_memory() {
  // Initialize Custom Memory Locations
  InternalMemory.write(Mem_B_Vacation,false);
  InternalMemory.write(Mem_B_AutoFeed,true);
  InternalMemory.write(Mem_B_AutoFeedPress,2);
  InternalMemory.write(Mem_B_AutoFeedRepeat,4);
  InternalMemory.write(Mem_B_AutoFeedOffset,3);
  InternalMemory.write_int(Mem_I_WCFillTime,1200  );  //How long topoff is allowed to run
}
  
  // Define Relay Ports by Name
#define Daylight           1
#define LEDLights          2
#define ATODrain           3
#define Feeder             4
#define Mixer              5
#define Topoff             6
#define Ferts              7
#define Filter             8



////// Place global variable code above here


void setup()
{
    // This must be the first line
    ReefAngel.Init();  //Initialize controller
    ReefAngel.Use2014Screen();  // Let's use 2014 Screen 
    // Ports toggled in Feeding Mode
    ReefAngel.FeedingModePorts = 0;
    // Ports toggled in Water Change Mode
    ReefAngel.WaterChangePorts = 0;
    // Ports toggled when Lights On / Off menu entry selected
    ReefAngel.LightsOnPorts = 0;
    // Ports turned off when Overheat temperature exceeded
    ReefAngel.OverheatShutoffPorts = 0;
    // Use T1 probe as temperature and overheat functions
    ReefAngel.TempProbe = T1_PROBE;
   

    // Ports that are always on
  ReefAngel.Relay.Auto(Filter);
    ////// Place additional initialization code below here
      
    ato_endfill = now()+15;  //add delay to ato startup
    
  // Ports that default off
  ReefAngel.Relay.Off(Topoff);
  ReefAngel.Relay.Off(ATODrain);
  ReefAngel.Relay.Off(Feeder);
  ReefAngel.Relay.Off(Mixer);

ReefAngel.CustomLabels[0]="Daylight";  
ReefAngel.CustomLabels[1]="LED";  
ReefAngel.CustomLabels[2]="Drain";  
ReefAngel.CustomLabels[3]="Feeder";  
ReefAngel.CustomLabels[4]="Mixer";  
ReefAngel.CustomLabels[5]="Topoff";  
ReefAngel.CustomLabels[6]="Ferts";  
ReefAngel.CustomLabels[7]="Filter";


ReefAngel.Relay.On(Filter);
 ////// Place additional initialization code above here
}

void loop()
{
    ReefAngel.StandardLights( LEDLights,9,0,21,0 );
    ReefAngel.StandardLights( Daylight,10,30,20,30 );
    ReefAngel.PWM.SetActinic( PWMSlope(9,0,20,0,15,100,60,15) );
    ////// Place your custom code below here
    
    //Automation
    //RunFeeder();
        
    
      //RUN ONCE A DAY AT 7 AM FOR 40 MIN
      ReefAngel.DosingPumpRepeat(ATODrain,660,1440,2400 );   


    //Water Change
      if (ReefAngel.Relay.Status(ATODrain) ){
        wc_status = 1;
      }
      
      
      if (wc_status > 0 ){
        AutoWaterChange();
      }
         
      
    //Keep Water topped off
    AutoTopOff();


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

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


void AutoTopOff(){
 //run for 15 sec any time float valve is turned on and WC drain is not active
 if (ato_endfill < now() && wc_status != 1 && ato_topping){     
     ReefAngel.Relay.On(Topoff);
 }
 else{
   ReefAngel.Relay.Off(Topoff);
   ato_topping = 0;
   if ( ReefAngel.HighATO.IsActive() && !ato_topping){
       ato_endfill = now() + 15;
       ato_topping = 1;
   }
}
}


void RunFeeder() {
  boolean autoFeed;
  static time_t t;
  int press, repeat, offset;
  
  autoFeed=InternalMemory.read(Mem_B_AutoFeed);
  press=InternalMemory.read(Mem_B_AutoFeedPress);
  repeat=InternalMemory.read(Mem_B_AutoFeedRepeat)*SECS_PER_HOUR;
  offset=InternalMemory.read(Mem_B_AutoFeedOffset)*SECS_PER_HOUR;
  
  ReefAngel.Relay.Set(Feeder, autoFeed);
  if (ReefAngel.Relay.Status(Feeder)!=autoFeed) {
    autoFeed=ReefAngel.Relay.Status(Feeder);
    InternalMemory.write(Mem_B_AutoFeed, autoFeed);
    ReefAngel.Relay.Auto(Feeder); 
  }
  
  if (autoFeed) {
    if (((hour() > 9 && hour() < 20)) && (now()+offset)%repeat==0) {
      t=now();
    }
  }
  
  if (ReefAngel.Relay.isMaskOn(Feeder)) {
    ReefAngel.Relay.Auto(Feeder);
    t=now()-now()%20; // One feeding has already happened.
  }
     
  // Press the button once every 20 seconds
  if (now()-t < press*20) {
    ReefAngel.Relay.Set(Feeder,now()%20==0);
  } else {
    ReefAngel.Relay.Off(Feeder);
  }
}

void AutoWaterChange() {
 int NowMins;
 static time_t t;
 
    if (wc_status == 1) {
      ReefAngel.Relay.Override(Topoff,0);
      ReefAngel.Relay.Off(Topoff);
      //ReefAngel.Relay.Override(Filter,0);
      ReefAngel.Relay.Off(Filter);
      t = now();
    }
    if(ReefAngel.LowATO.IsActive() && wc_status == 1)
    {
      wc_status = 2;   //Enter Mix mode   
      ReefAngel.Relay.Auto(ATODrain);
      ReefAngel.Relay.Off(ATODrain);
      ReefAngel.Relay.On(Mixer);
      ReefAngel.Relay.Auto(Topoff);
      //ReefAngel.Relay.On(Topoff);
      t = now();
    }  
    
    //Ferts Mode   
    if ( wc_status == 2){
      if (now() - t > SECS_PER_MIN  * 6){
           wc_status = 3;   //enter Ferts mode
           ReefAngel.Relay.Off(Mixer);
           ReefAngel.Relay.On(Ferts);   
            t = now();
      }
    }
    
    //ferts Mode
     if ( wc_status == 3){
      if (now() - t > 15){
           ReefAngel.Relay.Off(Ferts);      
           ReefAngel.Relay.Auto(Filter);  
           ReefAngel.Relay.On(Filter);
           wc_status = 0;
      }
    }
    
}

// Disable masks for things that should not be turned on by mistake
void LockPorts() {
  ReefAngel.AddPortOverrides();
 

  }

Re: RA portal charts does not have new data

Posted: Tue Dec 27, 2016 5:57 am
by Reefology
I noticed the same, cant get current info.

thanks

Re: RA portal charts does not have new data

Posted: Tue Dec 27, 2016 6:08 am
by silkjc
Yep same here. I have nothing from December 24th onwards. I thought it was something I did wrong and have been digging through all sorts of places to find the problem. I also use the 'Reef Angel Client' windows program, which also cannot get any data.

Re: RA portal charts does not have new data

Posted: Tue Dec 27, 2016 6:09 am
by silkjc
My reefangelid:
silkjc
Connection Status:
Ready

Last Update:
12/28/2016, 12:09:05 AM
Displaying data from:
Reef Angel Controller (live)

Graphs have no data from December 24th onwards.

Re: RA portal charts does not have new data

Posted: Tue Dec 27, 2016 11:24 am
by rimai
Try updating the settings on the wifi attachment with this macro:
http://forum.reefangel.com/viewtopic.php?f=3&t=4601

Re: RA portal charts does not have new data

Posted: Tue Dec 27, 2016 10:32 pm
by silkjc
I performed the wifi macro using Teraterm with the wifi device plugged in to a local COM. During this process I noticed my RA's clock had reset back to the year 00, so I updated that as well.
Seems to have come good and I now have a last update date of today on the portal. Web charts haven't updated yet though.

As an aside and it might be a chrome cache problem, but sometimes when I refresh the page the last updated date goes back to the last reading at 24/12/2016 momentarily before changing to 28/12/2016.

Edit: Checked this and it does it in IE as well (which I've never visited the portal on). So its got some weird fixation on that date! Charts have not updated yet

Re: RA portal charts does not have new data

Posted: Wed Dec 28, 2016 2:00 am
by silkjc
Update: Web charts still have no new data since the 24th.

Re: RA portal charts does not have new data

Posted: Wed Dec 28, 2016 3:01 am
by silkjc
Just loaded up the portal and it took 4 page refreshes until the 'Last update date' went from
Last Update:
12/24/2016, 8:16:25 AM
to:
Last Update:
12/28/2016, 9:00:32 PM

Very weird

Re: RA portal charts does not have new data

Posted: Wed Dec 28, 2016 9:31 am
by rimai
The first date is from the portal database and the last one is when the portal is able to contact live data from the controller.
When you load the portal, it will always use the first date until it is able to connect to gather live data.
Just to be sure it is not the wifi attachment, I'd like you to confirm the settings are saved in there.
Use Tera Term again and connect to your COM port using baud rate 57600.
Then, type $$$ within one second.
The wifi attachment will return with CMD response.
Then you type get e and you should get a response with all the settings.
Copy and paste here.
If you cannot get this to work, send me a PM and I can connect remotely.

Re: RA portal charts does not have new data

Posted: Wed Dec 28, 2016 10:47 pm
by fit
I am having the same problem. Last data recorded in the webchart is Dec 23 3:15pm. I have tried rebooting the controller. Rebooting the WiFi adapter by unplugging and plugging. Updated the time and date on the controller, even though that seemed correct before updating.

I think that the problem has got to be in the server. Too much of a coincidence that four people have the same issue starting at virtually the same time and day. Right?

I am able to control my controller through the Portal (live).

Re: RA portal charts does not have new data

Posted: Wed Dec 28, 2016 10:56 pm
by rimai
Use the macro to point to the new server.

Re: RA portal charts does not have new data

Posted: Wed Dec 28, 2016 11:09 pm
by fit
When did you change the server? I mean why would all four of our controllers stop being capable of sending tho the correct server at the same time? What do you think happened?

Re: RA portal charts does not have new data

Posted: Thu Dec 29, 2016 3:00 am
by silkjc
I am also able to control the controller via portal, or via phone, or via reef angel client. My reef angel client (windows client) now has graphs up to date, but the portal is still broken back to 24th.

If it is settings in the wifi unit would I have no connection at all, or could it be 'partially broken' ?

I'll grab the settings if partial, just rather difficult to pull the unit and get it to my pc.

Re: RA portal charts does not have new data

Posted: Thu Dec 29, 2016 3:14 am
by silkjc
Output after running get e:

Code: Select all

<4.41> get e
wifly-GSX Ver: 4.41 Build: r1057, Jan 17 2014 10:26:29 on 131C11
SSID=WiFly-GSX-bb
Pass=
Linkmon=3600
Beacon=102
Reboot=0
IF=UP
DHCP=ON
IP=192.168.0.150:2000
NM=255.255.255.0
GW=192.168.0.1
HOST=198.171.134.6:80
PROTO=TCP,
MTU=1524
FLAGS=0x6
TCPMODE=0x0
BACKUP=0.0.0.0
OPEN=
CLOSE=
REMOTE=
FlushSize=1420
MatchChar=0
FlushTimer=5
IdleTimer=3
CmdChar=$
DNS=198.142.0.51
Name=www.reefangel.com
Backup=rn.microchip.com
Lease=86400
FTP=198.175.253.161:21
File=wifly-GSX.img
User=roving
Pass=Pass123
Dir=public
Timeout=200
FTP_mode=0x0
SSID=PumpkinPie
Chan=0
ExtAnt=0
Join=1
Auth=OPEN
Mask=0x1fff
Rate=12, 24 Mb
Linkmon=5
Passphrase=blanked for sec
EAP_Id=userid
EAP_User=peap-user
SleepTmr=0
WakeTmr=0
Trigger=0x1
Autoconn=0
IoFunc=0x0
IoMask=0x20f0
IoValu=0x0
DebugReg=0x0
PrintLvl=0x0
LaunchStr=web_app
TimeEna=0
TIMEADR=64.90.182.55:123
Zone=7
Baudrate=57600
Flow=0x0
Mode=0x2
Cmd_GPIO=0
JoinTmr=1000
Replace=0x24
DeviceId=ReefAngelWifi
Password=
Format=0x0
Signal=0
Average=5
BCAST=255.255.255.255:55555
Interval=0x7
Backup=0.0.0.0:0
Sensor=0x0
SensePw

Re: RA portal charts does not have new data

Posted: Thu Dec 29, 2016 3:16 am
by silkjc
While connected on COM port to the wifi module this http request response repeated over and over in console.

Code: Select all

192.168.0.150 is my RA controller IP.

GET /r99 HTTP/1.1
Host: 192.168.0.150:2000

HTTP/1.1 400 Bad Request
Content-Type: text/html; charset=us-ascii
Server: Microsoft-HTTPAPI/2.0
Date: Thu, 29 Dec 2016 10:12:41 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>
GET /r99 HTTP/1.1
Host: 192.168.0.150:2000

Re: RA portal charts does not have new data

Posted: Thu Dec 29, 2016 6:29 am
by silkjc
Update: Prior to getting the current parameters from the Wifi module I also reprogrammed it again using the macro to make sure. My charts have updated now with historical data filled in, with most recent entries being moments ago.

Thanks again rimai, I absolutely love my RA and would be crippled without it!

Re: RA portal charts does not have new data

Posted: Thu Dec 29, 2016 8:03 am
by Reefology
silkjc wrote:Update: Prior to getting the current parameters from the Wifi module I also reprogrammed it again using the macro to make sure. My charts have updated now with historical data filled in, with most recent entries being moments ago.

Thanks again rimai, I absolutely love my RA and would be crippled without it!
hi, seems like a few steps were taken that went over my head. can someone please lay the steps out for us knobs?

please thanks :D

edit: what is a macro?

Re: RA portal charts does not have new data

Posted: Thu Dec 29, 2016 9:08 am
by fit
Rimai, could you please explain what happened that requires the macro excecution? What explains this? I am curious as to why the macro step needs to be excecuted. Please explain.

Re: RA portal charts does not have new data

Posted: Thu Dec 29, 2016 10:41 am
by rimai
We changed servers a few months back and I setup a forwarding to be able to support the backward compatible wifi attachments that were pointing to the old server.
Well, obviously something happened with that service.
The best is to just update the setting of the wifi attachment using the macro so you point to the correct server.
The old server was ip address 198.171.134.6:80 as seen on the host line of the post above.
The new one and what the macro has is 104.36.18.155:80.
So, running the macro just once would fix your problem.
If it does, please let us know.
For macro instructions, follow this post:
http://forum.reefangel.com/viewtopic.php?f=3&t=4601

Re: RA portal charts does not have new data

Posted: Thu Dec 29, 2016 11:18 am
by fit
That is a great explanation. Thank you.

Re: RA portal charts does not have new data

Posted: Thu Dec 29, 2016 4:07 pm
by Reefology
cant open the tera term file on my Mac and I don't see a file for Mac users???

Re: RA portal charts does not have new data

Posted: Thu Dec 29, 2016 4:30 pm
by rimai
Sorry, tera term is for windows only.
If you want to do it on Mac, you need to use Coolterm and there is no macro option for it.
You will need to manually type it.
Open the serial connection at 57600 baud.
Then type $$$ and it should respond with CMD.
Then type the following commands:

Code: Select all

set i h 104.36.18.155
save
reboot

Re: RA portal charts does not have new data

Posted: Thu Dec 29, 2016 4:52 pm
by Reefology
what is coolterm? and, how do I Open the serial connection at 57600 baud?

im so confused :oops:

Re: RA portal charts does not have new data

Posted: Thu Dec 29, 2016 4:58 pm
by rimai
Click options and you should be able to change it.
There is a small tutorial here when I googled: https://learn.sparkfun.com/tutorials/te ... -mac-linux

Re: RA portal charts does not have new data

Posted: Thu Dec 29, 2016 5:12 pm
by Diverjoe
Ran the macro and mine is up and running now!! Thanks!!! I did have a bump in the road as I was trying to do the update with my pc connected to the Head Module - doesnt work that way - ha! The minute I plugged the USB cable into the WiFi module, the terminal program did its thing and all is well. Also, it took a couple of times hitting ok before i realized the macro was looping and then what you had said to someone else - that it only had to be ran once made sense. I hit cancel and I was golden!

Again thanks Roberto for the quick reply!

Re: RA portal charts does not have new data

Posted: Thu Dec 29, 2016 6:07 pm
by Reefology
rimai wrote:Sorry, tera term is for windows only.
If you want to do it on Mac, you need to use Coolterm and there is no macro option for it.
You will need to manually type it.
Open the serial connection at 57600 baud.
Then type $$$ and it should respond with CMD.
Then type the following commands:

Code: Select all

set i h 104.36.18.155
save
reboot
thanks Roberto, assume I'm wired to the head unit as I do this? don't believe it was stated here. don't want to have my RA shut down if it doesn't work.

thanks

Re: RA portal charts does not have new data

Posted: Thu Dec 29, 2016 6:12 pm
by rimai
No. we are programming the wifi attachment, so you have to connect to the wifi attachment.

Re: RA portal charts does not have new data

Posted: Thu Dec 29, 2016 6:41 pm
by Reefology
this is bs!!!

first it won't let me type $$$ when I connect to 57600 so I copied and pasted and nothing happened......

Re: RA portal charts does not have new data

Posted: Thu Dec 29, 2016 6:52 pm
by Reefology
I have wifi attachment connected to serial port and baud 57600. your instructions say to "then type $$$ and it should respond with CMD" which I cannot do. what should I do now to get this working?

thanks

Re: RA portal charts does not have new data

Posted: Thu Dec 29, 2016 6:53 pm
by rimai
Did you choose the correct serial port?