Verification Error

Do you have a question on how to do something.
Ask in here.
Post Reply
Zechenia
Posts: 35
Joined: Thu Dec 29, 2011 3:53 pm

Verification Error

Post by Zechenia »

Hi,

I recently tried to make a change to my INO file for my ReefAngel (note, not RA+).

It'd been a couple months since I updated libraries, so I went ahead and did that too. I was trying to add some logic around automatically turning on feedmode since I got an autofeeder.

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>

////// Place global variable code below here
//1	Heater
//2	Moonlight
//3	Fuge Light
//4	Return 
//5	Skimmer
//6	Reactor
//7	ATO
//8	LEDs -> Fan
boolean ATOTriggered = false;
unsigned long ATOTime = now();
////// 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 = Port4Bit | Port5Bit | Port6Bit;
    // Ports toggled in Water Change Mode
    ReefAngel.WaterChangePorts = Port4Bit | Port5Bit | Port6Bit | Port7Bit | Port1Bit;
    // Ports toggled when Lights On / Off menu entry selected
    ReefAngel.LightsOnPorts = Port2Bit;
    ReefAngel.OverheatShutoffPorts = 0;
    // Use T1 probe as temperature and overheat functions
    ReefAngel.TempProbe = T1_PROBE;
    ReefAngel.OverheatProbe = T1_PROBE;
    // Set the Overheat temperature setting
    InternalMemory.OverheatTemp_write( 850 );



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

    ////// Place additional initialization code below here
    ReefAngel.Timer[1].SetInterval(30);
    ////// Place additional initialization code above here
}

void loop()
{
    //ReefAngel.StandardLights( Port2,21,0,11,0 );
    ReefAngel.StandardLights( Port3,22,0,10,0 );
    ReefAngel.StandardHeater( Port1 );
    ReefAngel.PWM.DaylightPWMParabola();
    ReefAngel.PWM.ActinicPWMParabola();
    ReefAngel.LCD.BacklightOn();

    //if lights should be off, set to zero. Fallback from code above
    if ((hour() < 12) || (hour() >= 20))
     {
       ReefAngel.PWM.SetDaylight(0);
     }
    if ((hour() < 11) || (hour() >= 21))
    {
        ReefAngel.PWM.SetActinic(0);
    }
    
    static time_t wcTimer;
    if (ReefAngel.DisplayedMenu == WATERCHANGE_MODE || ReefAngel.DisplayedMenu == FEEDING_MODE) wcTimer=now();
    if (now()-wcTimer > 0 && now()-wcTimer < 600) 
    {
      ReefAngel.Relay.Off(Port5);
    } 
    else 
    {
      ReefAngel.Relay.On(Port5);
    }
    
   if (hour() == 8 && minute() == 0 && second() == 0)
    {
     // ReefAngel.DisplayedMenu = WATERCHANGE_MODE;
      ReefAngel.FeedingModeStart();
    }
    
    //Moonlights with a phase of total darkness
    if ((hour() >= 21 || hour() <= 2) || (hour() >= 6 && hour() <= 11))
    {
      ReefAngel.Relay.On(Port2);
    }
    else
    {
      ReefAngel.Relay.Off(Port2);
    }
    
    if (!ReefAngel.HighATO.IsActive())
    {
        if(ReefAngel.LowATO.IsActive() && ATOTriggered == false)
        {
           ATOTriggered = true;
           ATOTime = now();
           ReefAngel.Relay.Off(Port7);
        }
        else if (ReefAngel.LowATO.IsActive() && ATOTriggered == true && (now() - ATOTime > 30 ))
        {
           ReefAngel.Relay.On(Port7); 
        }
        else if (!ReefAngel.LowATO.IsActive())
        {
          ATOTriggered = false;
          ReefAngel.Relay.Off(Port7);
        }
    }
    else
    {
        ATOTriggered = false;
        ReefAngel.Relay.Off(Port7);
    }
    
 //********************************************************************************************************************************
  // Activate Watch Dog Timer at 6am and 6pm

  if ((now()%86400)==21600) delay(1000);

  if ((now()%86400)==43200) delay(1000);

 //********************************************************************************************************************************


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

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

However, when I attempted to upload this, I got the following error:

Code: Select all

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

avrdude done.  Thank you.
I tried a couple of the obvious things: Resetting the controller, replugging in the USB cord, restarting program, uploading a brand new memory file, checking the board type in the arduino program, removing the code I had just added. Nothing changed.

Then I went and opened the basic controller test file, and it uploaded fine.

Next, I uploaded an older version of my code, that looks like this:

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>

////// Place global variable code below here
//1	Heater
//2	Moonlight
//3	Fuge Light
//4	Return 
//5	Skimmer
//6	Reactor
//7	ATO
//8	LEDs -> Fan
boolean ATOTriggered = false;
unsigned long ATOTime = now();
////// 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 = Port4Bit;
    // Ports toggled in Water Change Mode
    ReefAngel.WaterChangePorts = Port4Bit | Port5Bit | Port6Bit | Port7Bit | Port1Bit;
    // Ports toggled when Lights On / Off menu entry selected
    ReefAngel.OverheatShutoffPorts = 0;
    // Use T1 probe as temperature and overheat functions
    ReefAngel.TempProbe = T1_PROBE;
    ReefAngel.OverheatProbe = T1_PROBE;
    // Set the Overheat temperature setting
    InternalMemory.OverheatTemp_write( 850 );



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

    ////// Place additional initialization code below here
    ReefAngel.Timer[1].SetInterval(30);
    ////// Place additional initialization code above here
}

