Explain internal memory

Basic / Standard Reef Angel hardware
Post Reply
GermanDude
Posts: 82
Joined: Tue Dec 27, 2016 6:26 am
Location: Jacksonville,FL

Explain internal memory

Post by GermanDude »

Hello everybody,
could someone please explain in simple terms the internal memory?
I have been uploading the newbee way from the wizard. I would like to try internal memory. I know you can change the variables from your iPhone or web portal using internal memory, but how do I code for it? leave all variables out?

Just a tad clueless.

Thanks,
-James-

Image
Diverjoe
Posts: 26
Joined: Thu Nov 24, 2016 7:19 am

Re: Explain internal memory

Post by Diverjoe »

I'm pretty new myself. Been up and running about a month freshwater so not as complicated but doing some things similarly. But to take a stab at your question that is exactly what I found and am doing. Here is a link to a great overview someone did that helped me out tremendously. He answers your question in part two. Btw noticed from banner you have a water level. If true be certain to use some silicone or something to seal around the hose I didn't and fought slow leaks until I did now the reading is rock solid.

http://forum.reefangel.com/viewtopic.php?f=14&t=3353
GermanDude
Posts: 82
Joined: Tue Dec 27, 2016 6:26 am
Location: Jacksonville,FL

Re: Explain internal memory

Post by GermanDude »

Thanks, that helped some.
I have coded some before using the Arduino and Particle Photon boards. It is the internal memory concept that is foggy to me.
I do not use a water level but I will keep that in mind for the future.

Still open for more explanations. :-)
-James-

Image
rimai
Posts: 12857
Joined: Fri Mar 18, 2011 6:47 pm

Re: Explain internal memory

Post by rimai »

Internal memory will let you adjust settings without having to upload a new code to the controller.

Code: Select all

ReefAngel.StandardHeater( T1_PROBE,Port5,735,780 );
For example, in this code above, the heater is set to 73.5 and 78.0.
If you decided to change the temperature you want the heater to operate, you would have to edit the code and upload to the controller again.

Code: Select all

ReefAngel.StandardHeater( Port5 );
The code above would use settings store in internal memory, which does not get erased on power loss, to operate the heater. So, if you have 73.5 and 78.0 stored in the internal memory and decided to change the upper temperature to 77.0, you can simply change the internal memory value from 78.0 to 77.0 and the controller would do its thing and you don't need to upload any code.
Roberto.
GermanDude
Posts: 82
Joined: Tue Dec 27, 2016 6:26 am
Location: Jacksonville,FL

Re: Explain internal memory

Post by GermanDude »

Ok, I get that.
Question, do I have to initialize the internal memory or is it already setup? I found the initialInternalmemory example in the Arduino program that made me think about it.
Once internal memory is loaded, can I still load hardcoded files or do I have to use the wizard and only write code for internal memory?
-James-

Image
binder
Posts: 2865
Joined: Fri Mar 18, 2011 6:20 pm
Location: Illinois
Contact:

Re: Explain internal memory

Post by binder »

GermanDude wrote:Ok, I get that.
Question, do I have to initialize the internal memory or is it already setup? I found the initialInternalmemory example in the Arduino program that made me think about it.
Yes, you must initialize the internal memory with the values you want to use before you load your regular code. Otherwise if you load the code that uses the internal memory, you will get erratic or strange behavior because the code will use whatever was in the memory.
Once internal memory is loaded, can I still load hardcoded files or do I have to use the wizard and only write code for internal memory?
You do not always have to use internal memory in your code. You are free to use internal memory or hard coded values. Sometimes, you know you will always use a specific value for something. That is fine, just hard code it. Otherwise, if you use internal memory, you will have the capability of changing the value without having to reload your code.

Bottom line is this. Internal memory gives you the ability to change values/ranges/etc on the controller without having to reload your code. So it could be a benefit for you. Most people use internal memory.

Some people who are trying to "dial in" a specific value or frequency will use internal memory because they can change the values on-the-fly. If they did not, they would have to edit the code and upload a new code each time they make a small change. Which can be a big pain in the butt if you don't know exactly what values you need to use.
GermanDude
Posts: 82
Joined: Tue Dec 27, 2016 6:26 am
Location: Jacksonville,FL

Re: Explain internal memory

Post by GermanDude »

So, I already have a hardcoded program running that I created with the webwizard. What happens if I load the initialinternalmemory from the arduino program? Will it wipe the screen setup and all my existing code?
I am wondering if not initializung the internal memory has anything to do with the RA+ rebooting when I try to use the webased Uapp? I have been working with Robert on that issue and he has not been able to duplicate it on his end. See the cloud wifi rebooting thread I started.
Or maybe I am way of base. :-)
-James-

