New Setup, Need Help w/RF

Do you have a question on how to do something.
Ask in here.

Posts: 75
Joined: Mon Oct 31, 2016 12:33 pm
PostPosted: Thu Nov 24, 2016 8:48 am
I've got the RA+, wifi, RF

I have the RA setup and running, and the wifi up and running. I have all ports forwarded and can see it weather on my local network or not. It works great in that aspect. I'd like to get the RF setup, I have 2 mp40wes. I've read the manual, but I can't figure out what to do? (as of right now, I really only have the RA controlling the heater, nothing else is plugged in yet, but all ports work great via app, portal, etc.)

My current 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


////// 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 = Port1Bit | Port2Bit | Port3Bit;
    // Ports toggled when Lights On / Off menu entry selected
    ReefAngel.LightsOnPorts = 0;
    // Ports turned off when Overheat temperature exceeded
    ReefAngel.OverheatShutoffPorts = Port1Bit;
    // Use T1 probe as temperature and overheat functions
    ReefAngel.TempProbe = T1_PROBE;
    ReefAngel.OverheatProbe = T1_PROBE;
    // Set the Overheat temperature setting
    InternalMemory.OverheatTemp_write( 820 );


    // Ports that are always on
    ReefAngel.Relay.On( Port2 );
    ReefAngel.Relay.On( Port3 );

    ////// Place additional initialization code below here
   
   
    ReefAngel.Init();  //Initialize controller
    ReefAngel.LCD.DrawText(0,255,20,50,"Assigning Slaves");
    ReefAngel.RF.SendData(Slave_Start,0,0);
    ReefAngel.RF.UseMemory=true;
    InternalMemory.RFMode_write(0);
    InternalMemory.RFSpeed_write(128);
    InternalMemory.RFDuration_write(10);

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

void loop()
{
    ReefAngel.StandardHeater( Port1,790,800 );
    ReefAngel.RF.UseMemory = false;
    ReefAngel.RF.SetMode( ReefCrest,80,10 );
   
    ////// Place your custom code below here
   
    ReefAngel.Refresh();
    if (ReefAngel.Joystick.IsButtonPressed())
    {
      ReefAngel.RF.UseMemory=true;
      ReefAngel.RF.SendData(Slave_Stop,0,0);
      ReefAngel.LCD.DrawText(0,255,50,60,"Done");
    }
    ////// Place your custom code above here

}







The RF manual says to pull it from the examples and upload, but will that not "over write" my current code when I upload? Here's what the GUI spits out for the RF 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 <ReefAngel.h>

//#define Constant      0
//#define Random1       1 // Lagoonal
//#define Random2       2 // Reef Crest
//#define ShortWave     3
//#define LongWave      4
//#define Smart_NTM     5 // Nutrient Transport Mode
//#define Smart_TSM     6 // Tidal Swell Mode
//#define Feeding_Start 7
//#define Feeding_Stop  8
//#define Night         9
//#define Slave_Start   97
//#define Slave_Stop    98
//#define None          99

void setup()
{
  ReefAngel.Init();  //Initialize controller
  ReefAngel.LCD.DrawText(0,255,20,50,"Assigning Slaves");
  ReefAngel.RF.SendData(Slave_Start,0,0);
  ReefAngel.RF.UseMemory=true;
  InternalMemory.RFMode_write(0);
  InternalMemory.RFSpeed_write(128);
  InternalMemory.RFDuration_write(10);
}

void loop()
{
  ReefAngel.Refresh();
  if (ReefAngel.Joystick.IsButtonPressed())
  {
    ReefAngel.RF.UseMemory=true;
    ReefAngel.RF.SendData(Slave_Stop,0,0);
    ReefAngel.LCD.DrawText(0,255,50,60,"Done");
  }
}







My thought is to add these together, and then upload at once? I don't understand how to do that, or I'm not understanding all together, lol. How would I set it up to change the vortechs from the app? Do I add the code to memory when the wizard asks to do so?

Sorry for being such a noob, thanks for any help, and Happy Thanksgiving!!!
Last edited by robmwpropane on Fri Nov 25, 2016 1:24 pm, edited 3 times in total.
Image

Posts: 75
Joined: Mon Oct 31, 2016 12:33 pm
PostPosted: Thu Nov 24, 2016 9:28 am
So, here's what I came up with. When someone gets a chance, could they take a look and tell me if I'm on the right track?

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


