RAGen issue new user/install

Community contributed apps
Post Reply
rufessor
Posts: 293
Joined: Tue Oct 25, 2011 7:39 am

RAGen issue new user/install

Post by rufessor »

Hi All-

I just got my new controller with the PWM expansion module and have jumped the required pins in the controller and powered up the expansion module. I have Audrino working and have very very slightly moded the pre-installed code (that I re-downloaded) so that it says Rufessor's Reef on the LCD instead of Demo (whatever it was). So I can change and install code. I had tried RAGen using the installation package and it failed, so I downloaded the executable (which is more like 530Kb not 350 kb as installed from the package) and that was working, but I was unsure of the scripts it was creating (they seemed to be pretty much missing all the code I was expecting) so I deleted the installation (using the remove application), reinstalled, and replaced with the executable (it failed again and I had to do this) but now the RAGen app cannot find or identify my controller on Com4, yet the Aurdino package comm is perfect over com4. I have removed and reinstalled a few times, rebotted, etc, yet it does not work. IT ALSO gives me an error whenever I attempt to generate a PDE file, so somehow it seems totally DOA other than the app opens. I hope this does not matter, since it worked at first (uncertain for sure, but it was getting COMM and making scripts, i.e. PDE files) but I am running under parrells 6 on a MacBook Pro using LION .

I tried to get things up purely with the apple stuff but decided I didn't know enough as nothing was working and RAGen seemed to be worth the effort of using parallels... help please.
rufessor
Posts: 293
Joined: Tue Oct 25, 2011 7:39 am

Re: RAGen issue new user/install

Post by rufessor »

Ok... some progress. I reset the registry and switched back to development libraries (always was using this but it defaults to std upon registry reset) and I can now generate a PDE... looking like this..


BUT I still cannot see the controller... on com4 through RAGen but still just fine in Arduino...odd.


selecting PWM, LED, WiFI (I dont have wifi yet but will be ordering so I figured I would play with it- but not add into PDE until I get module as I assume it will hang/choke on it without hardware)... is this what they are supposed to look like.. I was thinking not...

Code: Select all

// Autogenerated file by RAGen (v1.1.0.127), (01/01/2012 15:50)
// RA_010112_1550.pde
//
// This version designed for v0.8.5 Beta 17 or later

/* The following features are enabled for this PDE File: 
#define DisplayImages
#define WavemakerSetup
#define DateTimeSetup
#define VersionMenu
#define ATOSetup
#define MetalHalideSetup
#define DirectTempSensor
#define DisplayLEDPWM
#define wifi
#define StandardLightSetup
#define SaveRelayState
#define WDT
#define PWMEXPANSION
#define CUSTOM_MAIN
*/


#include <ReefAngel_Features.h>
#include <ReefAngel_Globals.h>
#include <ReefAngel_Wifi.h>
#include <Wire.h>
#include <OneWire.h>
#include <Time.h>
#include <DS1307RTC.h>
#include <ReefAngel_EEPROM.h>
#include <ReefAngel_NokiaLCD.h>
#include <ReefAngel_ATO.h>
#include <ReefAngel_Joystick.h>
#include <ReefAngel_LED.h>
#include <ReefAngel_TempSensor.h>
#include <ReefAngel_Relay.h>
#include <ReefAngel_PWM.h>
#include <ReefAngel_Timer.h>
#include <ReefAngel_Memory.h>
#include <ReefAngel.h>

void DrawCustomMain()
{
	// the graph is drawn/updated when we exit the main menu &
	// when the parameters are saved
	ReefAngel.LCD.DrawDate(6, 112);
	pingSerial();
#if defined DisplayLEDPWM && ! defined RemoveAllLights
	ReefAngel.LCD.DrawMonitor(15, 60, ReefAngel.Params,
		ReefAngel.PWM.GetDaylightValue(), ReefAngel.PWM.GetActinicValue());
#else // defined DisplayLEDPWM && ! defined RemoveAllLights
	ReefAngel.LCD.DrawMonitor(15, 60, ReefAngel.Params);
#endif // defined DisplayLEDPWM && ! defined RemoveAllLights
	pingSerial();
	byte TempRelay = ReefAngel.Relay.RelayData;
	TempRelay &= ReefAngel.Relay.RelayMaskOff;
	TempRelay |= ReefAngel.Relay.RelayMaskOn;
	ReefAngel.LCD.DrawOutletBox(12, 93, TempRelay);
}