Image
GermanDude
Posts: 82
Joined: Tue Dec 27, 2016 6:26 am
Location: Jacksonville,FL

Re: Explain internal memory

Post by GermanDude »

When I first received the RA+ and the wifi cloud module I setup the wifi cloud using the webwizard with no problem.
I then used the webwizard to write my first setup and it did change the way the screen looks. Better actually.
The underlying menus you get when you push the joystick down stayed the same.
Was that the correct way to get started? Everything is running fine. I have since changed my code a few times and uploaded.
The only issue I have is the rebooting with the web based Uapp.
-James-

Image
binder
Posts: 2865
Joined: Fri Mar 18, 2011 6:20 pm
Location: Illinois
Contact:

Re: Explain internal memory

Post by binder »

GermanDude wrote:So, I already have a hardcoded program running that I created with the webwizard. What happens if I load the initialinternalmemory from the arduino program? Will it wipe the screen setup and all my existing code?
I am wondering if not initializung the internal memory has anything to do with the RA+ rebooting when I try to use the webased Uapp? I have been working with Robert on that issue and he has not been able to duplicate it on his end. See the cloud wifi rebooting thread I started.
Or maybe I am way of base. :-)
Yes, anytime you load the initialinternalmemory onto the controller, it will erase your code that is running. You typically only load the initialinternalmemory once. After you have all the memory locations initialized, then you can update them from portal or one of the smart phone apps.

