logging
logging
I looked but couldnt find it. Is there something out there that will log each time my controller does a scheduled action. i have my dosers set up from the wizard but I dont know when they dose so if I can see a log of each action I can see when it doses.
Re: logging
You can check on the portal, problem is ir only logs in five minutes incriminates. So you generally wont see a doser because it doesnt run long enough. I do recall someone had a line of code that setup a fake relay that would be triggered every time a port a port was on and it would stay on long enough for it to be seen by the portal
Re: logging
Here you go.
Put this up top in the globals section.
Put this in loop.
Replace AlkPump and CalPump with the ports you are using to control your dosing pumps. Replace VirtAlk and VirtCal with ports on an expansion box you don't actually have, like Box2_Port1 and Box2_Port2 for the second expansion box. You can then look on the portal and these imaginary ports will show when your dosing pumps actuate.
--Colin
Put this up top in the globals section.
Code: Select all
unsigned long LastUpdate1=0;
unsigned long LastUpdate2=0;
Code: Select all
if (ReefAngel.Relay.Status(AlkPump) && LastUpdate1==0)
{
LastUpdate1 = now();
ReefAngel.Relay.On (VirtAlk);
}
if (now() - LastUpdate1 >= 300 && LastUpdate1 != 0)
{
LastUpdate1 = 0;
ReefAngel.Relay.Off (VirtAlk);
}
if (ReefAngel.Relay.Status(CalPump) && LastUpdate2==0)
{
LastUpdate2 = now();
ReefAngel.Relay.On (VirtCal);
}
if (now() - LastUpdate2 >= 300 && LastUpdate2 != 0)
{
LastUpdate2 = 0;
ReefAngel.Relay.Off (VirtCal);
}
--Colin
Last edited by cosmith71 on Sun May 10, 2015 6:03 am, edited 1 time in total.
Re: logging
I edited my above post. I left out a section of code at the end.
--Colin
--Colin
Re: logging
Thanks, now how do I put it into the reef angel, lol. I'm a noob never messed with any coding just use the reef wizard.
Re: logging
Sorry for the late reply, been busy with work.
In the Wizard generated code, you'll see a couple of lines like this near the top.
Put the first two lines in between those two like this:
Farther down, in the void loop() section, you'll see these lines:
Put the rest of the code between them, like this:
Now, you'll need to replace CalPump and AlkPump with the relay ports you have your dosing pumps on. Say if your calcium pump is plugged into port 1 on your relay box and your alkalinity pump is plugged into port 2, replace CalPump with Port1 and AlkPump with Port2.
Now replace VirtCal and VirtAlk with ports on another, non-existent expansion relay box. You can use Box2_Port1 and Box2_Port2 assuming you don't have 3 relay boxes (this would be the second expansion relay, or the third relay box in the system). If we're doing stuff with a port, the RA assumes it exists even if there is no hardware attached. So the software reacts even though nothing is happening in the real world.
What we're doing here is checking to see if the ports the pumps are plugged into are running, and if they are, turn on another port for 5 minutes so the portal can catch it (portal only updates every 5 minutes so it often misses short things like dosing pump activations). This will only show you that it activated at around a certain time. It won't show how long it ran.
--Colin
In the Wizard generated code, you'll see a couple of lines like this near the top.
Code: Select all
////// Place global variable code below here
////// Place global variable code above here
Code: Select all
////// Place global variable code below here
unsigned long LastUpdate1=0;
unsigned long LastUpdate2=0;
////// Place global variable code above here
Code: Select all
////// Place your custom code below here
////// Place your custom code above here
Code: Select all
////// Place your custom code below here
if (ReefAngel.Relay.Status(AlkPump) && LastUpdate1==0)
{
LastUpdate1 = now();
ReefAngel.Relay.On (VirtAlk);
}
if (now() - LastUpdate1 >= 300 && LastUpdate1 != 0)
{
LastUpdate1 = 0;
ReefAngel.Relay.Off (VirtAlk);
}
if (ReefAngel.Relay.Status(CalPump) && LastUpdate2==0)
{
LastUpdate2 = now();
ReefAngel.Relay.On (VirtCal);
}
if (now() - LastUpdate2 >= 300 && LastUpdate2 != 0)
{
LastUpdate2 = 0;
ReefAngel.Relay.Off (VirtCal);
}
////// Place your custom code above here
Now replace VirtCal and VirtAlk with ports on another, non-existent expansion relay box. You can use Box2_Port1 and Box2_Port2 assuming you don't have 3 relay boxes (this would be the second expansion relay, or the third relay box in the system). If we're doing stuff with a port, the RA assumes it exists even if there is no hardware attached. So the software reacts even though nothing is happening in the real world.
What we're doing here is checking to see if the ports the pumps are plugged into are running, and if they are, turn on another port for 5 minutes so the portal can catch it (portal only updates every 5 minutes so it often misses short things like dosing pump activations). This will only show you that it activated at around a certain time. It won't show how long it ran.
--Colin
Re: logging
Here's a little tutorial on coding. It's not meant to make you a great programmer, but you'll at least have some idea of what you're looking at.
http://forum.reefangel.com/viewtopic.php?f=14&t=3353
--Colin
http://forum.reefangel.com/viewtopic.php?f=14&t=3353
--Colin
Re: logging
Thanks I'll give it a shot tonight and report back. I appreciate the help
Re: logging
Well the code seems to load by the portal doesnt work for me, I've searched and tried all the suggestions but nothing
Re: logging
How does the portal not work?