v0.9.0 Libraries

Related to the development libraries, released by Curt Binder
aranax
Posts: 120
Joined: Thu Jun 02, 2011 11:54 pm

Re: v0.9.0 Libraries

Post by aranax »

Hey guys,
I just updated (everything installed fine) but I'm having errors compiling. I ran the newest RAGen just to see the code then tried to verify the code RAGen created and I got this error:

Code: Select all

C:\Documents and Settings\jfolder\My Documents\Arduino\libraries\DS1307RTC\DS1307RTC.cpp: In static member function 'static void DS1307RTC::read(tmElements_t&)':
C:\Documents and Settings\jfolder\My Documents\Arduino\libraries\DS1307RTC\DS1307RTC.cpp:56: error: 'class TwoWire' has no member named 'write'
C:\Documents and Settings\jfolder\My Documents\Arduino\libraries\DS1307RTC\DS1307RTC.cpp:65: error: 'class TwoWire' has no member named 'read'
C:\Documents and Settings\jfolder\My Documents\Arduino\libraries\DS1307RTC\DS1307RTC.cpp:66: error: 'class TwoWire' has no member named 'read'
C:\Documents and Settings\jfolder\My Documents\Arduino\libraries\DS1307RTC\DS1307RTC.cpp:67: error: 'class TwoWire' has no member named 'read'
C:\Documents and Settings\jfolder\My Documents\Arduino\libraries\DS1307RTC\DS1307RTC.cpp:68: error: 'class TwoWire' has no member named 'read'
C:\Documents and Settings\jfolder\My Documents\Arduino\libraries\DS1307RTC\DS1307RTC.cpp:69: error: 'class TwoWire' has no member named 'read'
C:\Documents and Settings\jfolder\My Documents\Arduino\libraries\DS1307RTC\DS1307RTC.cpp:70: error: 'class TwoWire' has no member named 'read'
C:\Documents and Settings\jfolder\My Documents\Arduino\libraries\DS1307RTC\DS1307RTC.cpp:71: error: 'class TwoWire' has no member named 'read'
C:\Documents and Settings\jfolder\My Documents\Arduino\libraries\DS1307RTC\DS1307RTC.cpp: In static member function 'static void DS1307RTC::write(tmElements_t&)':
C:\Documents and Settings\jfolder\My Documents\Arduino\libraries\DS1307RTC\DS1307RTC.cpp:87: error: 'class TwoWire' has no member named 'write'
C:\Documents and Settings\jfolder\My Documents\Arduino\libraries\DS1307RTC\DS1307RTC.cpp:88: error: 'class TwoWire' has no member named 'write'
C:\Documents and Settings\jfolder\My Documents\Arduino\libraries\DS1307RTC\DS1307RTC.cpp:89: error: 'class TwoWire' has no member named 'write'
C:\Documents and Settings\jfolder\My Documents\Arduino\libraries\DS1307RTC\DS1307RTC.cpp:90: error: 'class TwoWire' has no member named 'write'
C:\Documents and Settings\jfolder\My Documents\Arduino\libraries\DS1307RTC\DS1307RTC.cpp:91: error: 'class TwoWire' has no member named 'write'
C:\Documents and Settings\jfolder\My Documents\Arduino\libraries\DS1307RTC\DS1307RTC.cpp:92: error: 'class TwoWire' has no member named 'write'
C:\Documents and Settings\jfolder\My Documents\Arduino\libraries\DS1307RTC\DS1307RTC.cpp:93: error: 'class TwoWire' has no member named 'write'
C:\Documents and Settings\jfolder\My Documents\Arduino\libraries\DS1307RTC\DS1307RTC.cpp:94: error: 'class TwoWire' has no member named 'write'
Can someone please help? Thanks.

-J
Image
rimai
Posts: 12881
Joined: Fri Mar 18, 2011 6:47 pm

Re: v0.9.0 Libraries

Post by rimai »

It seems you still have some old libraries remaining on your system.
I suggest you rename the folder libraries to some other name and either install the installer or use the update utility
Roberto.
psyrob
Posts: 247
Joined: Thu Sep 01, 2011 8:44 pm

Re: v0.9.0 Libraries

Post by psyrob »

I had the same error messages...I deleted EVERYTHING, RAGen I had to delete twice, and I still had to use the example code to upload an internal memory before I got it to work....patience and persistence...
Image
aranax
Posts: 120
Joined: Thu Jun 02, 2011 11:54 pm

Re: v0.9.0 Libraries

Post by aranax »

BTW...what happened to the storm code? I had remove it from my PDE to get it to fit but the menu option to mess with it is not in the "new" features.h file? Is that function no longer being supported? Thanks.