I'm not sure if not initializing the memory has anything to do with the rebooting when using the uapp. It might depending on if the uapp depends on reading a memory value and it gets an erroneous value instead. However, I do not believe this to be the case. You could load the initialinternalmemory pde file and then load your code back onto the controller to test though.
When I first received the RA+ and the wifi cloud module I setup the wifi cloud using the webwizard with no problem.
I then used the webwizard to write my first setup and it did change the way the screen looks. Better actually.
The underlying menus you get when you push the joystick down stayed the same.
Was that the correct way to get started? Everything is running fine. I have since changed my code a few times and uploaded.
The only issue I have is the rebooting with the web based Uapp.
That sounds like you did things properly. I know when you use the wizard to create your code, it walks you through what you are supposed to do. I know it loads the internal memory initialization and then has you load your code. So the process is combined. As long as you followed with what the wizard said and your controller is/was operational, then you did things properly.
I am puzzled with what is going on with the uapp. There is the possibility that it could be something related to the wifi cloud module. I am not familiar with the wifi cloud module and how it works (I just haven't bothered looking into it yet). So I am unable to comment on it.
There could be multiple things that could be causing the rebooting problem unfortunately.
GermanDude
Posts: 82
Joined: Tue Dec 27, 2016 6:26 am
Location: Jacksonville,FL

Re: Explain internal memory

Post by GermanDude »

Yes, the controller is setup correctly,I agree. I can store variables (like temp or port delay) in internal memory.
My hard coded settings however will override my settings during each void loop I assume. So best practice would be to leave the hard-coded settings like temp,delay,feeding timer out of the code, correct?
So far I am only using the portal and Dave Molton`s application to change my internal settings.
-James-

Image
binder
Posts: 2865
Joined: Fri Mar 18, 2011 6:20 pm
Location: Illinois
Contact:

Re: Explain internal memory

Post by binder »

I actually have all my values stored in internal memory. I don't have any hard-coded values. I like the ability to be able to change them if I ever needed to without reloading my code.

however, if everything is working well with your setup, I would say to leave it alone and not mess with anything unless you wanted to.

Sent from my XT1585 using Tapatalk
GermanDude
Posts: 82
Joined: Tue Dec 27, 2016 6:26 am
Location: Jacksonville,FL

Re: Explain internal memory

Post by GermanDude »

Agreed.
I have been playing around with saving settings in code and in memory. I am still trying to figure out why my RA reboots when I use the web app.

Other than that I really like the RA.
-James-

Image
jcjrogers
Posts: 66
Joined: Fri May 05, 2017 11:27 am

Re: Explain internal memory

Post by jcjrogers »

A new question for an old thread... I'm new and have loaded my Webwizard code "in the code" instead of internal memory. The controller shows different parameters than what I put in the code. Some questions:

1. Does my loaded code override whatever is in internal memory?
2. Does the information shown in the Portal and Uapp depict what is in the code or internal memory (relays and such)?
3. Does making a change in internal memory override the code? In other words, if I'm running off code and changed a parameter in internal memory and saved it, will that affect my code?
4. If internal memory interferes with code, is there a way to turn-off?
5. When I decide to convert to internal memory, is there a way to do without re-running the Wizard as re-running the Wizard appears to overwrite any edited or added code?
rimai
Posts: 12857
Joined: Fri Mar 18, 2011 6:47 pm

Re: Explain internal memory

Post by rimai »

Internal memory are a special section of the non volatile memory.
It will get changed only if your code has instructions to do so.
Loading a nornal code will not change it.
The info on the Portal an uApp represent what's in that special area.
The code is loaded into another type of memory.
The controller has 2 types of memories.
Flash: where code resides
EEPROM: where settings resides
If you generate a code with hard coded settings, it will just ignore the internal memory settings. You can change them on any app, but your code will not use them.
If you use internal memory, the controller will use those settings and if you change them in the app, the controller will start using this newly updated settings that you just changed.
Yes, this is the way you can load one code and not have to rerun the wizard to change any settings.
Roberto.
jcjrogers
Posts: 66
Joined: Fri May 05, 2017 11:27 am

Re: Explain internal memory

Post by jcjrogers »

Good explanation. It also appears that the small screen on the controller references internal memory and isn't changed by loading normal code. Also, if I want to see which relays are on/off, water level, or anything other than temperature, pH, salinity, etc., it looks like I need to use internal memory. Are both of these assumptions correct?

Lastly, my PC is right next to where I'm going to locate the controller. Since all of this is cloud based (Webwizard, Uapp, and Portal), is there a way to bypass the Cloud Wifi altogether, assuming the USB-TTL cable is always plugged-in to the PC and controller?
rimai
Posts: 12857
Joined: Fri Mar 18, 2011 6:47 pm

Re: Explain internal memory

Post by rimai »

can you post screen of what you are talking about the RA screen?
Roberto.
jcjrogers
Posts: 66
Joined: Fri May 05, 2017 11:27 am

Re: Explain internal memory

Post by jcjrogers »

rimai wrote:can you post screen of what you are talking about the RA screen?
I'm talking about the screen on the controller itself that looks about the size of a large postage stamp. For instance, the light on/off times don't match my code. There are several things in my code that don't show. I could take a picture but don't know if you would really be able to see it. I don't know that I would ever use this. I'm just trying to figure what code will actually run. I haven't hooked anything up yet except the temperature probe as the tank doesn't even have water. I'm just trying to get my ducks in a row before I go live.
rimai
Posts: 12857
Joined: Fri Mar 18, 2011 6:47 pm

Re: Explain internal memory

Post by rimai »

Exactly that.
We have two different user interfaces.
If you move the joystick to the right or left, does it change anything?
Roberto.
jcjrogers
Posts: 66
Joined: Fri May 05, 2017 11:27 am

Re: Explain internal memory

Post by jcjrogers »

Yes, the joystick changes the screen and changes parameters. The problem is, what shows doesn't match my code. It looks like some sort of defaults. For instance, the heater shows on-76.6 and off-77.0. However, in my code I put on-76 and off-80 for two separate heaters (planning to use the heater controllers to hold the temp and use the RA relays as failsafes). I have multiple lighting schedules in my code for LED's, T5's, and refugium, but none of those match the one schedule that shows on the controller's screen.

Now, I didn't save my settings to Internal Memory. I'm just trying to figure out if the controller's screen can only show internal memory parameters or if the parameters showing on screen are really what the controller will carry-out. If that is what the controller is going to carry-out, it doesn't match what I entered into the Webwizard and loaded to the controller.
rimai
Posts: 12857
Joined: Fri Mar 18, 2011 6:47 pm

Re: Explain internal memory

Post by rimai »

The controller will show whatever is in the memory. If you hard coded, I mentioned above that those settings will be ignored.
It will use whatever your code instructed it to do.
If you use internal memory settings, it will use those settings and they should match to what the portal and app settings show too, because they are going to pull the settings from the RA memory.
Roberto.
jcjrogers
Posts: 66
Joined: Fri May 05, 2017 11:27 am

Re: Explain internal memory

Post by jcjrogers »

rimai wrote:The controller will show whatever is in the memory. If you hard coded, I mentioned above that those settings will be ignored.
It will use whatever your code instructed it to do.
If you use internal memory settings, it will use those settings and they should match to what the portal and app settings show too, because they are going to pull the settings from the RA memory.
I read your post above, just didn't follow how that related to what is displayed on the controller itself. I've got it now. Thanks!
Post Reply