Issues I've seen in the current Dev Library.

Related to the development libraries, released by Curt Binder
User avatar
Posts: 1833
Joined: Sun Apr 21, 2013 6:25 am
Location: Davie, FL
PostPosted: Thu Sep 04, 2014 8:21 am
I'm sure these issues are something with me or else everyone would have mentioned them.

1) The Multi WL sensor does not display anything. With the current Libraries I will at least get levels but with the dev Library the 4 Multi WL sensors display 0.

2) I tried to set up the DDNS server last night and when I add the code and set up my DNS name in there I lose connectivity with my head unit. The Portal will read unavailable and it will start pulling it's info from the web database.
The Android app loses connectivity in Away mode and Reeftronics can not receive any data from it. My DNS name is still set up with No-IP and works fine on the current 1.1.0 Libraries.

Both of these issues are to large for me to be the only one having an issue so I must have dome something incorrectly.

There really is not any code setup for the Multi WL sensor I just monitor the level of my ATO reservoir so I can't say a code issue is causing it to report 0.

The code for the DNS server is have as...

Code: Select all

with my subdomian in there.
User avatar
Posts: 5423
Joined: Fri Jul 20, 2012 9:42 am
PostPosted: Thu Sep 04, 2014 8:25 am
Thanks Steve, It's important that we get testers to uncover issues like this.

Hopefully Roberto can address some of your findings, none of the patches I've submitted should have modified this functionality. The DDNS is pretty new, so you may be like the 2nd person using it :)
User avatar
Posts: 1833
Joined: Sun Apr 21, 2013 6:25 am
Location: Davie, FL
PostPosted: Thu Sep 04, 2014 8:46 am
Technically trying to use it.
I'm not even really using it.

I was going to switch over to the Dev Library and let the Portal update overnight, but the I realized if the Portal is not communicating with the RA then it will never get the DDNS name I entered in the code.

Posts: 12628
Joined: Fri Mar 18, 2011 6:47 pm
PostPosted: Thu Sep 04, 2014 9:12 am
Weird. I'm looking at the server and I can see that your DDNS name was entered into the server.
I'm going to delete the entry. Let's see if it gets added again.
BTW, you and I are the only ones so far :cry:
I've been using the DDNS feature on my controller for quite a while now, but I have not updated my controller after Lee and Alan added their stuff, but there was nothing on their end that would change the functionality.
I also use the Multi WL on my tank. If it was not working, my drain pipe would be gargling and making noise :(, which I definitely wouldn't want it to happen. It's the Multi WL that controls my "RobertoFlow" 8-)
Can you post your entire code?
I'm going to load it up in a test controller and see what happens.
User avatar
Posts: 1833
Joined: Sun Apr 21, 2013 6:25 am
Location: Davie, FL
PostPosted: Thu Sep 04, 2014 9:18 am
No Problem. I'll remote into my laptop and post the code and also change the libraries and upload mu code again with my handy dandy Blue Tooth module :)

Oh is there any security rick posting my code that has my portal key, my DDNS name and my webserver password in it?
User avatar
Posts: 1833
Joined: Sun Apr 21, 2013 6:25 am
Location: Davie, FL
PostPosted: Thu Sep 04, 2014 10:41 am
Oh one other question.
The code for the DDNS goes in the setup section, correct?
User avatar
Posts: 1833
Joined: Sun Apr 21, 2013 6:25 am
Location: Davie, FL
PostPosted: Thu Sep 04, 2014 10:42 am

Here's my code...

Code: Select all
#include <ReefAngel_Features.h>
#include <Globals.h>
#include <RA_Wifi.h>
#include <Wire.h>fF
#include <OneWire.h>
#include <Time.h>
#include <DS1307RTC.h>
#include <InternalEEPROM.h>
#include <RA_NokiaLCD.h>f
#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 <InternalEEPROM.h>
#include <RA_Colors.h>
#include <RA_CustomColors.h>
#include <Salinity.h>
#include <RF.h>
#include <IO.h>
#include <ORP.h>
#include <AI.h>
#include <PH.h>
#include <WaterLevel.h>
#include <Humidity.h>
#include <DCPump.h>
#include <ReefAngel.h>

// Define Relay Ports by Name
#define Actinic_Lights     1
#define Day_Lights         2
#define Kalkwasser         3
#define Pumps              4
#define Sump_Fan           5
#define DeNit_Doser        6
#define DeNit_Pump         7
#define ATO_Pump           8

#define Unused             Box1_Port1
#define Feeder             Box1_Port2
#define Unused             Box1_Port3
#define Unused             Box1_Port4
#define Unused             Box1_Port5
#define Unused             Box1_Port6
#define Unused             Box1_Port7
#define Dummy              Box1_Port8

////// Place global variable code below here

// Does not need to be global.
// unsigned long ATOUpdate=0;

////// Place global variable code above here

