Multiple on/off times

Do you have a question on how to do something.
Ask in here.
User avatar
Sacohen
Posts: 1833
Joined: Sun Apr 21, 2013 6:25 am
Location: Davie, FL

Re: Multiple on/off times

Post by Sacohen »

This is from when Port5 went on at 7pm.
I don't think what I posted above is what you wanted, but that's all that showed up.
That was in the bottom of the Arduino.

This was in the white Serial Monitor window that pops up when I hit Ctrl+Shift+M

13700268250off
13700268260off
13700268260off
13700268260off
13700268260off
13700268270off
13700268270off
13700268270off
13700268270off
13700268280off
13700268280off
13700268280off
13700268280off
13700268290off
13700268290off
13700268290off
13700268300off
13700268300off
13700268300off
13700268300off
13700268310off
13700268310off
13700268310off
13700268310off
13700268320off
13700268320off
13700268320off
13700268320off
13700268330off
13700268330off
13700268330off
13700268340off
13700268340off
13700268340off
13700268340off
13700268350off
13700268350off
13700268350off
13700268350off
13700268360off
13700268360off
13700268360off
13700268360off
13700268370off
13700268370off
13700268370off
13700268370off
13700268380off
13700268380off
13700268380off
13700268390off
13700268390off
13700268390off
13700268390off
13700268400off
13700268400off
13700268400off
13700268400off
13700268410off
13700268410off
13700268410off
13700268410off
13700268420off
13700268420off
13700268420off
13700268420off
13700268430off
13700268430off
13700268430off
13700268440off
13700268440off
13700268440off
13700268440off
13700268450off
13700268450off
13700268450off
13700268450off
13700268460off
13700268460off
13700268460off
13700268460off
13700268470off
13700268470off
13700268470off
13700268470off
13700268480off
13700268480off
13700268480off
13700268490off
13700268490off
13700268490off
13700268490off
13700268500off
13700268500off
13700268500off
13700268500off
13700268510off
13700268510off
13700268510off
13700268510off
13700268520off
13700268520off
13700268520off
13700268530off
13700268530off
13700268530off
13700268530off
13700268540off
13700268540off
13700268540off
User avatar
lnevo
Posts: 5430
Joined: Fri Jul 20, 2012 9:42 am

Re: Multiple on/off times

Post by lnevo »

Thats not the serial monitor output. Thats something wrong with your ide.

You cant run serial monitor when the wifi is connected.
User avatar
Sacohen
Posts: 1833
Joined: Sun Apr 21, 2013 6:25 am
Location: Davie, FL

Re: Multiple on/off times

Post by Sacohen »

The Wifi was not connected each time I ran the Serial Monitor.
I unplugged it and plugged the TTL-USB cable back in.
I got No COM port found a couple of time until I switched the USB port I was using and then I got the 2nd capture.
User avatar
cosmith71
Posts: 1437
Joined: Fri Mar 29, 2013 3:51 pm
Location: Oklahoma City

Re: Multiple on/off times

Post by cosmith71 »

Maybe I can shed some light.

Lee, I am running Steve's code on my test unit (basically a RA board with the old 2nd gen display I replaced). I don't have a water level expansion on it, so it always reads 0, and therefore, port 6 (the ATO pump) should be on under normal circumstances. I reduced the cycle duration to 5 minutes with each dosing pump running 60 seconds and the topoff pump turned off for another 60 seconds after port 5 deactuates.

The else is triggered after the extra 60 second wait time (as it should be), "on" is printed on the serial monitor, but port 6 (the ATO pump) never turns back on.

It is on before the dosing pump cycle, turns off when it starts, and never comes back on. It appears that the WaterLevelATO function cannot control the relay after it's over-ridden.

HTH,

--Colin
User avatar
Sacohen
Posts: 1833
Joined: Sun Apr 21, 2013 6:25 am
Location: Davie, FL

Re: Multiple on/off times

Post by Sacohen »

This is what I got when I ran the serial monitor 2 min after Port5 shut off on it's own.

Again completely different from what I got the other 2 times.