void loop()
{
    //ReefAngel.StandardLights( Port2,21,0,11,0 );
    ReefAngel.StandardLights( Port3,22,0,10,0 );
    ReefAngel.StandardHeater( Port1,771,778);
    ReefAngel.PWM.SetDaylight( PWMParabola(12,0,20,0,15,55,0) );
    ReefAngel.PWM.SetActinic( PWMParabola(11,0,22,0,15,52,0) );
    ReefAngel.LCD.BacklightOn();

    //if lights should be off, set to zero. Fallback from code above
    if ((hour() < 12) || (hour() >= 20))
     {
       ReefAngel.PWM.SetDaylight(0);
     }
    if ((hour() < 11) || (hour() >= 22))
    {
        ReefAngel.PWM.SetActinic(0);
    }
    
    
    //Moonlights with a phase of total darkness
    if ((hour() >= 22 || hour() <= 2) || (hour() >= 6 && hour() <= 11))
    {
      ReefAngel.Relay.On(Port2);
    }
    else
    {
      ReefAngel.Relay.Off(Port2);
    }
    ////// Place your custom code below here
  /*  if (!ReefAngel.HighATO.IsActive())
    {
        if(ReefAngel.LowATO.IsActive())
        {
           ReefAngel.Relay.On(Port7);
        }
        else
        {
           ReefAngel.Relay.Off(Port7); 
        }
    }
    else
    {
        ReefAngel.Relay.Off(Port7);
    }*/
    
    if (!ReefAngel.HighATO.IsActive())
    {
        if(ReefAngel.LowATO.IsActive() && ATOTriggered == false)
        {
           ATOTriggered = true;
           ATOTime = now();
           ReefAngel.Relay.Off(Port7);
        }
        else if (ReefAngel.LowATO.IsActive() && ATOTriggered == true && (now() - ATOTime > 30 ))
        {
           ReefAngel.Relay.On(Port7); 
        }
        else if (!ReefAngel.LowATO.IsActive())
        {
          ATOTriggered = false;
          ReefAngel.Relay.Off(Port7);
        }
    }
    else
    {
        ATOTriggered = false;
        ReefAngel.Relay.Off(Port7);
    }
    
 //********************************************************************************************************************************
  // Activate Watch Dog Timer at 6am and 6pm

  if ((now()%86400)==21600) delay(1000);

  if ((now()%86400)==43200) delay(1000);

 //********************************************************************************************************************************


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

    // This should always be the last line
    ReefAngel.Portal( "zechenia" );
    ReefAngel.ShowInterface();
}
This uploaded fine as well (thank god, at least I have something going on my tank now)

So, the next logical step was to start adding functionality from my updated code to the one that uploaded fine. First thing I added was the delayed start for port5.

Bingo, this now made me code fail to be verified. However, removing it from the first code still resulted in a failed upload.

Edit: and in case it matters: Binary sketch size: 31,344 bytes (of a 32,256 byte maximum)

