Dosing Pump not running on Schedule

Do you have a question on how to do something.
Ask in here.
User avatar
lnevo
Posts: 5422
Joined: Fri Jul 20, 2012 9:42 am

Re: Dosing Pump not running on Schedule

Post by lnevo »

Sorry. add a ; to the end of both portalMinutes and portalSeconds
kirkwood
Posts: 173
Joined: Mon Apr 29, 2013 6:50 am

Re: Dosing Pump not running on Schedule

Post by kirkwood »

Now the error message is from this part of code and it highlights the '{' symbol

byte portalMinutes; = { 0, 2, 4 }

expected primary-expression before "=" token
Image
User avatar
lnevo
Posts: 5422
Joined: Fri Jul 20, 2012 9:42 am

Re: Dosing Pump not running on Schedule

Post by lnevo »

I meant end of the line...

Code: Select all

byte portalMinutes = { 0, 2, 4 };
kirkwood
Posts: 173
Joined: Mon Apr 29, 2013 6:50 am

Re: Dosing Pump not running on Schedule

Post by kirkwood »

lnevo wrote:I meant end of the line...

Code: Select all

byte portalMinutes = { 0, 2, 4 };
byte portalMinutes = { 0, 2, 4 };

I made the change to the code above but this produced the same error as before -

scalar object 'portalMinutes' requires one element in initializer


