Libraries v0.8.5.17

Related to the development libraries, released by Curt Binder
Post Reply
binder
Posts: 2865
Joined: Fri Mar 18, 2011 6:20 pm
Location: Illinois
Contact:

Libraries v0.8.5.17

Post by binder »

I just released the latest version of the libraries: v0.8.5.17

There has been lots of fixes and changes made to this release. You WILL want to look over the change list and plan accordingly. There are several changes that will affect people. The most notable changes are:
  • MoonPhase() added to the globals file - For those people who manually added the function to their PDE file, you can safely remove the function definition from your PDE file. You can still use the function, you just don't have to add the entire function.
  • CovertNumToString() added to the globals file - Same comment/note as with MoonPhase()
  • Feature PWMExpansionRelay is changed to just be PWMExpansion - for better and more logical reading in the code as to what it does.
  • DelayedOn is not part of the Relay class - Currently, if you use the DelayedOn function, you would call it ReefAngel.DelayedOn(Port, Delay). Now, it's moved to the relay class to make it more logical (like with the On & Off functions). So now, you call it this way

    Code: Select all

    ReefAngel.Relay.DelayedOn(Port, Delay);
These are the most important and notable fixes/changes. They will be causing some compiling errors if you don't read this.

The rest of the significant changes are here:
  • Faulty temp sensor check
  • Display an error when the temp sensor reads 0 and not when PWM displays 0
  • Added in unknown request handling via wifi
  • Handle HTTP feedback from external servers
  • Wifi response fixes
  • Fixed setting date & time via wifi
  • Fixed SaveRelayState compilation error
  • Ability to change the overheat temp monitoring probe from temp2 to whatever temp you want. This is handled inside the setup() function. The default is to use temp2 probe, but if you want to change it, use one of these lines:

    Code: Select all

    // To use Temp1, add this line to setup():
    ReefAngel.OverheatTempProbe = &ReefAngel.Params.Temp1;    
    // To use Temp3, add this line to setup():
    ReefAngel.OverheatTempProbe = &ReefAngel.Params.Temp3;
    This has to be called after ReefAngel.Init(); otherwise it will not work.
  • Added in flag storing for exceeded values (with ATO Timeout & Overheat Temp) - You can now distinguish what event caused the red LED to turn on. This must be enabled inside the features file to work. Use this line to enable it:

    Code: Select all

    #define ENABLE_EXCEED_FLAGS
    Once enabled, you will have to manually check to see what event triggered the red LED. This is done by reading the internal memory. It is designed to be incorporated into a custom main screen but can be put into a menu or queried manually via the wifi interface. Here's the commands to read it from memory on the controller:

    Code: Select all

    // Check for ATO (byte, location 748)
    InternalMemory.read(ATO_Exceed_Flag);
    // Check for Single ATO (byte, location 747)
    InternalMemory.read(ATO_Single_Exceed_Flag);
    // Check for Overheat (byte, location 749)
    InternalMemory.read(Overheat_Exceed_Flag);
    
    You can use any of the checks. The ATO check is for the standard ato. The ATO Single check is for the single ato functions (no distinction currently for high or low ato). The Overheat check is for the overheat temp checks.
  • ATO Event logging added - This will be able to log the last 4 ato events (either standard or single). If using single ato, it will log the low and high events separately. If the events are not cleared out (by querying the controller), the oldest event is cleared first and so forth in a cyclic manner. This is enabled with the following line inside your features file:

    Code: Select all

    #define ENABLE_ATO_LOGGING
    You can then query the controller for the standard relay status plus the ato logging events with this command, /sa, instead of the typical /r99 command.
  • Custom Menu Creation added - You can now create a custom menu from within your PDE file. The menu is only a single menu (like SIMPLE_MENU) but can be customized as you desire. There are several things that you must enable in the features file and add to you PDE file. A guide has been created and a separate topic will be created for how to enable and use a custom menu. Here's a link to the guide:
    http://curtbinder.info/ragen/docs/RA_Custom_Menu.pdf
