Internal Memory Leaves LED's at 1%

Related to the Portal
Post Reply
Drew471
Posts: 21
Joined: Sun Oct 06, 2013 5:54 pm

Internal Memory Leaves LED's at 1%

Post by Drew471 »

So I received my Wifi module today and got it working!!! :D So I started using the internal memory to control my PWM expansion. I have been using my PWM expansion for months no problem but now when they should be off they sit at 1%. I am not sure because the light schedule is noon to 10 PM and at 10 they all went to 1% instead of zero. am I missing something? currently I used the http:yourip:2000/wifi to override to 0, then cancel over ride and they stayed at zero. Any Input on what this could be?

Also on a side note is there a way to set different channels to come on at different times with internal memory through the portal? like make channel 2 actinic so it turns on 30 minutes before and stays on after the rest? I am assuming it can be done just not with the wizard doing the programming for me.


Thanks!
Drew
rimai
Posts: 12881
Joined: Fri Mar 18, 2011 6:47 pm

Re: Internal Memory Leaves LED's at 1%

Post by rimai »

Can you post your code?
Roberto.
Drew471
Posts: 21
Joined: Sun Oct 06, 2013 5:54 pm

Re: Internal Memory Leaves LED's at 1%

Post by Drew471 »

Its nothing special straight wizard.. hopefully I will learn to make some custom code myself soon so I don't have to relay on the basics of the wizards.


#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 <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
ReefAngel.AddWaterLevelExpansion(); // Water Level Expansion Module
// Ports toggled in Feeding Mode
ReefAngel.FeedingModePorts = 0;
// Ports toggled in Water Change Mode
ReefAngel.WaterChangePorts = Port1Bit | Port2Bit | Port3Bit | Port4Bit | Port6Bit | Port8Bit;
// Ports toggled when Lights On / Off menu entry selected
ReefAngel.LightsOnPorts = Port5Bit;
// Ports turned off when Overheat temperature exceeded
ReefAngel.OverheatShutoffPorts = Port3Bit | Port5Bit;
// Use T1 probe as temperature and overheat functions
ReefAngel.TempProbe = T1_PROBE;
ReefAngel.OverheatProbe = T1_PROBE;

// Feeeding and Water Change mode speed
ReefAngel.DCPump.FeedingSpeed=0;
ReefAngel.DCPump.WaterChangeSpeed=0;


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

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


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

void loop()
{
ReefAngel.StandardHeater( Port3 );
ReefAngel.SingleATOLow( Port4 );
ReefAngel.MoonLights( Port5 );
ReefAngel.DosingPumpRepeat1( Port7 );
ReefAngel.DosingPumpRepeat2( Port8 );
ReefAngel.PWM.Channel0PWMParabola();
ReefAngel.PWM.Channel1PWMParabola();
ReefAngel.PWM.Channel2PWMParabola();
ReefAngel.PWM.Channel3PWMParabola();
ReefAngel.DCPump.UseMemory = true;
ReefAngel.DCPump.DaylightChannel = Sync;
ReefAngel.DCPump.ActinicChannel = Sync;
ReefAngel.DCPump.ExpansionChannel[0] = None;
ReefAngel.DCPump.ExpansionChannel[1] = None;
ReefAngel.DCPump.ExpansionChannel[2] = None;
ReefAngel.DCPump.ExpansionChannel[3] = None;
ReefAngel.DCPump.ExpansionChannel[4] = None;
ReefAngel.DCPump.ExpansionChannel[5] = None;
////// Place your custom code below here


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

// This should always be the last line
ReefAngel.Portal( "Drew471" );
ReefAngel.ShowInterface();
}
rimai
Posts: 12881
Joined: Fri Mar 18, 2011 6:47 pm

Re: Internal Memory Leaves LED's at 1%

Post by rimai »

Make sure that you have 0 in the end% of the channel you are saying it is ending at 1%.
For the actinic offset, try this:

Code: Select all

ReefAngel.PWM.Channel0PWMParabola(30);
Roberto.
Drew471
Posts: 21
Joined: Sun Oct 06, 2013 5:54 pm

Re: Internal Memory Leaves LED's at 1%

Post by Drew471 »

Roberto do you mean start %? Of the channels? Isn't end% what I reaches in the middle of its cycle? According to your dimming waveforms charts. They all had a start % of 0

The (30) stands for 30 minutes assuming.

I will try messing around more tomorrow night and see if it happens again.

Sent from my SPH-L720 using Tapatalk
rimai
Posts: 12881
Joined: Fri Mar 18, 2011 6:47 pm

Re: Internal Memory Leaves LED's at 1%

Post by rimai »

Yeah... sorry.. start %.
Yes, the 30 is the number of minutes that you want to offset the parabola both in the beginning and end of the parabola.
Roberto.
ReEfnWrX
Posts: 234
Joined: Tue Nov 05, 2013 8:40 am
Location: Houston TX

Re: Internal Memory Leaves LED's at 1%

Post by ReEfnWrX »

Roberto,

What is the memory location that is used for Dimming% when you override your Relay ports to on? I remember stumbling across this but cannot find it.

My Dimming channels always go up to 20% after my light schedule ends. He might have it set to 1?
Image
rimai
Posts: 12881
Joined: Fri Mar 18, 2011 6:47 pm

Re: Internal Memory Leaves LED's at 1%

Post by rimai »

What you mentioned is only applicable to standard dimming ports.
It could be reminiscence of the parabola function on an 8bit processor.
If you can't get it to work, you will need to change the function to this:

Code: Select all

ReefAngel.PWM.SetChannel(0,PWMParabola(
		InternalMemory.StdLightsOnHour_read(),
		InternalMemory.StdLightsOnMinute_read(),
		InternalMemory.StdLightsOffHour_read(),
		InternalMemory.StdLightsOffMinute_read(),
		InternalMemory.PWMSlopeStart0_read(),
		InternalMemory.PWMSlopeEnd0_read(),
		0 
		));	
That will force the channel to output 0 when the waveform is completed.
The last zero is what defines what the % is when you are outside the waveform.
Roberto.
Drew471
Posts: 21
Joined: Sun Oct 06, 2013 5:54 pm

Re: Internal Memory Leaves LED's at 1%

Post by Drew471 »

So I checked and it still hangs at 1% unless I hit reboot on my andriod App. So any easy fix would be to have the system reboot when the lights are suppose to go off. What is the code to make the system reboot at time X?
rimai
Posts: 12881
Joined: Fri Mar 18, 2011 6:47 pm

Re: Internal Memory Leaves LED's at 1%

Post by rimai »

According to your chart, it goes to zero.
Does it show on the screen 1%?
Roberto.
Drew471
Posts: 21
Joined: Sun Oct 06, 2013 5:54 pm

Re: Internal Memory Leaves LED's at 1%

Post by Drew471 »

My portal says 1% for 2 channels along with my app.... Below you can see the light is actually on.
Image
I click reboot and everything goes right.

Here you can see my stuff is set to zero. Image

Sent from my SPH-L720 using Tapatalk
Drew471
Posts: 21
Joined: Sun Oct 06, 2013 5:54 pm

Re: Internal Memory Leaves LED's at 1%

Post by Drew471 »

Image

Whoops here is the light on!

Sent from my SPH-L720 using Tapatalk
rimai
Posts: 12881
Joined: Fri Mar 18, 2011 6:47 pm

Re: Internal Memory Leaves LED's at 1%

Post by rimai »

The code I posted was for channel 0 and not channel 1
Roberto.
Post Reply