RF Expansion coding

Do you have a question on how to do something.
Ask in here.
Post Reply
c_wick
Posts: 25
Joined: Tue May 22, 2012 2:41 pm

RF Expansion coding

Post by c_wick »

Wondering if anybody can help me out here...I'm trying to get my Vortech pump setup with the RF expansion but unfortunately I'm failing... I stole somebody else's code and manipulated it to what I would like the pump to do. From the looks of it the module is working, I get a green light...but no talkie with pumpie...:(

Here's the code...

Code: Select all

//Vortech Setup
 
       if ( hour() > 11 || hour () < 14 )
         {
            ReefAngel.RF.UseMemory=false;
            ReefAngel.RF.SetMode(Random2,200,0);  //Reef Crest from 11 am - 2 pm
         }
         
       else if ( hour() >= 13 || hour () <= 16 )
      {
            ReefAngel.RF.UseMemory=false;
           ReefAngel.RF.SetMode(Smart_NTM,230,10);  //Nutrient Transport Mode from 1 pm - 4 pm
      }
      
      else if ( hour() > 16 || hour () < 20 )
      {
            ReefAngel.RF.UseMemory=false;
           ReefAngel.RF.SetMode(Smart_TSM,230,0); //Tidal Swell Mode from 4pm - 8 pm
      }
      
      else if ( hour() >= 20 || hour () <= 11 )
      {        
             ReefAngel.RF.UseMemory=false;
             ReefAngel.RF.SetMode(Random1,125,0); //Night Mode from 8pm - 11 am
      }
   
rimai
Posts: 12857
Joined: Fri Mar 18, 2011 6:47 pm

Re: RF Expansion coding

Post by rimai »

Did you sync the pumps with the controller?
Roberto.
c_wick
Posts: 25
Joined: Tue May 22, 2012 2:41 pm

Re: RF Expansion coding

Post by c_wick »

I just synced the pump (didn't do that earlier...), everything went according to the manual (Had a solid green light on the module and solid white on the pump). When I tried uploading the Test code the module went to a white light and the pump stayed white...same thing when I tried uploading my code.
rimai
Posts: 12857
Joined: Fri Mar 18, 2011 6:47 pm

Re: RF Expansion coding

Post by rimai »

Which test code?
Roberto.
c_wick
Posts: 25
Joined: Tue May 22, 2012 2:41 pm

Re: RF Expansion coding

Post by c_wick »

The customMainscreen_rfexpansion
rimai
Posts: 12857
Joined: Fri Mar 18, 2011 6:47 pm

Re: RF Expansion coding

Post by rimai »

The pump will always stay either white, orange or blue.
White means sync, orange means anti-sync and blue is back-of-tank.
You can check the modes on the vortech manual.
Now, the RF module changes colors according to whichever mode you set.
Let's see what is going on.

Code: Select all

#include <Salinity.h>
#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 <RF.h>
#include <IO.h>
#include <ORP.h>
#include <AI.h>
#include <ReefAngel.h>


void setup()
{
  ReefAngel.Init();  //Initialize controller
}

void loop()
{
  ReefAngel.RF.UseMemory=false;
  ReefAngel.RF.SetMode(0,50,10);
  ReefAngel.ShowInterface();
}
What color does the RF module show?
Roberto.
c_wick
Posts: 25
Joined: Tue May 22, 2012 2:41 pm

Re: RF Expansion coding

Post by c_wick »

Module is green pump white
rimai
Posts: 12857
Joined: Fri Mar 18, 2011 6:47 pm

Re: RF Expansion coding

Post by rimai »

Green is good :)
Means you are communicating with the pump.
Now, let's try a different mode:

Code: Select all

ReefAngel.RF.SetMode(1,50,10);
Does it change color?
Roberto.
c_wick
Posts: 25
Joined: Tue May 22, 2012 2:41 pm

Re: RF Expansion coding

Post by c_wick »

Module looks white pump white
rimai
Posts: 12857
Joined: Fri Mar 18, 2011 6:47 pm

Re: RF Expansion coding

Post by rimai »

Is it white or light yellow??
Let's try one that has a very distinct color and changes speed.
Mode 3 is short pulse.

Code: Select all

ReefAngel.RF.SetMode(3,50,10);
Roberto.
c_wick
Posts: 25
Joined: Tue May 22, 2012 2:41 pm

Re: RF Expansion coding

Post by c_wick »

Module blue/pump white
rimai
Posts: 12857
Joined: Fri Mar 18, 2011 6:47 pm

Re: RF Expansion coding

Post by rimai »

Is the pump working like it is supposed to?
Short pulse at 50%?
Roberto.
c_wick
Posts: 25
Joined: Tue May 22, 2012 2:41 pm

Re: RF Expansion coding

Post by c_wick »

Nope the pump right now is running at constant pump near max
rimai
Posts: 12857
Joined: Fri Mar 18, 2011 6:47 pm

Re: RF Expansion coding

Post by rimai »

Did you reset the pump settings before you went through the sync process?
What happens when you press the left button on the vortech driver?
Roberto.
c_wick
Posts: 25
Joined: Tue May 22, 2012 2:41 pm

Re: RF Expansion coding

Post by c_wick »

Yep I followed the instructions to the T, after holding both the Mode and set buttons I get Flashing red, white and blue Then hold the mode until flashing purple and red
c_wick
Posts: 25
Joined: Tue May 22, 2012 2:41 pm

Re: RF Expansion coding

Post by c_wick »

Then hold set and the pump goes to green and currently the pump is green with a perhaps yellowish white light on the rf module ( its kinda hard to tell)
c_wick
Posts: 25
Joined: Tue May 22, 2012 2:41 pm

Re: RF Expansion coding

Post by c_wick »

Do you want me to send you my full code?
rimai
Posts: 12857
Joined: Fri Mar 18, 2011 6:47 pm

Re: RF Expansion coding

Post by rimai »

If the driver is green, it means it is not synced.
When you erase the settings like you mentioned above, it turns the driver into a standalone driver.
Then you can go ahead and sync it to RA.
Roberto.
c_wick
Posts: 25
Joined: Tue May 22, 2012 2:41 pm

Re: RF Expansion coding

Post by c_wick »

I'm still not able to get the pump working correctly. I've tested the code with different settings and everytime I get the RF module to change colors but nothing ever changes with the pump. I've reset and tried again from scratch mulitple times. Currently everything is set up as far as I can get it, the driver is white and if I hit the left button is goes orange
rimai
Posts: 12857
Joined: Fri Mar 18, 2011 6:47 pm

Re: RF Expansion coding

Post by rimai »

Just to confirm, you are hitting the joystick after you go though the sync process and get "Done" in the screen, right?
Roberto.
c_wick
Posts: 25
Joined: Tue May 22, 2012 2:41 pm

Re: RF Expansion coding

Post by c_wick »

yep
Post Reply