Vortech Code issues

Basic / Standard Reef Angel hardware
Post Reply
eds
Posts: 34
Joined: Wed Apr 25, 2012 12:36 am
Location: Brisbane, Australia

Vortech Code issues

Post by eds »

Hi Guys,

Since Iv used the Reef Angel Wizard to generate my code with my Vortechs, I can no longer control them from my android phone.

Iv tried doing it via URL and through the android app however I cannot get it to change over what was preset.

Do I need additional code for this? My only other option is to start again and do everything manually :)

Cheers

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

Re: Vortech Code issues

Post by rimai »

Did you use the internal memory or hard coded option?
Can you post your code.
I think I know what it is.
Roberto.
eds
Posts: 34
Joined: Wed Apr 25, 2012 12:36 am
Location: Brisbane, Australia

Re: Vortech Code issues

Post by eds »

Internal Memory. Tried to use 855 as the variable in the android app.

Code is

#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 <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.SetTemperatureUnit( Celsius ); // set to Celsius Temperature

    // Ports toggled in Feeding Mode
    ReefAngel.FeedingModePorts = Port4Bit | Port5Bit | Port6Bit;
    ReefAngel.FeedingModePortsE[0] = 0;
    // Ports toggled in Water Change Mode
    ReefAngel.WaterChangePorts = Port4Bit | Port5Bit | Port6Bit;
    ReefAngel.WaterChangePortsE[0] = Port5Bit | Port7Bit;
    // Ports toggled when Lights On / Off menu entry selected
    ReefAngel.LightsOnPorts = Port1Bit | Port2Bit | Port3Bit;
    ReefAngel.LightsOnPortsE[0] = 0;
    // Ports turned off when Overheat temperature exceeded
    ReefAngel.OverheatShutoffPorts = 0;
    ReefAngel.OverheatShutoffPortsE[0] = Port6Bit;
    // Use T1 probe as temperature and overheat functions
    ReefAngel.TempProbe = T1_PROBE;
    ReefAngel.OverheatProbe = T1_PROBE;
    // Set the Overheat temperature setting
    InternalMemory.OverheatTemp_write( 260 );


    // Ports that are always on
    ReefAngel.Relay.On( Port1 );
    ReefAngel.Relay.On( Port2 );
    ReefAngel.Relay.On( Port3 );
    ReefAngel.Relay.On( Port4 );
    ReefAngel.Relay.On( Port5 );
    ReefAngel.Relay.On( Port6 );
    ReefAngel.Relay.On( Box1_Port1 );
    ReefAngel.Relay.On( Box1_Port2 );
    ReefAngel.Relay.On( Box1_Port7 );

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

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

