DCPump Threshold coding

Do you have a question on how to do something.
Ask in here.
Post Reply
User avatar
joshlawless
Posts: 138
Joined: Thu May 23, 2013 2:52 pm

DCPump Threshold coding

Post by joshlawless »

I tried and tried to implement a high threshold for my DCPump code (Sine, 240 seconds, to 100%). The only way I could get it to work was to turn off internal memory:

Code: Select all

    ReefAngel.DCPump.UseMemory = false;  // Return pump mode and settings handled by internal memory location
    ReefAngel.DCPump.Threshold = 50;
Because I couldn't find anywhere in either the U-app or the Portal to change the value of the threshold in internal memory. Am I missing something? I'm using the 1.1.1 libraries.
AlanM
Posts: 263
Joined: Wed Jan 01, 2014 7:26 am

Re: DCPump Threshold coding

Post by AlanM »

joshlawless wrote:I tried and tried to implement a high threshold for my DCPump code (Sine, 240 seconds, to 100%). The only way I could get it to work was to turn off internal memory:

Code: Select all

    ReefAngel.DCPump.UseMemory = false;  // Return pump mode and settings handled by internal memory location
    ReefAngel.DCPump.Threshold = 50;
Because I couldn't find anywhere in either the U-app or the Portal to change the value of the threshold in internal memory. Am I missing something? I'm using the 1.1.1 libraries.
Just saw no one had ever answered this. You either use internal memory or you don't. The threshold is stored in internal memory, so if you say that you're using memory it will ignore the threshold you set in your loop. If you're using internal memory, you'd have to set the threshold to something in internal memory. It remembers the value you set permanently even between reboots, and I believe the default is 30 percent. You can set it permanently to 50 percent with your web browser by going to

http://ip address:2000/mb164,50

It's at memory location 164. All of the locations are in Globals.h, by the way, and the functions to read and write them are in InternalEEPROM.cpp.

Don't put an internal memory write in your loop, by the way. Those locations can only be rewritten so many times before they fail. Putting it in your setup should be fine, though.
User avatar
joshlawless
Posts: 138
Joined: Thu May 23, 2013 2:52 pm

Re: DCPump Threshold coding

Post by joshlawless »

AlanM wrote:Just saw no one had ever answered this. You either use internal memory or you don't. The threshold is stored in internal memory, so if you say that you're using memory it will ignore the threshold you set in your loop. If you're using internal memory, you'd have to set the threshold to something in internal memory. It remembers the value you set permanently even between reboots, and I believe the default is 30 percent. You can set it permanently to 50 percent with your web browser by going to

http://ip address:2000/mb164,50
This is incredibly helpful -- I did not know there was a way to write to internal memory just with an http request.
AlanM wrote:All of the locations are in Globals.h, by the way, and the functions to read and write them are in InternalEEPROM.cpp.
I've browsed these two files, but I note that there is no reference to the memory location of CustomVar[n] -- do you happen to know where in internal memory these are stored?
binder
Posts: 2871
Joined: Fri Mar 18, 2011 6:20 pm
Location: Illinois
Contact:

Re: DCPump Threshold coding

Post by binder »

joshlawless wrote: I've browsed these two files, but I note that there is no reference to the memory location of CustomVar[n] -- do you happen to know where in internal memory these are stored?
they are not stored in internal memory. they are initialized at runtime and only last as long as the controller is running (unless you code something to be saved).
instead of having you search around for it elsewhere (i know it's located on here but i don't recall where), here's the commands for the custom variables:

Code: Select all

/cvar#,VV
 - /cvar is the prefix
 - # - the variable number from 0-7
 - VV - the value to be pushed/set

so that's:  http://ip address:2000/cvar#,VV
here's an example. say you want to set custom variable 3 to be 10, you would issue this:

Code: Select all

http://ip address:2000/cvar2,10
of course the array starts at 0, so things are off by 1.
this is exactly how all of our apps function.


here's also a reference to all the wifi commands available. this topic is discussed there too:
http://forum.reefangel.com/viewtopic.ph ... 41&p=12034
User avatar
joshlawless
Posts: 138
Joined: Thu May 23, 2013 2:52 pm

Re: DCPump Threshold coding

Post by joshlawless »

binder wrote:here's also a reference to all the wifi commands available. this topic is discussed there too:
http://forum.reefangel.com/viewtopic.ph ... 41&p=12034
Super, super, super helpful! Thanks so much. This will make testing and configuration so much quicker and easier than I thought it would be!
Post Reply