void DrawCustomGraph()
{
	ReefAngel.LCD.DrawGraph(5, 5);
}


void setup()
{
    ReefAngel.Init();  //Initialize controller

    // Ports that are always on
    ReefAngel.Relay.On(Port8);
}

void loop()
{
    // Specific functions
    ReefAngel.StandardATO(Port1);
    ReefAngel.StandardLights(Port2);
    ReefAngel.MHLights(Port3);
    ReefAngel.Wavemaker1(Port4);
    ReefAngel.Wavemaker2(Port5);
    ReefAngel.StandardFan(Port6);
    ReefAngel.StandardHeater(Port7);

	ReefAngel.ShowInterface();
}
rimai
Posts: 12881
Joined: Fri Mar 18, 2011 6:47 pm

Re: RAGen issue new user/install

Post by rimai »

That looks good to me :)
Good job!!
Roberto.
rufessor
Posts: 293
Joined: Tue Oct 25, 2011 7:39 am

Re: RAGen issue new user/install

Post by rufessor »

Sorry... did you see that somehow the COM issue persists...
Else... looks like the RAGen is making the correct code. Now I need to figure out where to put it all inside the SImple_controller PDE file to get it all to work. A suggestion on com failure would be helpful. If there is a thread relevant to using the pieces generated by RAGen I would love a link.

I am confused about COM issue because it worked until I uninstalled, now fails yet Audrino is communicating with the controller now with no problem and has never had an issue.
rimai
Posts: 12881
Joined: Fri Mar 18, 2011 6:47 pm

Re: RAGen issue new user/install

Post by rimai »

You don't need to worry about RAGen "find controller"
That is just a helpful tool for troubleshooting and it doesn't mean much.
Integrating the RAGen code with the simple PDE is not possible.
But RAGen should provide you with a very similar resulkt though.
What do you think you are missing from the simple PDE that you are not getting from the RAGen code?
Roberto.
rufessor
Posts: 293
Joined: Tue Oct 25, 2011 7:39 am

Re: RAGen issue new user/install

Post by rufessor »

I probably should not even ask this as I clearly have only begun to put things together. But I am confused by comparing the simple control pde which has all the functionality to run the LCD as well as all else whereas the RAGEn code is basically a collection of declerations that would not apear to be fully functional as compared to the simple pde file which is mUch longer. I was thinking it neede to be pasted into the main code. but I really need to sit down and wrap my head arond this and get a feel for what interacts with waht etc.
rimai
Posts: 12881
Joined: Fri Mar 18, 2011 6:47 pm

Re: RAGen issue new user/install

Post by rimai »

Don't let the size fool you.
Behind the hood, it's an engine much more powerful than the simple code :)
Roberto.
rufessor
Posts: 293
Joined: Tue Oct 25, 2011 7:39 am

Re: RAGen issue new user/install

Post by rufessor »

Ok. So I guess I am confused. I have looked at the entire code that I generated with RAgen and have pasted above, but I see nothing to set up the PWM settings, could etc, I also dont see how it interacts with much in terms of getting pH, Temp, running schedules for the lights, for the feed mode, clean mode, etc etc. Confused as to what exactly I have generated and where to put it. Is it just that most of the stuff that I am looking to change has been moved to some other library type place and is no longer an integral part of the PDE. This seems totally wrong, I can see in your manual the test code for clouds/storms/etc and I thought I had seen people commenting that RAgen was doing this for them. I think its either not working or I am just really not yet clued into the organization, nothing in the RAGen code I pasted looks anything like the FAQ/tutorial on editing code as laid out in the simple PDE.

The code that I have pasted above is the ENTIRE bit generated by RAGen for me, or at least all I can see in the folder and with Aurdino.
wolfador
Posts: 241
Joined: Sun Sep 04, 2011 9:59 am
Location: Pittsburgh, PA

