Updated to 1.0.4 libraries. Cannot control Tunze powerhead.

Related to the development libraries, released by Curt Binder
User avatar
lnevo
Posts: 5430
Joined: Fri Jul 20, 2012 9:42 am

Updated to 1.0.4 libraries. Cannot control Tunze powerhead.

Post by lnevo »

mudcat1 wrote:
lnevo wrote:What happens if you start a new sketch and try hardcoding the tunze to one speed for now..lets go for basics...then change the speed and see what happens..
Lee,
The Tunze powerhead will run if I disconnect the Tunze cable. It is no longer controllable using the ReefAngel.PWM.SetDayLight channel. It will work correctly and is fully controllable if I use the ReefAngel.PWM.SetActinic channel. Something happened to the ReefAngel.PWM.SetDayLight code with the 1.0.4 library change. That is when it stopped working for me.

If you have a specific piece of code you would like me to try please post it. I would be glad to try it.

Thanks,
John
I'd like to see you start with fresh wizard generated code (hardcoded) and see if a SetDaylight(50); works and then try with 75. If still nothing or you did this already then nevermind.

Just want to make sure 100% its not your memory or code.
mudcat1
Posts: 133
Joined: Sun Dec 09, 2012 7:23 pm

Re: Updated to 1.0.4 libraries. Cannot control Tunze powerhe

Post by mudcat1 »

lnevo wrote:
mudcat1 wrote:
lnevo wrote:What happens if you start a new sketch and try hardcoding the tunze to one speed for now..lets go for basics...then change the speed and see what happens..
Lee,
The Tunze powerhead will run if I disconnect the Tunze cable. It is no longer controllable using the ReefAngel.PWM.SetDayLight channel. It will work correctly and is fully controllable if I use the ReefAngel.PWM.SetActinic channel. Something happened to the ReefAngel.PWM.SetDayLight code with the 1.0.4 library change. That is when it stopped working for me.

If you have a specific piece of code you would like me to try please post it. I would be glad to try it.

Thanks,
John
I'd like to see you start with fresh wizard generated code (hardcoded) and see if a SetDaylight(50); works and then try with 75. If still nothing or you did this already then nevermind.

Just want to make sure 100% its not your memory or code.
Lee,
I used the Wizard to create this code using Ubuntu version 10.04 and Ardunio 1.0.1. I think I did what you suggested but here is the code.

Code: Select all

#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 <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 <ReefAngel.h>

// Initialize Buzzer variables
byte buzzer=0;
byte overheatflag=0;
byte atoflag=0;
byte highfloatflag=0;

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


////// 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 = Port5Bit;
    // Ports toggled in Water Change Mode
    ReefAngel.WaterChangePorts = Port1Bit | Port2Bit | Port3Bit | Port4Bit | Port5Bit;
    // Ports toggled when Lights On / Off menu entry selected
    ReefAngel.LightsOnPorts = Port8Bit;
    // Ports turned off when Overheat temperature exceeded
    ReefAngel.OverheatShutoffPorts = Port7Bit;
    // Use T1 probe as temperature and overheat functions
    ReefAngel.TempProbe = T1_PROBE;
    ReefAngel.OverheatProbe = T1_PROBE;
    // Set the Overheat temperature setting
    InternalMemory.OverheatTemp_write( 820 );


    // Ports that are always on
    ReefAngel.Relay.On( Port1 );
    ReefAngel.Relay.On( Port5 );

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

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

void loop()
{
    ReefAngel.StandardHeater( Port7,755,790 );
    ReefAngel.StandardLights( Port8,20,0,8,0 );
    ReefAngel.PWM.SetDaylight( 50 );
    overheatflag = InternalMemory.read( Overheat_Exceed_Flag );
    atoflag = InternalMemory.read( ATO_Exceed_Flag );
//    highfloatflag = ReefAngel.HighATO.IsActive();
    buzzer = overheatflag + atoflag;
    if ( buzzer >= 1 ) buzzer = 100;
    ReefAngel.PWM.SetActinic( buzzer );

    ////// Place your custom code below here
    

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

    // This should always be the last line
    ReefAngel.Portal( "mudcat1" );
    ReefAngel.ShowInterface();
}

It is behaving the same way. The Tunze powerhead will not start unless I disconnect the Tunze cable. The DP channel on the Reef Angel screen displays 50. As soon as I disconnect the Tunze cable the powerhead will start running.
mudcat1
Posts: 133
Joined: Sun Dec 09, 2012 7:23 pm

Re: Updated to 1.0.4 libraries. Cannot control Tunze powerhe

Post by mudcat1 »

Lee,
I changed the code to use the Actinic channel instead of the Daylight channel and it works correctly, the powerhead runs at 50. So the problem continues to follow the Daylight channel. Here is the modified code.

Code: Select all

#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 <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 <ReefAngel.h>

// Initialize Buzzer variables
byte buzzer=0;
byte overheatflag=0;
byte atoflag=0;
byte highfloatflag=0;

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


////// 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 = Port5Bit;
    // Ports toggled in Water Change Mode
    ReefAngel.WaterChangePorts = Port1Bit | Port2Bit | Port3Bit | Port4Bit | Port5Bit;
    // Ports toggled when Lights On / Off menu entry selected
    ReefAngel.LightsOnPorts = Port8Bit;
    // Ports turned off when Overheat temperature exceeded
    ReefAngel.OverheatShutoffPorts = Port7Bit;
    // Use T1 probe as temperature and overheat functions
    ReefAngel.TempProbe = T1_PROBE;
    ReefAngel.OverheatProbe = T1_PROBE;
    // Set the Overheat temperature setting
    InternalMemory.OverheatTemp_write( 820 );


    // Ports that are always on
    ReefAngel.Relay.On( Port1 );
    ReefAngel.Relay.On( Port5 );

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

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