////// 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 = Port1Bit | Port2Bit | Port3Bit;
    // Ports toggled when Lights On / Off menu entry selected
    ReefAngel.LightsOnPorts = 0;
    // Ports turned off when Overheat temperature exceeded
    ReefAngel.OverheatShutoffPorts = Port1Bit;
    // Use T1 probe as temperature and overheat functions
    ReefAngel.TempProbe = T1_PROBE;
    ReefAngel.OverheatProbe = T1_PROBE;
    // Set the Overheat temperature setting
    InternalMemory.OverheatTemp_write( 820 );


    // Ports that are always on
    ReefAngel.Relay.On( Port2 );
    ReefAngel.Relay.On( Port3 );

    ////// Place additional initialization code below here
   
   
    ReefAngel.Init();  //Initialize controller
    ReefAngel.LCD.DrawText(0,255,20,50,"Assigning Slaves");
    ReefAngel.RF.SendData(Slave_Start,0,0);
    ReefAngel.RF.UseMemory=true;
    InternalMemory.RFMode_write(0);
    InternalMemory.RFSpeed_write(128);
    InternalMemory.RFDuration_write(10);

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

void loop()
{
    ReefAngel.StandardHeater( Port1,790,800 );
    ReefAngel.RF.UseMemory = false;
    ReefAngel.RF.SetMode( ReefCrest,80,10 );
   
    ////// Place your custom code below here
   
    ReefAngel.Refresh();
    if (ReefAngel.Joystick.IsButtonPressed())
    {
      ReefAngel.RF.UseMemory=true;
      ReefAngel.RF.SendData(Slave_Stop,0,0);
      ReefAngel.LCD.DrawText(0,255,50,60,"Done");
    }
    ////// Place your custom code above here


}





Last edited by robmwpropane on Fri Nov 25, 2016 1:25 pm, edited 1 time in total.
Image

Posts: 12200
Joined: Fri Mar 18, 2011 6:47 pm
PostPosted: Thu Nov 24, 2016 10:04 am
No. you need to load the RF code only once to sync the pumps with the RF module. Once they are synced, you don't need that code anymore.
It's a code dedicated to syncing the pumps only. It can't do anything else.
Then you can generate a code with the wizard and upload and everything should start working.
Roberto.

Posts: 75
Joined: Mon Oct 31, 2016 12:33 pm
PostPosted: Thu Nov 24, 2016 7:35 pm
rimai wrote:No. you need to load the RF code only once to sync the pumps with the RF module. Once they are synced, you don't need that code anymore.
It's a code dedicated to syncing the pumps only. It can't do anything else.
Then you can generate a code with the wizard and upload and everything should start working.


Thanksgiving got in the way! Jk, so I upload the code for Rf to the RA, hook everything up, let it sync. After that, unplug, reload the other code that I have running now, and that's it?

Should I be setting storage to internal memory if I want to control them from the app when I re-upload code?

Thanks!
Image

Posts: 12200
Joined: Fri Mar 18, 2011 6:47 pm
PostPosted: Thu Nov 24, 2016 9:03 pm
if it got synced, it should work.
Post the code and we can confirm.
Roberto.

Posts: 75
Joined: Mon Oct 31, 2016 12:33 pm
PostPosted: Fri Nov 25, 2016 7:08 am
So I did as you said, everything is working. Some things to note,

I can not change vortech modes from the android app? It only displays mode and speed, NO duration? And again, I can't make changes?

I can change from the portal, however, when I uploaded the code, my portal went bonkers? It was if though I had every attachment there was. It took a good 5 minutes to go back to being accurate.

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


////// 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 = Port1Bit | Port2Bit | Port3Bit;
    // Ports toggled when Lights On / Off menu entry selected
    ReefAngel.LightsOnPorts = 0;
    // Ports turned off when Overheat temperature exceeded
    ReefAngel.OverheatShutoffPorts = Port1Bit;
    // Use T1 probe as temperature and overheat functions
    ReefAngel.TempProbe = T1_PROBE;
    ReefAngel.OverheatProbe = T1_PROBE;


    // Ports that are always on
    ReefAngel.Relay.On( Port2 );
    ReefAngel.Relay.On( Port3 );

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

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

void loop()
{
    ReefAngel.StandardHeater( Port1 );
    ReefAngel.RF.UseMemory = true;
    ////// Place your custom code below here
   

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


}