Here is what is said when I verified the code before compiling and uploading.
The following features were detected:
Wifi Attachment
Custom Variable
Simple Menu
sketch_jun13_ATOadded.cpp: In function 'void loop()':
sketch_jun13_ATOadded:81: error: scalar object 'portalMinutes' requires one element in initializer
sketch_jun13_ATOadded:82: error: scalar object 'portalSeconds' requires one element in initializer
sketch_jun13_ATOadded:110: error: 'Port7bit' was not declared in this scope
sketch_jun13_ATOadded:113: error: 'Port7bit' was not declared in this scope
sketch_jun13_ATOadded:113: error: expected `)' before '{' token
Image
User avatar
lnevo
Posts: 5422
Joined: Fri Jul 20, 2012 9:42 am

Re: Dosing Pump not running on Schedule

Post by lnevo »

argh... so sorry..

Code: Select all

byte portalMinutes[numPumps] = { 0, 2, 4 };
byte portalSeconds[numPumps] = { 1, 3, 5 };
kirkwood
Posts: 173
Joined: Mon Apr 29, 2013 6:50 am

Re: Dosing Pump not running on Schedule

Post by kirkwood »

if (bitRead(ReefAngel.Relay.RelayMaskOff, Port7bit)==0) { // ATO relay is manually disabled
atoDisabled=true;

Now I get this error from the above code - 'Port7bit' was not declared in this scope
Image
User avatar
lnevo
Posts: 5422
Joined: Fri Jul 20, 2012 9:42 am

Re: Dosing Pump not running on Schedule

Post by lnevo »

Port7Bit

Capital B required....
User avatar
lnevo
Posts: 5422
Joined: Fri Jul 20, 2012 9:42 am

Re: Dosing Pump not running on Schedule

Post by lnevo »

And it looks like your gonna have an error here too:

if (atoDisabled && (bitRead(ReefAngel.Relay.RelayMaskOff, Port7bit)==1)

It should be:

if (atoDisabled && (bitRead(ReefAngel.Relay.RelayMaskOff, Port7bit)==1))

with an extra paren at the end.
User avatar
lnevo
Posts: 5422
Joined: Fri Jul 20, 2012 9:42 am

Re: Dosing Pump not running on Schedule

Post by lnevo »

Any progress? I'm dying to know the result :)
kirkwood
Posts: 173
Joined: Mon Apr 29, 2013 6:50 am

Re: Dosing Pump not running on Schedule

Post by kirkwood »

lnevo wrote:Any progress? I'm dying to know the result :)
yes, I got it uploaded last night - then of course we had a bad storm and lost power for a few hours. Comcast finally got my area back on line this morning. I can see now that ALL the custom fields seem to be logging quality data. I will have to wait and see what it looks like at the end of the day but so far so good.

So basically Custom fields 0,1 (ALK) and 2,3 (CAL) will automatically reset to zero at midnight?

What about the ATO 4,5? Do I have to reset that manually?

Also, how do I get the Custom Fields to display in my portal webcharting?

Thanks for all your help!!!
Image
User avatar
lnevo
Posts: 5422
Joined: Fri Jul 20, 2012 9:42 am

Re: Dosing Pump not running on Schedule

Post by lnevo »

You have to use the links that i showed a while back in the thread. You can change the filter= to get the fields you want. Bookmark them to make it easy to retrieve.

To reset the 4 and 5 just disable the ato port from your phone and then remove the override and it should reset the counter.

Test that part and see if it resets properly.
kirkwood
Posts: 173
Joined: Mon Apr 29, 2013 6:50 am

Re: Dosing Pump not running on Schedule

Post by kirkwood »

lnevo wrote:To reset the 4 and 5 just disable the ato port from your phone and then remove the override and it should reset the counter.

Test that part and see if it resets properly.
I manually turned the ATO on via the droid app, then hit the green button to turn the ATO off. This did not reset the custom field counters. I also hit the Clear ATO button on the app and this also did not reset the fields.
Image
kirkwood
Posts: 173
Joined: Mon Apr 29, 2013 6:50 am

Re: Dosing Pump not running on Schedule

Post by kirkwood »

I also just took a look at the webcharting for the seconds fields 1 and 3. I expected to see the chart going from 0-60 repeatedly, however this was not the case. Just wondering.
Image
kirkwood
Posts: 173
Joined: Mon Apr 29, 2013 6:50 am

Re: Dosing Pump not running on Schedule

Post by kirkwood »

Also I just checked the before and after on custom fields 0,1 when my ALK pump ran on its scheduled cycle. The starting field values were 29 12. My pump runs for 290 seconds. The ending values were 34 4. That equals 292 seconds. Should I expect 100% precision? I'm not overly concerned as I'm just happy the values are very close and allow me to verify my pumps are running about what I expect them to in a given day.
Image
User avatar
lnevo
Posts: 5422
Joined: Fri Jul 20, 2012 9:42 am

Re: Dosing Pump not running on Schedule

Post by lnevo »

Its only going to send values every 5 minutes to the portal so its not going to be a smooth graph. It all depends on the state when the portal sends data.

As far as the ato can you try it again but wait the 5 minutes to make sure portal gets updated?

As far as 292 vs 290. I might be doing a slight bit of math wrong with < > or something like that. But thats pretty good. Keep in mind that the way the tjmer works is it starts when it detects the relay on and stops the timer when it sees that its off, but there may be a slight delay because its going through the loop and drawing screens and stuff so for now 290 vs 292 is pretty good :)

Let me look at it more closely and see what I can find
kirkwood
Posts: 173
Joined: Mon Apr 29, 2013 6:50 am

Re: Dosing Pump not running on Schedule

Post by kirkwood »

Yeah I'm happy with the values its producing, not trying to be picky. So let me know about whether I'm resetting the ATO values incorrectly because I haven't been able to get that to work.
Image
User avatar
lnevo
Posts: 5422
Joined: Fri Jul 20, 2012 9:42 am

Re: Dosing Pump not running on Schedule

Post by lnevo »

So the values are definitely not resettting? hmmm I guess I'll have to look at it closer. You'll have to give me some time to work on it.
User avatar
lnevo
Posts: 5422
Joined: Fri Jul 20, 2012 9:42 am

Re: Dosing Pump not running on Schedule

Post by lnevo »

kirkwood wrote:
lnevo wrote:To reset the 4 and 5 just disable the ato port from your phone and then remove the override and it should reset the counter.

Test that part and see if it resets properly.
I manually turned the ATO on via the droid app, then hit the green button to turn the ATO off. This did not reset the custom field counters. I also hit the Clear ATO button on the app and this also did not reset the fields.
Ok, I see what is happening.... the relay is normally off.. so when you hit the override your setting the ON bit, not the OFF, then you're clearing the ON bit so I'm not checking for that... I can change the code, but here's the thing...

I'd rather see the port masked off then on, but I'm not sure how the Android app works. Can you try turning it on, then off (not clearing the override) then once it's forced to off, then clear it.

We can change the checks to search that we're in an override ON position, but the point of it was, that when you saw you're ATO running toward the end, you could just set the port to override OFF and once you knew it was filled back up, then you could release the override and your ATO would operate as normal (assuming you also clear the ATO timeout if triggered...)

Anyway, please test that and let me know. I believe that should take care of it and we can easily change the check to look for the ON mask followed by the clear....
User avatar
lnevo
Posts: 5422
Joined: Fri Jul 20, 2012 9:42 am

Re: Dosing Pump not running on Schedule

Post by lnevo »

Here's the opposite logic, if you wanted to run with the procedure you described..

Code: Select all

if (bitRead(ReefAngel.Relay.RelayMaskOn, 6)==1) { // ATO relay was forced on
atoDisabled=true; // don't want to change the variable names yet.. but you may want to to make it clearer..
} 
if (atoDisabled && (bitRead(ReefAngel.Relay.RelayMaskOn, 6)==0)) { // ATO override has been cleared
pumpTimer[2]=0; // Clear timer for ATOPort
atoDisabled=false;
}
kirkwood
Posts: 173
Joined: Mon Apr 29, 2013 6:50 am

Re: Dosing Pump not running on Schedule

Post by kirkwood »

lnevo wrote:So the values are definitely not resettting? hmmm I guess I'll have to look at it closer. You'll have to give me some time to work on it.
Today is the first full day running the custom fields. I will let you know about 0,1,2,3 and what their values finish at tonight and whether they properly reset to zero at the end of the day.
Image
User avatar
lnevo
Posts: 5422
Joined: Fri Jul 20, 2012 9:42 am

Re: Dosing Pump not running on Schedule

Post by lnevo »

Please try what i said above as far as resetting the ato tracking...

On then off then clear override..
kirkwood
Posts: 173
Joined: Mon Apr 29, 2013 6:50 am

Re: Dosing Pump not running on Schedule

Post by kirkwood »

I used the new MaskOn logic and when I manually turned the ATO on and then off it cleared all the fields including the dosing pumps. So instead of just clearing field 4,5 it cleared 0,1,2,3,4,5.
Image
User avatar
lnevo
Posts: 5422
Joined: Fri Jul 20, 2012 9:42 am

Re: Dosing Pump not running on Schedule

Post by lnevo »

Are you sure about that? If you load new code it loses your log...it doesnt get saved anywhere..
User avatar
lnevo
Posts: 5422
Joined: Fri Jul 20, 2012 9:42 am

Re: Dosing Pump not running on Schedule

Post by lnevo »

Cause there are separate statements for clearing each field...
kirkwood
Posts: 173
Joined: Mon Apr 29, 2013 6:50 am

Re: Dosing Pump not running on Schedule

Post by kirkwood »

lnevo wrote:Are you sure about that? If you load new code it loses your log...it doesnt get saved anywhere..

Oh, I did not know about that. Thanks for bringing to my attention. I will let the ATO fields log some minutes of run time and then I will try to reset them.

Thanks.
Image
kirkwood
Posts: 173
Joined: Mon Apr 29, 2013 6:50 am

Re: Dosing Pump not running on Schedule

Post by kirkwood »

Just an FYI that my Port4 Calcium dosing pump ran for 340 seconds at 9pm. And fields 2 and 3 read 5 40. THAT IS EXACT!!!

nice work Inevo..
Image
User avatar
lnevo
Posts: 5422
Joined: Fri Jul 20, 2012 9:42 am

Re: Dosing Pump not running on Schedule

Post by lnevo »

Awesome.
kirkwood
Posts: 173
Joined: Mon Apr 29, 2013 6:50 am

Re: Dosing Pump not running on Schedule

Post by kirkwood »

So here is the result from today. Port 3 runs 58 minutes over the course of the day and fields 0and 1 read 58 24. Port 4 runs 68 minutes a day and fields 2 and 3 read 68 0. Wow that's good! Now let's see if they reset at midnight.

I tried clearing the auto today but it didn't work. If I mask the port on do I need to let it run at least 5 minutes to ensure the portal picks it up or does that not matter?
Image
User avatar
lnevo
Posts: 5422
Joined: Fri Jul 20, 2012 9:42 am

Re: Dosing Pump not running on Schedule

Post by lnevo »

No it *shouldn't* matter how long. as long as the function runs once and picks up the mask and then sees it change. It only looks at the masks because we dont' want it to reset every time the ato triggers... I'm lost as to why the resets not working.. we may need to figure out a way to debug it better. I'll have to see what I can play with on my end. It would be helpful if you could post your full code at some point. Maybe start a PDE thread in the My PDE/INO forum. It would probably help a lot of people, your doing cool stuff now :)
User avatar
lnevo
Posts: 5422
Joined: Fri Jul 20, 2012 9:42 am

Re: Dosing Pump not running on Schedule

Post by lnevo »

I know what is wrong!!!!!

I mixed up the usage of the Port7Bit.

The arg to bitRead should be the position from [0-7] so for Port7 use 6 instead of Port7Bit!
Post Reply