on
on
on
on
on
on
on
on
on
on
on
on
on
on
on
on
on
on
on
on
on
on
on
on
on
on
on
on
on
on
on
on
on
on
on
on
on
on
on
on
on
on
on
on
on
on
on
on
on
on
on
on
on
on
on
on
on
on
on
on
on
on
on
on
on
on
on
on
on
on
on
on
on
on
on
on
on
on
on
on
on
on
on
on
on
on
on
on
on
on
on
on
on
on
on
on
on
on
on
on
on
on
on
on
on
on
on
on
on
on
on
User avatar
lnevo
Posts: 5430
Joined: Fri Jul 20, 2012 9:42 am

Re: Multiple on/off times

Post by lnevo »

The water level ato function is basically a relay on call when the params match...I think it's better with the WaterLevel ato function inside the else as I think we may hit the timeout...in any event let me analyze the serial output.

Sacohen can you just give me like two or three lines of output for each step... On is good it means your ato should be functioning...and the off should not be running... So if you see off and the time it means we are blocking the ato and on means nothing should be interfering...
User avatar
lnevo
Posts: 5430
Joined: Fri Jul 20, 2012 9:42 am

Re: Multiple on/off times

Post by lnevo »

It also looks like we didn't capture the output when port 5 is on...if you could make sure we grab it...

If after The two minute test again we should get on...if so try and do the test one more round...
User avatar
Sacohen
Posts: 1833
Joined: Sun Apr 21, 2013 6:25 am
Location: Davie, FL

Re: Multiple on/off times

Post by Sacohen »

Am I even getting the right information?
I posted 3 capture and they all look different.
The first one was in the bottom portion of the Arduino tool.
The other 2 were in the white box that pops up when you hit Ctrl+Shift+M.
User avatar
lnevo
Posts: 5430
Joined: Fri Jul 20, 2012 9:42 am

Re: Multiple on/off times

Post by lnevo »

White box
User avatar
Sacohen
Posts: 1833
Joined: Sun Apr 21, 2013 6:25 am
Location: Davie, FL

Re: Multiple on/off times

Post by Sacohen »

OK. White Box, but I can't do the test, because I can't turn off Port5 without anything communicating with the RA.
The Portal is not communicating with it, The RA Client is not communicating with it.

I'm sorry I'm a little frustrated right now. I do appreciate your help, but I don't know how to turn off a port without communication to the head unit thru the WiFi.

Can you change it from the head unit somehow.

I may just call it a night and deal with this tomorrow. Right now I just want to relax and watch Tanked.
User avatar
cosmith71
Posts: 1437
Joined: Fri Mar 29, 2013 3:51 pm
Location: Oklahoma City

Re: Multiple on/off times

Post by cosmith71 »

Steve, did you ever try my suggested fix?
User avatar
Sacohen
Posts: 1833
Joined: Sun Apr 21, 2013 6:25 am
Location: Davie, FL

Re: Multiple on/off times

Post by Sacohen »

I did not. Lee said to run the test he asked for.

I'll try it now.
User avatar
lnevo
Posts: 5430
Joined: Fri Jul 20, 2012 9:42 am

Re: Multiple on/off times

Post by lnevo »

First off sorry for the frustrations...If you can't control the unit with our code on, then you can try it tomorrow during a cycle and see...but based on the output you sent it should be good.

I recommend just take out the debug from the last code and see.

Colin, the override would not hold up the ato the way it was works but the order change I made may help.
User avatar
Sacohen
Posts: 1833
Joined: Sun Apr 21, 2013 6:25 am
Location: Davie, FL

Re: Multiple on/off times

Post by Sacohen »

Good Morning. everyone.
I uploaded Colin's suggestion last night and checked the relay activity this morning.
I saw a little relay activity on port 6 at 5:15 am and the sump was at the max level.

I decided to run a little further test so unplugged port 6 because I didn't want to add RO water right now because the physical level was fine as was the salinity.

I drained a gallon of water of into a jug. Port6 turned on when I poured the water back in it turned off.

It seems like it is working, but I'm going to keep an eye on it.

Image

Thanks again for everything. Sorry I was in a bad mood before I started working on this last night and the lack of knowledge working with the serial monitor along with the wireless being out added to it.