Last edited by robmwpropane on Fri Nov 25, 2016 1:25 pm, edited 1 time in total.
Image

Posts: 12200
Joined: Fri Mar 18, 2011 6:47 pm
PostPosted: Fri Nov 25, 2016 9:41 am
Yes, you can.
Tap and hold the mode.
It should pop up a box to allow you to change the modes.
Roberto.

Posts: 75
Joined: Mon Oct 31, 2016 12:33 pm
PostPosted: Fri Nov 25, 2016 12:43 pm
rimai wrote:Yes, you can.
Tap and hold the mode.
It should pop up a box to allow you to change the modes.


It works!! Thanks! Not as intuitive as the relay ports that are grayed out boxes. I did tap mode, just never thought to hold.

I've looked through countless threads on here. Is there a easy way to set up the vortechs for waves, nutrient export, etc? The way I did it before was to play with the dials and then save the mode? Right now I have 2 mp40wes, one is sync, the other anti sync.

I borrowed some of your code I found in a thread to change modes throughout the day, I just don't understand? Can you add some explanation for what the numbers mean and how I can change it for my needs? I added comments to what I don't understand.

Just when you get time, thank you very much!

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


////// 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 = Port1Bit | Port2Bit | Port3Bit;
    // Ports toggled when Lights On / Off menu entry selected
    ReefAngel.LightsOnPorts = 0;
    // Ports turned off when Overheat temperature exceeded
    ReefAngel.OverheatShutoffPorts = Port1Bit;
    // Use T1 probe as temperature and overheat functions
    ReefAngel.TempProbe = T1_PROBE;
    ReefAngel.OverheatProbe = T1_PROBE;


    // Ports that are always on
    ReefAngel.Relay.On( Port2 );
    ReefAngel.Relay.On( Port3 );

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

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

void loop()
{
    ReefAngel.StandardHeater( Port1 );
    ReefAngel.RF.UseMemory = true;
   
    ////// Place your custom code below here
   
    if (ReefAngel.DisplayedMenu!=FEEDING_MODE || ReefAngel.DisplayedMenu!=WATERCHANGE_MODE)
  {
    if (hour()>=15 && hour()<=17) ////WHAT DO #'s MEAN?
    {
      ReefAngel.RF.UseMemory=false;
      ReefAngel.RF.SetMode(LongWave,100,3);  ////Can I change this to any mode?
    }
    else if (hour()>=22 || hour()<7) ////WHAT DO #'s MEAN?
    {
      ReefAngel.RF.UseMemory=false;
      ReefAngel.RF.SetMode(ReefCrest,40,0); ////WHAT DO #'s MEAN?
    }
    else
    {
      ReefAngel.RF.UseMemory=true; ////Does this need to be here at the end?
    }

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


}

Last edited by robmwpropane on Fri Nov 25, 2016 1:25 pm, edited 1 time in total.
Image

Posts: 12200
Joined: Fri Mar 18, 2011 6:47 pm
PostPosted: Fri Nov 25, 2016 12:50 pm
Whe you use ReefAngel.RF.UseMemory=true; it will use settings store in your internal memory that you set with the phone app.
If you want the controller to use a different one, you need to set it to false.
if (hour()>=15 && hour()<=17) means is hour of the day is greater than or equal to 15 and hour of the day is less than or equal to 17 do something
ReefAngel.RF.SetMode(LongWave,100,3); means longwave mode with 100% speed and pulse duration of 3 seconds.
Roberto.

Posts: 75
Joined: Mon Oct 31, 2016 12:33 pm
PostPosted: Fri Nov 25, 2016 1:30 pm
rimai wrote:Whe you use ReefAngel.RF.UseMemory=true; it will use settings store in your internal memory that you set with the phone app.
If you want the controller to use a different one, you need to set it to false.
if (hour()>=15 && hour()<=17) means is hour of the day is greater than or equal to 15 and hour of the day is less than or equal to 17 do something
ReefAngel.RF.SetMode(LongWave,100,3); means longwave mode with 100% speed and pulse duration of 3 seconds.


Will I still be able to control the modes through the app if set to false?

In the app, what is the difference between "home" and "away", what is it's purpose?
Image
Next

Return to How do I code ...

Who is online

Users browsing this forum: No registered users and 3 guests

cron