-J
Image
rimai
Posts: 12881
Joined: Fri Mar 18, 2011 6:47 pm

Re: v0.9.0 Libraries

Post by rimai »

The storm code was never in the features file.
Roberto.
projectx
Posts: 120
Joined: Sat Apr 23, 2011 6:53 pm

Re: v0.9.0 Libraries

Post by projectx »

What is the proper way to list the relay expansion ports in the lighting, feed mode etc?
Image
projectx
Posts: 120
Joined: Sat Apr 23, 2011 6:53 pm

Re: v0.9.0 Libraries

Post by projectx »

I think I figured it out
ReefAngel.FeedingModePorts = Port1Bit | Port3Bit;
ReefAngel.FeedingModePortsE[0] = Port3Bit | Port4Bit;
ReefAngel.WaterChangePorts = Port1Bit | Port3Bit | Port5Bit | Port7Bit | Port8Bit;
ReefAngel.WaterChangePortsE[0] = Port3Bit | Port4Bit;
ReefAngel.OverheatShutoffPorts = Port2Bit | Port4Bit | Port6Bit;
ReefAngel.LightsOnPorts = Port2Bit | Port4Bit | Box0_Port1 | Box0_Port2;
ReefAngel.LightsOnPortsE[0] = Port1Bit | Port2Bit | Port5Bit | Port6Bit;
Image
binder
Posts: 2871
Joined: Fri Mar 18, 2011 6:20 pm
Location: Illinois
Contact:

Re: v0.9.0 Libraries

Post by binder »

Yeah, that's "almost" right. You can only use PortXBit and not BoxX_PortY in them. So this line will not work properly:

Code: Select all

ReefAngel.LightsOnPorts = Port2Bit | Port4Bit | Box0_Port1 | Box0_Port2;
You will need to remove the Box0_Port1 & Box0_Port2 from the line.
projectx
Posts: 120
Joined: Sat Apr 23, 2011 6:53 pm

Re: v0.9.0 Libraries

Post by projectx »

This compiles without any errors, is this the proper way?
ReefAngel.FeedingModePorts = Port1Bit | Port3Bit;
ReefAngel.FeedingModePortsE[0] = Port3Bit | Port4Bit;
Image
lukeluke
Posts: 88
Joined: Mon Apr 04, 2011 4:12 am
Location: Rome, Italy

Re: v0.9.0 Libraries

Post by lukeluke »

binder wrote: [*]DosingPumpRepeat also has an offset from the run time now. So you can have your dosing pump run 5 minutes later if you like. This way you can have the pumps repeat every 4 hours and have one be 5 or 10 minutes later than the other, to prevent dosing at the same time.

Code: Select all

ReefAngel.DosingPumpRepeat(byte DPRelay, int OffsetMinute, int RepeatMinute, byte RunTime);
(This is not in RAGen)
the max repeat time is 4 hour ?
binder
Posts: 2871
Joined: Fri Mar 18, 2011 6:20 pm
Location: Illinois
Contact:

Re: v0.9.0 Libraries

Post by binder »

lukeluke wrote:the max repeat time is 4 hour ?
No. I was just using that as an example for repeat. The maximum number for repeat is 32767 minutes. That is well above 4 hours. It will work if you exceed 24 hours (1440 minutes).
binder
Posts: 2871
Joined: Fri Mar 18, 2011 6:20 pm
Location: Illinois
Contact:

Re: v0.9.0 Libraries

Post by binder »

projectx wrote:This compiles without any errors, is this the proper way?
ReefAngel.FeedingModePorts = Port1Bit | Port3Bit;
ReefAngel.FeedingModePortsE[0] = Port3Bit | Port4Bit;
Yeah, that's the "preferred" way with 0.9.X libraries. The reason is that it's more "human readable" and easier to understand. You could put it in terms of the 0's & 1's but that's just a little harder to read.
rimai
Posts: 12881
Joined: Fri Mar 18, 2011 6:47 pm

Re: v0.9.0 Libraries

Post by rimai »

int RepeatMinute variable can handle 32768 minutes.
Roberto.
rossbryant1956
Posts: 471
Joined: Sat Jan 14, 2012 2:08 pm
Location: Montgomery Village, MD

Re: v0.9.0 Libraries

Post by rossbryant1956 »

projectx wrote: ReefAngel.FeedingModePortsE[0] = Port3Bit | Port4Bit;
What is this syntax? E[0]

Haven't seen that before. Thx
Roscoe's Reefs - Starting Over Again:

Building new 29g Nano after landlord went berserk over my 4 75 gallon tanks, Multiple RA's, Water mixing stations, etc. Your help welcomed in remembering all I've forgotten.
rimai
Posts: 12881
Joined: Fri Mar 18, 2011 6:47 pm

Re: v0.9.0 Libraries

Post by rimai »

E[0] is for expansion relay box.
You can have E[0] through E[7] to set the ports of all other expansion boxes.
Roberto.
projectx
Posts: 120
Joined: Sat Apr 23, 2011 6:53 pm

Re: v0.9.0 Libraries

Post by projectx »

Great Thanks just did a few comparisons from the old to the new, just have to learn the code, I have found that Notepad++ is great for making it readable vs notepad
Image
binder
Posts: 2871
Joined: Fri Mar 18, 2011 6:20 pm
Location: Illinois
Contact:

Re: v0.9.0 Libraries

Post by binder »

projectx wrote:Great Thanks just did a few comparisons from the old to the new, just have to learn the code, I have found that Notepad++ is great for making it readable vs notepad
I love Notepad++ on windows. It works so much better than notepad. :)
projectx
Posts: 120
Joined: Sat Apr 23, 2011 6:53 pm

Re: v0.9.0 Libraries

Post by projectx »

So I have something thats amiss with my expansion relay. from the portal I am able to turn on n off my pumps, but with the new code they are not being turned on.
here is my INO file

// Autogenerated file by RAGen (v1.2.1.158), (02/20/2012 22:17)
// RA_022012_2217.ino
//
// This version designed for v0.9.0 or later

/* The following features are enabled for this File:
#define DirectTempSensor
#define wifi
#define RelayExp
#define InstalledRelayExpansionModules 1
#define SIMPLE_MENU
#define ENABLE_ATO_LOGGING
#define ENABLE_EXCEED_FLAGS
*/


#include <ReefAngel_Features.h>
#include <Globals.h>
#include <RA_Wifi.h>
#include <Wire.h>
#include <OneWire.h>
#include <Time.h>
#include <DS1307RTC.h>
#include <InternalEEPROM.h>
#include <RA_NokiaLCD.h>
#include <RA_ATO.h>
#include <RA_Joystick.h>
#include <LED.h>
#include <RA_TempSensor.h>
#include <Relay.h>
#include <RA_PWM.h>
#include <Timer.h>
#include <Memory.h>
#include <ReefAngel.h>


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

ReefAngel.FeedingModePorts = Port1Bit | Port3Bit;
ReefAngel.FeedingModePortsE[0] = Port3Bit | Port4Bit;
ReefAngel.WaterChangePorts = Port1Bit | Port3Bit | Port5Bit | Port7Bit | Port8Bit;
ReefAngel.WaterChangePortsE[0] = Port3Bit | Port4Bit;
ReefAngel.OverheatShutoffPorts = Port2Bit | Port4Bit | Port6Bit;
ReefAngel.LightsOnPorts = Port2Bit | Port4Bit | Box0_Port1 | Box0_Port2;
ReefAngel.LightsOnPortsE[0] = Port1Bit | Port2Bit | Port5Bit | Port6Bit;

// Ports that are always on
ReefAngel.Relay.On(Port3);
ReefAngel.Relay.On(Port5);
ReefAngel.Relay.On(Box0_Port3);
ReefAngel.Relay.On(Box0_Port4);
ReefAngel.Relay.On(Box0_Port7);
ReefAngel.Relay.On(Box0_Port8);
}

void loop()
{
// Specific functions
ReefAngel.SingleATOLow(Port1);
ReefAngel.StandardLights(Port2);
ReefAngel.StandardLights(Box0_Port1, 21, 0, 7, 0);
ReefAngel.StandardLights(Box0_Port2, 7, 0, 20, 0);
ReefAngel.MHLights(Box0_Port5);
ReefAngel.MHLights(Box0_Port6);
ReefAngel.MHLights(Port4);
ReefAngel.StandardHeater(Port6);
ReefAngel.DosingPump1(Port7);
ReefAngel.DosingPump2(Port8);
;

ReefAngel.ShowInterface();
}
Image
projectx
Posts: 120
Joined: Sat Apr 23, 2011 6:53 pm

Re: v0.9.0 Libraries

Post by projectx »

I have real problems now, my ATO is staying on all of the time, I stripped out all of the expansion box items as it started to happen when my moon lights (box0_port1) were scheduled to come on.

I repushed the code and it is still on, thankfully i was sitting there when it did it so i was able to pull the plug on the pump before I had a mess to clean up.

Any ideas?
Image
rimai
Posts: 12881
Joined: Fri Mar 18, 2011 6:47 pm