Re: RAGen issue new user/install

Post by wolfador »

rufessor wrote:Ok. So I guess I am confused. I have looked at the entire code that I generated with RAgen and have pasted above, but I see nothing to set up the PWM settings, could etc, I also dont see how it interacts with much in terms of getting pH, Temp, running schedules for the lights, for the feed mode, clean mode, etc etc. Confused as to what exactly I have generated and where to put it. Is it just that most of the stuff that I am looking to change has been moved to some other library type place and is no longer an integral part of the PDE. This seems totally wrong, I can see in your manual the test code for clouds/storms/etc and I thought I had seen people commenting that RAgen was doing this for them. I think its either not working or I am just really not yet clued into the organization, nothing in the RAGen code I pasted looks anything like the FAQ/tutorial on editing code as laid out in the simple PDE.

The code that I have pasted above is the ENTIRE bit generated by RAGen for me, or at least all I can see in the folder and with Aurdino.
Most of the predefined items like the feed mode and StandardLights are included in the libraries which get included in the first statements (#include)

I use a Macbook Air for all of my programming and just use Arduino and TextWrangler to modify the actual libraries.
John
ReefAngel and ReefAngel-HD developer
If the RA iOS app has helped please consider a donation
Image
rimai
Posts: 12881
Joined: Fri Mar 18, 2011 6:47 pm

Re: RAGen issue new user/install

Post by rimai »

It's all done automatically for you, except the PWM stuff.
So, all the code is hidden from you to make it much easier to understand what is going on.
Have tried loading the code you generated with RAGen and used the joystick to access the menu?
Now, the PWM stuff does indeed need to be added manually for now.
RAGen doesn't do that for you just yet.
Please read this post and let me know if you need help getting it together
http://forum.reefangel.com/viewtopic.php?f=12&t=288
Roberto.
rufessor
Posts: 293
Joined: Tue Oct 25, 2011 7:39 am

Re: RAGen issue new user/install

Post by rufessor »

Hi-

I did indeed try to load the code... however- I regenerated a new version and did not include WiFi.. so Iwill try again with the version I posted... but using the RAgen code that I did upload, the controller gave me an error message on the LCD and the power box (outlet/ATO switch/etc) went a bit nuts with relays (seemed like only 1) switching rapidly (probably as fast as it could). It would not stop so I quickly reloaded the simple PDE, I am assuming the relay is a power strip outlet/position coming on and off, but with the simple I get a click now and again and I do not see a change in the power status in the display (I assume this is the 1-7 at the bottom) so I am not entirely sure whats clicking. I am not currently working on this as I am trying to finish up the LED build, so don't worry about getting back quickly- unsure why the error on load to the controller. Since the PDE I see is obviously not the whole story its kinda hard to tell, and I am totally beginner/mod0 start from zero on this.

Just so you dont feel like this is going to be a black hole... I have quite a bit of system automation programming experience in Visual Basic for automating biological fermentation equipment (which is remarkably similar to what we do with our aquariums in many ways), so I do get most of whats being done, however, Aurdino is new and RAgen is a black box to me and the controller has been plugged in for about 5 hours so I am not feeling super in touch with how things work together at the moment. I will read more and play. I do like your code and the one you include in the PWM expansion manual as a starting point for LED dimming /effect. What I want to start on as a first true mod/coding project is left/right passage of clouds and sunrise/sunset effects as I have a left and right bank of LEDs... but lets not go there yet... must crawl, then walk, then attempt flying with the clouds. Anyhow, at least you know where I would like to get.
rimai
Posts: 12881
Joined: Fri Mar 18, 2011 6:47 pm

Re: RAGen issue new user/install

Post by rimai »

Yeah, that's the idea :)
Baby steps first.
The issue you were having with reallys firing rapidily was due to skipping one important step.
You need to initialize the internal memory at least once.
Using RAGen, go to menu Controller->Internal Memory and generate a internal memory PDE with your own settings and upload to RA.
Next time you upload any other PDE to RA, it will have known values to start working with.
Let me know if that works for you.
Roberto.
Post Reply