void setup()
// This must be the first line
ReefAngel.Init(); //Initialize controller
// Ports toggled in Feeding Mode
ReefAngel.FeedingModePorts = 0;
// Ports toggled in Water Change Mode
ReefAngel.WaterChangePorts = Port4Bit;
ReefAngel.WaterChangePortsE[0] = Port1Bit;
// Ports toggled when Lights On / Off menu entry selected
ReefAngel.LightsOnPorts = Port1Bit | Port2Bit;
// Ports turned off when Overheat temperature exceeded
ReefAngel.OverheatShutoffPorts = Port1Bit | Port2Bit;
// Use T1 probe as temperature and overheat functions
ReefAngel.TempProbe = T1_PROBE;
ReefAngel.OverheatProbe = T1_PROBE;
// Set the Overheat temperature setting
InternalMemory.OverheatTemp_write( 825 );
//Set Standard Menu
//Webserver Authentication
//DDNS Server

// Feeeding and Water Change mode speed
ReefAngel.DCPump.ActinicChannel=Sync; // Now you're pump will be affected by the portal settings.
ReefAngel.DCPump.DaylightChannel=AntiSync; // Now you're pump will be affected by the portal settings.

// Ports that are always on
ReefAngel.Relay.On( Pumps );
ReefAngel.Relay.On( Dummy );

////// Place additional initialization code below here

////// Place additional initialization code above here

void loop()
  ReefAngel.StandardLights( Actinic_Lights,12,0,22,0 );
  ReefAngel.StandardLights( Day_Lights,13,0,21,0 );
  ReefAngel.StandardLights( Sump_Fan,13,0,21,0 );
  if ( hour()>=13 && hour()<21 )
  ReefAngel.PWM.SetChannel( 5, 0 );
  ReefAngel.PWM.SetChannel( 5, PWMSlope(21,0,13,0,0,MoonPhase() ,60,0) );
  ////// Place your custom code below here
  //Mix Kalkwasser
static unsigned long Kalk_Mixing = 0;

static unsigned long stopTime = 0;
static byte prevWL=0;