As with all the new features, please be sure to read the features file posted on my github account (https://github.com/curtbinder/ReefAngel ... Features.h) for full explanations and details of the features. There is often more details there than what is posted on the forum.

You can update with the Update utility (recommended for simplicity), manually update the libraries by downloading them or by running the RAGen installer and updating the libraries.

curt
User avatar
Xender
Posts: 105
Joined: Sun Mar 20, 2011 12:38 am
Location: France

Re: Libraries v0.8.5.17

Post by Xender »

Cool thanks !
Fresh Water Aquarium 180*60*80
Salt Water Aquarium 60*60*60
Click Here to see the Video of my Fresh Water Aquarium
Image
wolfador
Posts: 241
Joined: Sun Sep 04, 2011 9:59 am
Location: Pittsburgh, PA

Re: Libraries v0.8.5.17

Post by wolfador »

just updated, everything appears to be working fine. Was also able to merge my custom changes with no problems. Thanks Curt!
John
ReefAngel and ReefAngel-HD developer
If the RA iOS app has helped please consider a donation
Image
sjmusic2
Posts: 33
Joined: Sun Sep 25, 2011 8:25 pm

Re: Libraries v0.8.5.17

Post by sjmusic2 »

Hi Curt,

Tried the new release and I get errors (attached)

This is my code...I commented out the ConvertNumToString as mentioned in your post, but I think I did something wrong ???

Code: Select all

/* The following features are enabled for this PDE File: 
#define DateTimeSetup
#define VersionMenu
#define DirectTempSensor
#define StandardLightSetup
#define SaveRelayState
*/

#include <ReefAngel_Colors.h>
#include <ReefAngel_CustomColors.h>
#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 ConvertNumToString(char* string, int num, byte decimal)
{
char temptxt[3];
int Temp = num;
if (Temp==0xFFFF) Temp=0;
itoa(Temp/decimal,string,10);
if (decimal>1)
{
itoa(Temp%decimal,temptxt,10);
strcat(string, ".");
if (Temp%decimal<10 && decimal==100) strcat(string, "0");
strcat(string, temptxt);
}
}
*/

void DrawCustomMain()
{
byte x = 6;
byte y = 2;
ReefAngel.LCD.DrawDate(6, 2);
ReefAngel.LCD.Clear(COLOR_BLACK, 1, 11, 132, 11);
x = 14;
y += MENU_START_ROW+1;
char text[7];
ConvertNumToString(text, ReefAngel.Params.PH, 100);
ReefAngel.LCD.Clear(DefaultBGColor, x+16, y, x+45, y+16);
ReefAngel.LCD.DrawLargeText(COLOR_SEAGREEN, DefaultBGColor, 12, 52, "pH :",
Font8x8);
ReefAngel.LCD.DrawLargeText(COLOR_GREEN, DefaultBGColor, 56, 48, text,
Font8x16);
ConvertNumToString(text, ReefAngel.Params.Temp1, 10);
y += MENU_START_ROW*2;
x = 10;
ReefAngel.LCD.Clear(DefaultBGColor,x,y,x+(16*4),y+16);
ReefAngel.LCD.DrawHugeNumbers(COLOR_INDIGO, DefaultBGColor, 56, 20, text);
ReefAngel.LCD.DrawText(COLOR_MIDNIGHTBLUE, DefaultBGColor, 12, 24, "Tank :");
x += (16*4) + 8;
ReefAngel.LCD.DrawText(T2TempColor,DefaultBGColor, 12, 74, "LED Array :");
ReefAngel.LCD.DrawSingleMonitor(ReefAngel.Params.Temp2, T2TempColor,
95, 74, 10);
ReefAngel.LCD.DrawText(T3TempColor,DefaultBGColor, 12, 90, "Ambient Air :");
ReefAngel.LCD.DrawSingleMonitor(ReefAngel.Params.Temp3, T3TempColor,
95, 90, 10);
byte TempRelay = ReefAngel.Relay.RelayData;
TempRelay &= ReefAngel.Relay.RelayMaskOff;
TempRelay |= ReefAngel.Relay.RelayMaskOn;
ReefAngel.LCD.DrawOutletBox(12, 106, TempRelay);
}
void DrawCustomGraph()
{
}

void setup()
{
    ReefAngel.Init();  //Initialize controller
    ReefAngel.PHMin=482;
    ReefAngel.PHMax=832;
    ReefAngel.FeedingModePorts = B10001100;
    ReefAngel.WaterChangePorts = B10111101;
    ReefAngel.OverheatShutoffPorts = B00000000;
    ReefAngel.LightsOnPorts = B00000010;

    // Ports that are always on
    ReefAngel.Relay.On(Port1);
    ReefAngel.Relay.On(Port3);
    ReefAngel.Relay.On(Port4);
    ReefAngel.Relay.On(Port5);
    ReefAngel.Relay.On(Port6);
    ReefAngel.Relay.On(Port8);
}

void loop()
{
    ReefAngel.ShowInterface();

    // Specific functions
    //ReefAngel.StandardLights(Port, OnHour, OnMinute, OffHour, OffMinute);
    ReefAngel.StandardLights(Port2);
    ReefAngel.StandardHeater(Port7);
 }
As always, thanks for your help.

Simon
Attachments
RA errors.jpg
RA errors.jpg (51.89 KiB) Viewed 8798 times
binder
Posts: 2865
Joined: Fri Mar 18, 2011 6:20 pm
Location: Illinois
Contact:

Re: Libraries v0.8.5.17

Post by binder »

Wow. That's all I have to say.

You found a bug that has existed since 0.8.5.15. I accidentally introduced it when I moved some of the strings to program memory to help with the code size and RAM usage. I think I've got a fix for it. I have to test it first though.

If you can, I would suggest enabling SIMPLE_MENU and using it initially to get things working again for you.

curt
User avatar
Xender
Posts: 105
Joined: Sun Mar 20, 2011 12:38 am
Location: France

Re: Libraries v0.8.5.17

Post by Xender »

I still have "Please loading..." on the http web page.
But my Iphone App is working great !
Fresh Water Aquarium 180*60*80
Salt Water Aquarium 60*60*60
Click Here to see the Video of my Fresh Water Aquarium
Image
binder
Posts: 2865
Joined: Fri Mar 18, 2011 6:20 pm
Location: Illinois
Contact:

Re: Libraries v0.8.5.17

Post by binder »

I may have another fix for the web/wifi stuff. I'm trying to narrow things down as to what the problem is. Still working on it though.

curt
User avatar
Xender
Posts: 105
Joined: Sun Mar 20, 2011 12:38 am
Location: France

Re: Libraries v0.8.5.17

Post by Xender »

ok thanks !
Fresh Water Aquarium 180*60*80
Salt Water Aquarium 60*60*60
Click Here to see the Video of my Fresh Water Aquarium
Image
sjmusic2
Posts: 33
Joined: Sun Sep 25, 2011 8:25 pm

Re: Libraries v0.8.5.17

Post by sjmusic2 »

binder wrote:Wow. That's all I have to say.

You found a bug that has existed since 0.8.5.15. I accidentally introduced it when I moved some of the strings to program memory to help with the code size and RAM usage. I think I've got a fix for it. I have to test it first though.

If you can, I would suggest enabling SIMPLE_MENU and using it initially to get things working again for you.

curt
Not sure if it helps, but this code works fine under 0.8.5.16...obviously with the ConvertNumToString reinstated.

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

Re: Libraries v0.8.5.17

Post by binder »

sjmusic2 wrote: Not sure if it helps, but this code works fine under 0.8.5.16...obviously with the ConvertNumToString reinstated.
Ok, looking at it further, it wasn't a bug in 0.8.5.16. I introduced it with 0.8.5.17 accidentally. It was done by me trying to reduce code size and forgetting to add in extra checks. I'll get it fixed once and for all. Sorry for this.

curt
sjmusic2
Posts: 33
Joined: Sun Sep 25, 2011 8:25 pm

Re: Libraries v0.8.5.17

Post by sjmusic2 »

Curt,

No need to apologize, we are in this together :)