I'm better today.
User avatar
cosmith71
Posts: 1437
Joined: Fri Mar 29, 2013 3:51 pm
Location: Oklahoma City

Re: Multiple on/off times

Post by cosmith71 »

Awesome! Try to catch the regular cycle and tell us how it goes!

--Colin
binder
Posts: 2871
Joined: Fri Mar 18, 2011 6:20 pm
Location: Illinois
Contact:

Re: Multiple on/off times

Post by binder »

cool! I have been following this thread a little and can completely understand your frustration. The nice thing though is that everyone here (or at least most everyone) are all willing to help. That's one of the things I love about it and I have had my controller since almost the beginning of the project a few years ago. Sorry to hijack the thread... just wanted to chime in a little. :-)

Sent from my Nexus 7
User avatar
Sacohen
Posts: 1833
Joined: Sun Apr 21, 2013 6:25 am
Location: Davie, FL

Re: Multiple on/off times

Post by Sacohen »

cosmith71 wrote:Awesome! Try to catch the regular cycle and tell us how it goes!

--Colin
Colin I caught the 1pm cycle and it looked good, but I'm not 100% certain yet becuse the level was at 29% for the entire exchange and as soon as the pump stopped sending water to the chamber it went to 30% so it never really got low enough to trigger the ATO, but I'll watch it and try to catch the 7pm cycle.

binder wrote:cool! I have been following this thread a little and can completely understand your frustration. The nice thing though is that everyone here (or at least most everyone) are all willing to help. That's one of the things I love about it and I have had my controller since almost the beginning of the project a few years ago. Sorry to hijack the thread... just wanted to chime in a little. :-)

Sent from my Nexus 7
Binder; thanks for the comments. You're not hijacking the thread, you made a comment and a nice one at that.
Colin and Lee have been great helping me. I sure there are others that chime in and help like you and Roberto, but in this case it was these two that put up with my lack of knowledge and it looks like they figured out something that works.

I would like to thank you for the work you put into the scene too. I can't wait to get my new phone so I can try out your Andriod App.
binder
Posts: 2871
Joined: Fri Mar 18, 2011 6:20 pm
Location: Illinois
Contact:

Re: Multiple on/off times

Post by binder »

Sacohen wrote: I would like to thank you for the work you put into the scene too. I can't wait to get my new phone so I can try out your Andriod App.
You're welcome. :)

btw, there's some more cool features coming soon in the app (if you haven't been looking at the Android Reef Angel Status thread on here). :)
User avatar
Sacohen
Posts: 1833
Joined: Sun Apr 21, 2013 6:25 am
Location: Davie, FL

Re: Multiple on/off times

Post by Sacohen »

I have been looking at the Andriod thread. I can't say I've been following yet, but I've been looking at it. :)
User avatar
Sacohen
Posts: 1833
Joined: Sun Apr 21, 2013 6:25 am
Location: Davie, FL

Re: Multiple on/off times

Post by Sacohen »

cosmith71 wrote:Awesome! Try to catch the regular cycle and tell us how it goes!

--Colin
I caught the 7pm cycle and it worked perfectly.
While the water exchange was going on I drained about a quart of water out of the tank so that when it ended it was definitely going to be below 29% I also plugged a light into port6 to see when the port came on without actually dumping RO water in.

2 min after the exchange ended Port6 turned on and then I started putting the quart of water I drained back into the tank and when it reached 31% it turned of Port6 (the light).

Great job Colin.
Thanks for the help Lee.
I think we can close this case. :)
User avatar
lnevo
Posts: 5430
Joined: Fri Jul 20, 2012 9:42 am

Re: Multiple on/off times

Post by lnevo »

Awesome. Post up your full code now. Lets see what you ended up with.
User avatar
Sacohen
Posts: 1833
Joined: Sun Apr 21, 2013 6:25 am
Location: Davie, FL

Re: Multiple on/off times

Post by Sacohen »

This is the code that wound up working.

Code: Select all

////// Place global variable code below here

unsigned long ATOUpdate=0;
////// Place global variable code above here

Code: Select all

