Page 1 of 1

RF Expansion coding

Posted: Thu May 31, 2012 9:38 pm
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
      }
   

Re: RF Expansion coding

Posted: Thu May 31, 2012 9:50 pm
by rimai
Did you sync the pumps with the controller?

Re: RF Expansion coding

Posted: Fri Jun 01, 2012 7:19 pm
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.

Re: RF Expansion coding

Posted: Fri Jun 01, 2012 7:38 pm
by rimai
Which test code?

Re: RF Expansion coding

Posted: Fri Jun 01, 2012 7:53 pm
by c_wick
The customMainscreen_rfexpansion

Re: RF Expansion coding

Posted: Fri Jun 01, 2012 8:20 pm
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?

Re: RF Expansion coding

Posted: Fri Jun 01, 2012 8:29 pm
by c_wick
Module is green pump white

Re: RF Expansion coding

Posted: Fri Jun 01, 2012 8:32 pm
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?

Re: RF Expansion coding

Posted: Fri Jun 01, 2012 8:36 pm
by c_wick
Module looks white pump white

Re: RF Expansion coding

Posted: Fri Jun 01, 2012 8:43 pm
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);

Re: RF Expansion coding

Posted: Fri Jun 01, 2012 8:52 pm
by c_wick
Module blue/pump white

Re: RF Expansion coding

Posted: Fri Jun 01, 2012 8:56 pm
by rimai
Is the pump working like it is supposed to?
Short pulse at 50%?

Re: RF Expansion coding

Posted: Fri Jun 01, 2012 9:05 pm
by c_wick
Nope the pump right now is running at constant pump near max

Re: RF Expansion coding

Posted: Fri Jun 01, 2012 9:08 pm
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?

Re: RF Expansion coding

Posted: Fri Jun 01, 2012 9:22 pm
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

Re: RF Expansion coding

Posted: Fri Jun 01, 2012 9:24 pm
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)

Re: RF Expansion coding

Posted: Fri Jun 01, 2012 9:27 pm
by c_wick
Do you want me to send you my full code?

Re: RF Expansion coding

Posted: Sat Jun 02, 2012 8:50 am
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.

Re: RF Expansion coding

Posted: Sun Jun 03, 2012 4:26 pm
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

Re: RF Expansion coding

Posted: Sun Jun 03, 2012 4:51 pm
by rimai
Just to confirm, you are hitting the joystick after you go though the sync process and get "Done" in the screen, right?

Re: RF Expansion coding

Posted: Sun Jun 03, 2012 4:55 pm
by c_wick
yep