void loop()
{
    ReefAngel.StandardHeater( Box1_Port6,255,268 );
    ReefAngel.RF.UseMemory = false;
    ReefAngel.RF.SetMode( Lagoon,100,10 );
    ////// Place your custom code below here
    

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

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

void DrawCustomMain()
{
    int x,y;
    char text[10];
    // Parameters
#if defined DisplayLEDPWM && ! defined RemoveAllLights
    ReefAngel.LCD.DrawMonitor( 15, 62, ReefAngel.Params,
    ReefAngel.PWM.GetDaylightValue(), ReefAngel.PWM.GetActinicValue() );
#else // defined DisplayLEDPWM && ! defined RemoveAllLights
    ReefAngel.LCD.DrawMonitor( 15, 62, ReefAngel.Params );
#endif // defined DisplayLEDPWM && ! defined RemoveAllLights
    pingSerial();

    // Main Relay Box
    byte TempRelay = ReefAngel.Relay.RelayData;
    TempRelay &= ReefAngel.Relay.RelayMaskOff;
    TempRelay |= ReefAngel.Relay.RelayMaskOn;
    ReefAngel.LCD.DrawOutletBox( 12, 93, TempRelay );
    pingSerial();

    // Relay Expansion
    TempRelay = ReefAngel.Relay.RelayDataE[0];
    TempRelay &= ReefAngel.Relay.RelayMaskOffE[0];
    TempRelay |= ReefAngel.Relay.RelayMaskOnE[0];
    ReefAngel.LCD.DrawOutletBox( 12, 106, TempRelay );
    pingSerial();

    // Date and Time
    ReefAngel.LCD.DrawDate( 6, 122 );
    pingSerial();
}

void DrawCustomGraph()
{
    ReefAngel.LCD.DrawGraph( 5, 5 );
}
rimai
Posts: 12857
Joined: Fri Mar 18, 2011 6:47 pm

Re: Vortech Code issues

Post by rimai »

Which version of libraries are you using?
Also, remove these lines. This is a bug on the Wizard. These lines should not be in there for internal memory option.

Code: Select all

    ReefAngel.RF.UseMemory = false;
    ReefAngel.RF.SetMode( Lagoon,100,10 );
Roberto.
rimai
Posts: 12857
Joined: Fri Mar 18, 2011 6:47 pm

Re: Vortech Code issues

Post by rimai »

I added it to the list of issues:
https://github.com/reefangel/Wizard/issues/3
Roberto.
eds
Posts: 34
Joined: Wed Apr 25, 2012 12:36 am
Location: Brisbane, Australia

Re: Vortech Code issues

Post by eds »

Okay, sorry for the delay in replying.

I took out the two lines of code and still I can't set the mode. Using library version 1.0.0
I grabbed ReefAngel Status to make the write changes to memory.

If I set the value , for example location 855 and set 5 for NTM mode, it writes fine. If I read it back it confirms that I am using 5 however the pumps are not changing, despite I know that they are being controlled by the RF module.
rimai
Posts: 12857
Joined: Fri Mar 18, 2011 6:47 pm

Re: Vortech Code issues

Post by rimai »

1.0.0 memory table has been relocated to 200s due to several reasons.
So, use memory location 255 instead of 855
Roberto.
eds
Posts: 34
Joined: Wed Apr 25, 2012 12:36 am
Location: Brisbane, Australia

Re: Vortech Code issues

Post by eds »

Ah, that would explain it, cheers :)
binder
Posts: 2865
Joined: Fri Mar 18, 2011 6:20 pm
Location: Illinois
Contact:

Re: Vortech Code issues

Post by binder »

Inside the Android App, you need to make a slight modification to use the new 1.0.0 memory table. By default it uses the old table.

Open up the app, click on the settings button and choose "Settings". Then goto the Application section and choose Settings. Make sure you UNCHECK "Pre v1.0 Locations".

Doing this will allow the app to use the proper memory table.
projectx
Posts: 118
Joined: Sat Apr 23, 2011 6:53 pm

Re: Vortech Code issues

Post by projectx »

I am having a similar issue, my pumps are getting the "mode" from the App as well as the Portal, but the speed on them is not increasing at all. I changed the speed setting in the App to be 255 with no change, if I set the mode to 10 or 5 i do get an increase in speed.
In the app I have removed the checkmark for Pev 1.0 locations.
I am on Lib 1.0.1
Image
rimai
Posts: 12857
Joined: Fri Mar 18, 2011 6:47 pm

Re: Vortech Code issues

Post by rimai »

Speed is 0-100 range
Roberto.
projectx
Posts: 118
Joined: Sat Apr 23, 2011 6:53 pm

Re: Vortech Code issues

Post by projectx »

I have set it to 100 as well, also tried to set it lower around 50 and it didnt seem to impact the pump speed at all
Image
rimai
Posts: 12857
Joined: Fri Mar 18, 2011 6:47 pm

Re: Vortech Code issues

Post by rimai »

How about the duration, can you change the duration?
Roberto.
projectx
Posts: 118
Joined: Sat Apr 23, 2011 6:53 pm

Re: Vortech Code issues

Post by projectx »

Tried that too, with no change in speed. I normally run reef crest and prior to the lib change it worked flawlessly
Image
rimai
Posts: 12857
Joined: Fri Mar 18, 2011 6:47 pm

Re: Vortech Code issues

Post by rimai »

What I meant is if you can change the duration.
If you enter a new value on duration, does it change the duration of the pump?
You would have to change to mode short or long pulse to see it though.
If I understood correctly, you can change modes, right?
Roberto.
Post Reply