void loop()
{
ReefAngel.StandardLights( Port1,12,0,22,0 );
ReefAngel.StandardLights( Port2,13,0,21,0 );
ReefAngel.Relay.Set( Port3, !ReefAngel.Relay.Status( Port1 ) );
ReefAngel.StandardLights( Port7,13,0,21,0 );
ReefAngel.Relay.Set(Port5,(now()-3600)%21600<1200); // Runs for 1200s every 21600 seconds
ReefAngel.Relay.Set(Port8,((now()-3600)-1200)%21600<1200); // Runs for 1200s every 21600 seconds with 1200s offset
ReefAngel.WaterLevelATO(Port6,720,29,31); // Enable ATO the ATO
if (ReefAngel.Relay.Status(Port5)) // Check to see if port 5 is on and update time is empty
{ 
ATOUpdate = now(); // If so, set the update time to now
} 

if (now() - ATOUpdate < 120) // If it hasnt been 120 seconds turn off the port
{ 
ReefAngel.WaterLevelATO(Port6,720,0,1);
}
ReefAngel.PWM.SetActinic(MyCustomWave(50));
if( ReefAngel.DisplayedMenu==FEEDING_MODE ) ReefAngel.PWM.SetActinic(0);
if( ReefAngel.DisplayedMenu==WATERCHANGE_MODE ) ReefAngel.PWM.SetActinic(0);
if (hour()<12 || hour()>=22) ReefAngel.PWM.SetActinic(30);
User avatar
cosmith71
Posts: 1437
Joined: Fri Mar 29, 2013 3:51 pm
Location: Oklahoma City

Re: Multiple on/off times

Post by cosmith71 »

See, I told you we'd get it!

--Colin
User avatar
Sacohen
Posts: 1833
Joined: Sun Apr 21, 2013 6:25 am
Location: Davie, FL

Re: Multiple on/off times

Post by Sacohen »

I knew we would get it, but I didn't want to take any more of your and Lee's time.
Glad we wrapped it up this quick.
User avatar
Sacohen
Posts: 1833
Joined: Sun Apr 21, 2013 6:25 am
Location: Davie, FL

Re: Multiple on/off times

Post by Sacohen »

Can you set at partial # in the water level sensor.
like 29.5% or does it need to be full #'s?

If so would it be 295 or 29.5?
User avatar
cosmith71
Posts: 1437
Joined: Fri Mar 29, 2013 3:51 pm
Location: Oklahoma City

Re: Multiple on/off times

Post by cosmith71 »

Sacohen wrote:Can you set at partial # in the water level sensor.
like 29.5% or does it need to be full #'s?

If so would it be 295 or 29.5?
Nope. Has to be a whole number. They're defined as byte type.

--Colin
User avatar
lnevo
Posts: 5430
Joined: Fri Jul 20, 2012 9:42 am

Re: Multiple on/off times

Post by lnevo »

Im still waiting to hear what happened with the priest and rabbi..
User avatar
Sacohen
Posts: 1833
Joined: Sun Apr 21, 2013 6:25 am
Location: Davie, FL

Re: Multiple on/off times

Post by Sacohen »

Thanks Colin. Lee I'll get back to you on that.
User avatar
Sacohen
Posts: 1833
Joined: Sun Apr 21, 2013 6:25 am
Location: Davie, FL

Re: Multiple on/off times

Post by Sacohen »

A rabbi, a priest, and a Lutheran minister walk into a bar. The bartender looks up and says, "Is this some kind of joke?"

or

the Priest asks the Rabbi "Have you ever tried a bacon sandwich or even fancied one? The Rabbi answers "Well i have speculated about it but my faith forbids me from trying, but father, have you ever fancied a nice night of sex with a good woman, i mean a really good woman?" The Priest thinks hard and answers " Well Rabbi, i have sometimes wondered but my vow of celibacy prevents it from ever occurring" The Rabbi answers "Sure as hell beats a bacon sandwich, don't it?"
User avatar
lnevo
Posts: 5430
Joined: Fri Jul 20, 2012 9:42 am

Re: Multiple on/off times

Post by lnevo »

Lol! Ty :)
Post Reply