Re: v0.9.0 Libraries

Post by rimai »

The ATO is because your code is should use Box1_ instead of Box0_
Box0_ refers to the main relay box.
The Dosing pump is because there was a bug that was fixed today.
Please download the latest libraries using the update utility.
http://www.reefangel.com/update
It was a premature move to update the dosing pump code and I had to return back to the original code.
Roberto.
projectx
Posts: 120
Joined: Sat Apr 23, 2011 6:53 pm

Re: v0.9.0 Libraries

Post by projectx »

Ok I am getting the update now, odd, i stripped all of the code for the expansion out and it was still doing it.
Image
projectx
Posts: 120
Joined: Sat Apr 23, 2011 6:53 pm

Re: v0.9.0 Libraries

Post by projectx »

Thanks, that took care of it, and it also solved a few other things that i was fighting
Image
lukeluke
Posts: 88
Joined: Mon Apr 04, 2011 4:12 am
Location: Rome, Italy

Re: v0.9.0 Libraries

Post by lukeluke »

on your last library, 0.9.6 , you add the function:

SingleATOHighExtended(byte Relay);

i add it on my .ino and i compile it right.

I must modify the ATOHighTimeout .... how can i do ?

Can i use your java ReefAngel Status changing the variable from byte to int ? for example i want 10 minutes. Can i set on the location 842 the value INT 600 ?

Thanks

Bye
binder
Posts: 2871
Joined: Fri Mar 18, 2011 6:20 pm
Location: Illinois
Contact:

Re: v0.9.0 Libraries

Post by binder »

lukeluke wrote:on your last library, 0.9.6 , you add the function:

SingleATOHighExtended(byte Relay);

i add it on my .ino and i compile it right.

I must modify the ATOHighTimeout .... how can i do ?

Can i use your java ReefAngel Status changing the variable from byte to int ? for example i want 10 minutes. Can i set on the location 842 the value INT 600 ?
First, I haven't made a post about the new functions and how to use them, so that's my fault.

Second, here's your answer. You can use those functions instead of the regular ones. The extended functions use different memory locations that the standard ones. The reason is the extended ato functions use INT variables and not BYTE variables. Here's the memory locations for the new functions:

Code: Select all

Mem_I_ATOExtendedTimeout   876
Mem_I_ATOHighExtendedTimeout  878
You can use the java status to update the values. For the ATOHighExtended function, you will use 878 for the location and the value is an INT and set it to 600.
lukeluke
Posts: 88
Joined: Mon Apr 04, 2011 4:12 am
Location: Rome, Italy

Re: v0.9.0 Libraries

Post by lukeluke »

ok Curt.

thanks a lot .

you are the best ;-) :-P
Mike S
Posts: 82
Joined: Tue Dec 27, 2011 7:26 pm

Re: v0.9.0 Libraries

Post by Mike S »

I thought I read/heard somewhere alone the way that there was an update coming to the libraries soon. Is that the case? I'm getting reading to setup the RA+, add a dosing pump, and make a few other changes, but figured I'd hold off if a library update was coming soon. Thanks!
rimai
Posts: 12881
Joined: Fri Mar 18, 2011 6:47 pm

Re: v0.9.0 Libraries

Post by rimai »

Libraries updates will always be released. We are constantly evolving the code and it is thanks to you all that make this project move forward. Some bugs can only be found in a real environment.
There is also always request for new functions and such, so don't hold off on an update or you will be holding off for a very long time as there will always be another one coming up :)
Roberto.
binder
Posts: 2871
Joined: Fri Mar 18, 2011 6:20 pm
Location: Illinois
Contact:

Re: v0.9.0 Libraries

Post by binder »

Yeah, like Roberto said, there's always updates coming out. So don't hold off "playing" just because you are waiting for another update. :)
Mike S
Posts: 82
Joined: Tue Dec 27, 2011 7:26 pm

Re: v0.9.0 Libraries

Post by Mike S »

Thanks guys. I worked up some new code and took a stab at installing the RA+ board this morning. Had some oddball stuff going on. My moonlights started to turn on and off and my leds didn't seem to be reading the internal memory settings. I ended up putting the old board back in until I have time to trouble shoot it. I'll be back with questions. :)
Mike S
Posts: 82
Joined: Tue Dec 27, 2011 7:26 pm

Re: v0.9.0 Libraries

Post by Mike S »

rimai wrote:E[0] is for expansion relay box.
You can have E[0] through E[7] to set the ports of all other expansion boxes.
Does E[0] automatically refer to the first relay expansion box or does it need reference the ID that is set up using the expansion module dip switches?
Post Reply