if (ReefAngel.WaterLevel.GetLevel(1)>=100 && prevWL<100) {
  stopTime=now()+3600; // Get time one hour from now.
prevWL = ReefAngel.WaterLevel.GetLevel(1); // Store the water level

if (now() < stopTime) { ReefAngel.Relay.On(Kalkwasser); } else { ReefAngel.Relay.Off(Kalkwasser); }
static unsigned long autofeeding = 0;

if ((now()%SECS_PER_DAY==64800)) //if it is 6 pm
ReefAngel.FeedingModeStart(); //START FEEDING MODE

if (ReefAngel.DisplayedMenu==FEEDING_MODE)
if ( autofeeding == 0 ) {
autofeeding = now(); //set the time of the start of feeding to variable feeding

if ((now()-autofeeding>=60) && (now()-autofeeding<=61)) //if between 60 and 61 seconds has past
ReefAngel.Relay.On(Feeder); //TURN FEEDER RELAY ON
ReefAngel.Relay.Off(Feeder); //TURN FEEDER RELAY OFF
} else {
if ( autofeeding > 0 ) {
autofeeding = 0;
  // DeNitrate Routine
int DeNit_Offset=3600;
int DeNit_Repeat=21600;
int DeNit_Doser_Offset=1200;
int DeNit_Doser_Runtime=600;
int DeNit_Pump_Runtime=1200;
int DeNit_ATO_Offtime=1500;

// Pump comes on first
ReefAngel.Relay.Set(DeNit_Pump,(now()-DeNit_Offset)%DeNit_Repeat<DeNit_Pump_Runtime);  // Runs denitrator pump
// Doser comes on second
ReefAngel.Relay.Set(DeNit_Doser,((now()-DeNit_Offset)-DeNit_Doser_Offset)%DeNit_Repeat<DeNit_Doser_Runtime); // Runs denitrator doser
  // Disable ATO
if ( (now()-3600)%21600<DeNit_ATO_Offtime) ReefAngel.WaterLevelATO(ATO_Pump,720,0,1);

  // Delay WL ATO after water change and DeNit_Dosing
  static time_t wcTimer=0;
  if (ReefAngel.DisplayedMenu == WATERCHANGE_MODE) wcTimer=now();

  // First 10 minutes after WC disable ATO
  if (now()-wcTimer >= 0 && now()-wcTimer < 600)

    // Track Salinity low duration
    static unsigned long lastGoodSal;
    static boolean lowSalFlag;
    // Salinity is good, update counter
    if (ReefAngel.Params.Salinity>=335) lastGoodSal=now();
    // Counter hasn't been updating in 300 seconds..
    if (now()-lastGoodSal>300) {
      lowSalFlag=true; // Salinity is definitely below 33.5
    } else {
      lowSalFlag=false; // Salinity back to normal
    // Disable ATO if lowSalFlag is true
    if (lowSalFlag) ReefAngel.WaterLevelATO(ATO_Pump,720,0,1);
  // Disable ATO if ATO High IsActive()
  if (ReefAngel.HighATO.IsActive())

// Add random mode if we set to Mode to Custom in portal
static int rmode;
static boolean changeMode=true;

// These are the modes we can cycle through. You can add more and even repeat...
byte modes[] = { ReefCrest, Lagoon, Constant, TidalSwell, ShortPulse, LongPulse, Else };

if (now()%SECS_PER_DAY==0 || changeMode==true) { // Change at midnight or if controller rebooted
rmode=random(100)%sizeof(modes); // Change the mode once per day to pick from our array

// Set timer when in feeding mode
static unsigned long feeding;
if (ReefAngel.DisplayedMenu==FEEDING_MODE) feeding=now();

if (now()-feeding<3600) {
  // Continue NTM for the 60 minutes
} else if (now()%SECS_PER_DAY<43200 || now()%SECS_PER_DAY>=79200) { // 12pm / 10pm
  // Night mode (go to 30%)
} else if (InternalMemory.DCPumpMode_read()==11) {
  // Custom Mode and nothing else going on
  ReefAngel.DCPump.UseMemory=true; // Will reset all values from memory

  ////// Place your custom code above here

  // This should always be the last line
  ReefAngel.Portal( "Sacohen","xxxxxxxx" );

void DrawCustomMain()
int x,y;
char text[10];
// Parameters
#if defined DisplayLEDPWM && ! defined RemoveAllLights
ReefAngel.LCD.DrawMonitor( 15, 20, ReefAngel.Params,
ReefAngel.PWM.GetDaylightValue(), ReefAngel.PWM.GetActinicValue() );
#else // defined DisplayLEDPWM && ! defined RemoveAllLights
ReefAngel.LCD.DrawMonitor( 15, 20, ReefAngel.Params );
#endif // defined DisplayLEDPWM && ! defined RemoveAllLights

// Water Level
ReefAngel.LCD.DrawText( COLOR_DARKGOLDENROD,DefaultBGColor,75,57, "WL:" );
ReefAngel.LCD.DrawText( COLOR_DARKGOLDENROD,DefaultBGColor,99,57, ReefAngel.WaterLevel.GetLevel() );

ReefAngel.LCD.DrawText( COLOR_DARKGOLDENROD,DefaultBGColor,66,66, "WL 1:" );
ReefAngel.LCD.DrawText( COLOR_DARKGOLDENROD,DefaultBGColor,99,66, ReefAngel.WaterLevel.GetLevel(1) );

  ConvertNumToString(text, ReefAngel.Params.Salinity, 10);
  strcat(text,"  ");

// Main Relay Box
byte TempRelay = ReefAngel.Relay.RelayData;
TempRelay &= ReefAngel.Relay.RelayMaskOff;
TempRelay |= ReefAngel.Relay.RelayMaskOn;
ReefAngel.LCD.DrawOutletBox( 12, 92, TempRelay );
TempRelay = ReefAngel.Relay.RelayDataE[0];
TempRelay &= ReefAngel.Relay.RelayMaskOffE[0];
TempRelay |= ReefAngel.Relay.RelayMaskOnE[0];
ReefAngel.LCD.DrawOutletBox(12, 104, TempRelay);

// Date and Time
ReefAngel.LCD.DrawDate( 6, 122 );

void DrawCustomGraph()

I also re uploaded it to my controller so you can see if it shows up in the server again.
Last edited by Sacohen on Sat Sep 06, 2014 5:41 am, edited 1 time in total.

Posts: 263
Joined: Wed Jan 01, 2014 7:26 am
PostPosted: Thu Sep 04, 2014 4:16 pm
I'll try doing the DDNS stuff with mine. I've just been using my default domain so far for the apps and never entered it anywhere in the portal. The portal just figures it out, I assume because my RA reaches out to the portal from time to time.

I also haven't tried any of the authentication stuff yet, and I don't have a ml water sensor, so wouldn't know on that stuff. I just downloaded dev tonight after all the merges and put it on my RA and it all compiled without tweaks and worked without changing my .ino for the dc pump things that I've been using.
User avatar
Posts: 1833
Joined: Sun Apr 21, 2013 6:25 am
Location: Davie, FL
PostPosted: Fri Sep 05, 2014 12:03 pm

Did you get to see if my code duplicated the problems I'm talking about on your system?
Also did my DNS name repopulate on the server?

Just curious.

Posts: 12628
Joined: Fri Mar 18, 2011 6:47 pm
PostPosted: Fri Sep 05, 2014 8:54 pm
The loss of connectivity is because of the authentication. You are requiring every connection the have a username an password entered. The portal doesn't have that implemented it yet. Not sure if reeftronics has it.

Return to Development Libraries

Who is online

Users browsing this forum: No registered users and 4 guests