Updated to 1.0.4 libraries. Cannot control Tunze powerhead.

Related to the development libraries, released by Curt Binder
enigma32
Posts: 74
Joined: Fri Apr 26, 2013 11:48 am
Location: Los Angeles and NYC

Re: Updated to 1.0.4 libraries. Cannot control Tunze powerhe

Post by enigma32 »

lnevo: You had verification errors that went away by switching from int to long in the code? :-/

mudcat1:
Any one of a number of [many] different things can cause this to happen.

Does the error always show the exact same address number?
Do you get that error when using the old libraries and the new libraries?
Is everything besides the programmer cable disconnected from the controller?
Certainly wouldn't hurt to try it on windows if you have access to a windows machine.
Are you equipped to burn a new bootloader to the controller? (If you don't know what I mean, you probably aren't :-))
Current setup:
60g 24" custom cube (fish and softies right now)
AI Sol Blue, Ecotech MP-10wES
Coralife skimmer
100% customer controller, transitioning to ReefAngel
User avatar
lnevo
Posts: 5430
Joined: Fri Jul 20, 2012 9:42 am

Re: Updated to 1.0.4 libraries. Cannot control Tunze powerhe

Post by lnevo »

Yes, but I was using the 1.0 version of Arduino. For whatever reason, by default I was seeing the value come up for the water level calibration in what seemed to be a byte, wrapping over and over. I switched the output in the read function for the water level expansion to return a long instead of an int and then it was working properly.

While upgrading to 1.0.4 I tried to update the twi.c file and then things wouldn't compile. I upgraded the IDE and removed my int to long change and low and behold everything is working fine. Keep in mind, I've had this fix in for a while, so I don't know if they were related, but I believe it was...

Either way, mudcat seems to be on the right version.. :(
enigma32
Posts: 74
Joined: Fri Apr 26, 2013 11:48 am
Location: Los Angeles and NYC

Re: Updated to 1.0.4 libraries. Cannot control Tunze powerhe

Post by enigma32 »

lnevo: Ah, ok. That makes more sense to me now, hehe.
Current setup:
60g 24" custom cube (fish and softies right now)
AI Sol Blue, Ecotech MP-10wES
Coralife skimmer
100% customer controller, transitioning to ReefAngel
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 »

enigma32 wrote:lnevo: You had verification errors that went away by switching from int to long in the code? :-/

mudcat1:
Any one of a number of [many] different things can cause this to happen.

Does the error always show the exact same address number?
Do you get that error when using the old libraries and the new libraries?
Is everything besides the programmer cable disconnected from the controller?
Certainly wouldn't hurt to try it on windows if you have access to a windows machine.
Are you equipped to burn a new bootloader to the controller? (If you don't know what I mean, you probably aren't :-))
enigma32,
I think you and Roberto may be onto something. The version 1.0.7 libraries are running on my Ubuntu linux machine which is where I am having problems with the sketch. I am running my original 1.0.3 libraries on my Windows 7 machine which will upload my old sketch correctly. I am hesitant to upgrade the libraries to 1.0.7 on my Windows machine because I am fearful that I will leave myself in a situation where nothing is working.

To answer your questions...
Does the error always show the exact same address number? I am not sure. if you are referring to the mismatch at byte... they appear to be different.
1st try...
avrdude: Recv: . [10]
# | 100% 6.49s

avrdude: verifying ...
avrdude: verification error, first mismatch at byte 0x3dd1
0x04 != 0x44
avrdude: verification error; content mismatch
avrdude: Send: Q [51] [20]
avrdude: Recv: . [14]
avrdude: Recv: . [10]

avrdude done. Thank you.
2nd try...
avrdude: verifying ...
avrdude: verification error, first mismatch at byte 0x2e8d
0xe0 != 0xe2
avrdude: verification error; content mismatch
avrdude: Send: Q [51] [20]
avrdude: Recv: . [14]
avrdude: Recv: . [10]

avrdude done. Thank you.

Do you get that error when using the old libraries and the new libraries? No but they are on 2 different machines 1.0.7 on Ubuntu Linux 10.04 and 1.0.3 on Windows 7.
Is everything besides the programmer cable disconnected from the controller? No I only disconnect my Wifi to attach the programmer cable, everything else (relay box, 2 temp probes, float switches) remain connected. But I have never disconnected anything else in the past to upload new sketches.
Certainly wouldn't hurt to try it on windows if you have access to a windows machine. If it is easy to downgrade from 1.0.7 libraries back to 1.0.3 libraries (in the event it doesn't work) I might be willing to try. Although I hate to stop using the Ubuntu machine because it has worked well for me up to this library version (and I have less competition from the rest of my family for using the Linux laptop).
Are you equipped to burn a new bootloader to the controller? (If you don't know what I mean, you probably aren't) No
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 »

Don't fear the upgrade/downgrade.
You can always download from github:
https://github.com/reefangel/Libraries/tags
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 »

Roberto,
I decided to upgrade the libraries on my Windows 7 machine as you suggested. But unfortunately it is still behaving in the same manner as it does in Ubuntu, the Tunze powerhead still will not run on the Daylight channel.

The steps that I followed to upgrade to 1.0.7 were:
Open Ardunio 1.0.1, it prompted me to upgrade to version 1.0.7 libraries, I selected "Yes" and the upgrade was successful. I then copied the twi.c to the folder suggested in this post http://forum.reefangel.com/viewtopic.php?f=2&t=3068.

The only improvement that I see is that I did not receive the "Error Uploading" error that I received previously when using Ubuntu.

Do you have any other suggestions?

Thanks,
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 am still using the hardcoded version of the sketch that I uploaded previously. The powerhead mode selected in internal memory is 2 for Reefcrest mode.
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 »

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..
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: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
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 »

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.
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