Thanks for your help.

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

Re: Libraries v0.8.5.17

Post by binder »

I think I've got a fix for everything. I'll be pushing it out soon. It should fix several things BUT will also have a slight update/change with something too. Nothing major though.

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

Re: Libraries v0.8.5.17

Post by binder »

Use the wifi update utility and grab the latest. I just pushed updates and a version change so it will come through properly. It's .18 and it's not got a tag or official release until you can confirm things are fixed.

curt
sjmusic2
Posts: 33
Joined: Sun Sep 25, 2011 8:25 pm

Re: Libraries v0.8.5.17

Post by sjmusic2 »

Excuse my ignorance...I have to download manually but all I see in the downloads is the 0.8.5.17 from a couple of days back. How do I get the .18 beta ?
binder
Posts: 2865
Joined: Fri Mar 18, 2011 6:20 pm
Location: Illinois
Contact:

Re: Libraries v0.8.5.17

Post by binder »

sjmusic2 wrote:Excuse my ignorance...I have to download manually but all I see in the downloads is the 0.8.5.17 from a couple of days back. How do I get the .18 beta ?
No worries.

Go here: https://github.com/curtbinder/ReefAngel

Click on the 'Downloads' button. When the "window" pops up, click on the download source (Download .zip) at the top next to the 'branch: master'

That will download the latest code in the master branch for you (which will be .18).

curt
sjmusic2
Posts: 33
Joined: Sun Sep 25, 2011 8:25 pm

Re: Libraries v0.8.5.17

Post by sjmusic2 »

Thanks Curt,

.18 compiles my sketch ok, I do notice subtle differences in the display which do not impact functionality, eg. port status graphic bar is now in color !

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

Re: Libraries v0.8.5.17

Post by binder »

Yeah, those colors were added a few releases back. Looks a lot nicer and simpler to distinguish the on/off statuses.

curt
Post Reply