Page 1 of 1

Vortech Code issues

Posted: Thu Jul 12, 2012 5:47 am
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

Re: Vortech Code issues

Posted: Thu Jul 12, 2012 7:35 am
by rimai
Did you use the internal memory or hard coded option?
Can you post your code.
I think I know what it is.

Re: Vortech Code issues

Posted: Thu Jul 12, 2012 3:02 pm
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 );
}

Re: Vortech Code issues

Posted: Thu Jul 12, 2012 5:47 pm
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 );

Re: Vortech Code issues

Posted: Thu Jul 12, 2012 5:50 pm
by rimai
I added it to the list of issues:
https://github.com/reefangel/Wizard/issues/3

Re: Vortech Code issues

Posted: Fri Jul 13, 2012 9:08 pm
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.

Re: Vortech Code issues

Posted: Fri Jul 13, 2012 9:30 pm
by rimai
1.0.0 memory table has been relocated to 200s due to several reasons.
So, use memory location 255 instead of 855

Re: Vortech Code issues

Posted: Fri Jul 13, 2012 10:31 pm
by eds
Ah, that would explain it, cheers :)

Re: Vortech Code issues

Posted: Sat Jul 14, 2012 7:22 am
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.

Re: Vortech Code issues

Posted: Tue Aug 07, 2012 6:04 pm
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

Re: Vortech Code issues

Posted: Tue Aug 07, 2012 6:05 pm
by rimai
Speed is 0-100 range

Re: Vortech Code issues

Posted: Tue Aug 07, 2012 6:10 pm
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

Re: Vortech Code issues

Posted: Tue Aug 07, 2012 6:22 pm
by rimai
How about the duration, can you change the duration?

Re: Vortech Code issues

Posted: Tue Aug 07, 2012 6:32 pm
by projectx
Tried that too, with no change in speed. I normally run reef crest and prior to the lib change it worked flawlessly

Re: Vortech Code issues

Posted: Tue Aug 07, 2012 7:20 pm
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?