Any pointers???
Sebyte

Re: Verification Error

Post by Sebyte »

The new library's, because of additional functionality create larger INO files than previous versions. Have a look at this link http://forum.reefangel.com/viewtopic.php?f=12&t=3542
Zechenia
Posts: 35
Joined: Thu Dec 29, 2011 3:53 pm

Re: Verification Error

Post by Zechenia »

I saw that, I thought I was safe since my size was less than the max.

But I am assuming that has to do with other things (libraries for example) taking up space on the device?
User avatar
lnevo
Posts: 5430
Joined: Fri Jul 20, 2012 9:42 am

Re: Verification Error

Post by lnevo »

I dont think this error is space related.
Zechenia
Posts: 35
Joined: Thu Dec 29, 2011 3:53 pm

Re: Verification Error

Post by Zechenia »

If no one has any other ideas, I might try and revert libraries tonight and see if it helps.
rimai
Posts: 12881
Joined: Fri Mar 18, 2011 6:47 pm

Re: Verification Error

Post by rimai »

That is not related to the libraries or code size.
It's failing to verify the code you just uploaded.
Make sure the cable is properly seated in the head unit.
Roberto.
Zechenia
Posts: 35
Joined: Thu Dec 29, 2011 3:53 pm

Re: Verification Error

Post by Zechenia »

The problem is that, without adjusting anything relating to my connection/cable, I can upload other INO files without problem. But this one fails every time :(
rimai
Posts: 12881
Joined: Fri Mar 18, 2011 6:47 pm

Re: Verification Error

Post by rimai »

Is the error always at the same address?
0x7800
Roberto.
Zechenia
Posts: 35
Joined: Thu Dec 29, 2011 3:53 pm

Re: Verification Error

Post by Zechenia »

I'll have to try a few times tonight to be sure. But I think so.
Zechenia
Posts: 35
Joined: Thu Dec 29, 2011 3:53 pm

Re: Verification Error

Post by Zechenia »

Actually, let me add to that. I don't know if that address changed (like when I commented out code to see if I could get it to work). But it at least seemed consistent with one code base.

In other words, when I commented out the newly added stuff, that address may have changed. But then every time I would try to upload that slightly different code, I believe the address was the same.

Does that make sense? lol

Also, my freakout stage is over, since the backup code I am using has MOST of the functionality on it. Doesn't have my skimmer soft start (which is ok, since I am doing some work on it and haven't had it plugged in) and the LED values from memory.
rimai
Posts: 12881
Joined: Fri Mar 18, 2011 6:47 pm

Re: Verification Error

Post by rimai »

Ok, when you can, please try uploading a couple different codes to see if you get the same error and write down the address that it has failed, if it does.
Roberto.
Zechenia
Posts: 35
Joined: Thu Dec 29, 2011 3:53 pm

Re: Verification Error

Post by Zechenia »

Ok, if different INO files have different errors, do you want me to attach the INO file with the error number?
rimai
Posts: 12881
Joined: Fri Mar 18, 2011 6:47 pm

Re: Verification Error

Post by rimai »

No, just the error is enough.
Roberto.
Zechenia
Posts: 35
Joined: Thu Dec 29, 2011 3:53 pm

Re: Verification Error

Post by Zechenia »

Yup, same memory value everytime.

Attempted to downgrade to the 1.0.6 libraries, still failed.

Then went back to the libraries who's date looked most like the last time I updated, and ended up on 1.0.4.

It uploaded!

Now, I am going on vacation so I won't be here over the weekend. My code as far as feedmode looks good, and won't lock anythign up now will it? :mrgreen:
rimai
Posts: 12881
Joined: Fri Mar 18, 2011 6:47 pm

Re: Verification Error

Post by rimai »

What was the size of the code it uploaded correctly?
Roberto.
Zechenia
Posts: 35
Joined: Thu Dec 29, 2011 3:53 pm

Re: Verification Error

Post by Zechenia »

Binary sketch size: 30,134 bytes (of a 32,256 byte maximum)
rimai
Posts: 12881
Joined: Fri Mar 18, 2011 6:47 pm

Re: Verification Error

Post by rimai »

If you would like, you can send the unit back for analysis.
It looks like it may have to be repaired/replaced.
Roberto.
Post Reply