void loop()
{
    ReefAngel.StandardHeater( Port7,755,790 );
    ReefAngel.StandardLights( Port8,20,0,8,0 );
//    ReefAngel.PWM.SetDaylight( 50 );
    ReefAngel.PWM.SetActinic( 50 );
    overheatflag = InternalMemory.read( Overheat_Exceed_Flag );
    atoflag = InternalMemory.read( ATO_Exceed_Flag );
//    highfloatflag = ReefAngel.HighATO.IsActive();
    buzzer = overheatflag + atoflag;
    if ( buzzer >= 1 ) buzzer = 100;
//    ReefAngel.PWM.SetActinic( buzzer );
    ReefAngel.PWM.SetDaylight( buzzer );
    ////// Place your custom code below here
    

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

    // This should always be the last line
    ReefAngel.Portal( "mudcat1" );
    ReefAngel.ShowInterface();
}

I don't know if I told you but if I go back to the 1.0.3 libraries the Daylight channel controls the powerhead correctly.

-John
User avatar
lnevo
Posts: 5430
Joined: Fri Jul 20, 2012 9:42 am

Updated to 1.0.4 libraries. Cannot control Tunze powerhead.

Post by lnevo »

Cool at least we've 100% ruled out memory and code. Guess it must be the relay box. Or libraries...
mudcat1
Posts: 133
Joined: Sun Dec 09, 2012 7:23 pm

Re: Updated to 1.0.4 libraries. Cannot control Tunze powerhe

Post by mudcat1 »

lnevo wrote:Cool at least we've 100% ruled out memory and code. Guess it must be the relay box. Or libraries...
Lee,
I think I already ruled out the relay box being bad because it works correctly with the version 1.0.3 libraries.

Thanks,
John
User avatar
lnevo
Posts: 5430
Joined: Fri Jul 20, 2012 9:42 am

Updated to 1.0.4 libraries. Cannot control Tunze powerhead.

Post by lnevo »

mudcat1 wrote:
lnevo wrote:Cool at least we've 100% ruled out memory and code. Guess it must be the relay box. Or libraries...
Lee,
I think I already ruled out the relay box being bad because it works correctly with the version 1.0.3 libraries.

Thanks,
John
Or it has something uniquely wrong that is being affected by something totally irrelevant, maybe just like my water level.

It would be interesting also to see if you modify the function that sends the final write to the port to swap daylight and actinic and see if it follows..
mudcat1
Posts: 133
Joined: Sun Dec 09, 2012 7:23 pm

Re: Updated to 1.0.4 libraries. Cannot control Tunze powerhe

Post by mudcat1 »

rimai wrote:I still can't replicate the issue.
I forced PH_Mode=2; just before the switch because I don't have the memory location you are using initialized.
I can see the values changing in the screen and using a meter, I can see it changing according to what I see in the screen. I'm not so sure what is happening in your end.
Roberto,
Please make sure you are using the Daylight channel because the Actinic channel is working correctly. I tested it using a simple Wizard generated sketch (per Lee's suggestion) and I still encounter the problem when using the 1.0.7 libraries. I can reproduce the problem in Windows 7 or Ubuntu 10.04. Everything works correctly in version 1.0.3.

Do you have any other suggestions?

Thanks,
John
rimai
Posts: 12881
Joined: Fri Mar 18, 2011 6:47 pm

Re: Updated to 1.0.4 libraries. Cannot control Tunze powerhe

Post by rimai »

Yeah, I'm using daylight.
The actinic is always showing 100, probably because I don't have something that you are monitoring.
I tried on both RA and RA+ boards... So, I can't seem to replicate what you are experiencing
Roberto.
mudcat1
Posts: 133
Joined: Sun Dec 09, 2012 7:23 pm

Re: Updated to 1.0.4 libraries. Cannot control Tunze powerhe

Post by mudcat1 »

rimai wrote:Yeah, I'm using daylight.
The actinic is always showing 100, probably because I don't have something that you are monitoring.
I tried on both RA and RA+ boards... So, I can't seem to replicate what you are experiencing
Yes, that makes sense because I am monitoring that status of a float switch and starts my buzzer at full volume (100) which is attached to the Actinic channel. I am not sure what else to try. I guess I will downgrade to version 1.0.3 libraries and wait and see if anyone else reports the problem in the future. I guess that is the price you pay for being an early adopter. ;)

Thanks for taking the time to look into it.
John
mudcat1
Posts: 133
Joined: Sun Dec 09, 2012 7:23 pm

Re: Updated to 1.0.4 libraries. Cannot control Tunze powerhe

Post by mudcat1 »

Roberto,
I decided to continue to run the 1.0.7 libraries. I switched the Tunze powerhead to the Actinic channel where it will work properly. I put the buzzer on the Daylight channel so that it will sound when my ATO container is empty. I noticed another strange new symptom. When the buzzer goes off the DP channel shows 100 and the buzzer sounds as it should, but when the ATO container is full, the ATO low float switch is activated and the DP channel displays 0 as it should, but the buzzer continues to sound. The Daylight channel continues to present current when it should not. The buzzer continues to sound for several seconds until it slowly quiets itself. I thought i should mention this new observation just in case it might steer you to a possible solution.

Thanks,
John
rimai
Posts: 12881
Joined: Fri Mar 18, 2011 6:47 pm

Re: Updated to 1.0.4 libraries. Cannot control Tunze powerhe

Post by rimai »

It almost sounds like it's the channel that is not working, but that would make it not work on 1.0.3 too.
Roberto.
Post Reply