Page 1 of 1
DCPump Threshold coding
Posted: Mon May 18, 2015 3:12 pm
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.
Re: DCPump Threshold coding
Posted: Mon Jun 08, 2015 5:51 pm
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.
Re: DCPump Threshold coding
Posted: Tue Jun 09, 2015 8:02 am
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?
Re: DCPump Threshold coding
Posted: Tue Jun 09, 2015 10:52 am
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:
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
Re: DCPump Threshold coding
Posted: Tue Jun 09, 2015 11:43 am
by joshlawless
Super, super, super helpful! Thanks so much. This will make testing and configuration so much quicker and easier than I thought it would be!