Error filename in UPGRADE.TXT is not a 7-byte name

Using OTA functions with Waspmote
gjokop
Posts: 7
Joined: Wed Jan 22, 2014 1:15 pm

Error filename in UPGRADE.TXT is not a 7-byte name

Post by gjokop » Wed Jan 22, 2014 1:55 pm

Hello,
I am trying to perform over the air programming with wifi but I am getting filename in UPGRADE.TXT is not a 7-byte name error. This is the content of my upgrade.txt file:

FILE:OTA_08_\n
PATH:/gjoko\n
SIZE:32266\n
VERSION:2\n

Thanks,
Gjoko

libelium-dev
Posts: 27967
Joined: Mon Sep 28, 2009 1:06 pm

Re: Error filename in UPGRADE.TXT is not a 7-byte name

Post by libelium-dev » Thu Jan 23, 2014 8:56 am

Hi,

it is right, as shown in OTA guide http://www.libelium.com/downloads/docum ... df#page=47

what is exactly your problem?

which code are you using?

gjokop
Posts: 7
Joined: Wed Jan 22, 2014 1:15 pm

Re: Error filename in UPGRADE.TXT is not a 7-byte name

Post by gjokop » Thu Jan 23, 2014 2:38 pm

Hi,

Im using the default code for ota via wifi

#include <WaspWIFI.h>

// choose socket (SELECT USER'S SOCKET)
///////////////////////////////////////
uint8_t socket=SOCKET0;
///////////////////////////////////////

// FTP server settings
/////////////////////////////////
#define USER "gjoko"
#define PASS "*******"
#define IP_ADDRESS "***.**.**.*"
#define PORT 21
/////////////////////////////////

// WiFi AP settings (CHANGE TO USER'S AP)
/////////////////////////////////
#define ESSID "Android"
#define AUTHKEY "********"
/////////////////////////////////

// define variables
int answer;

void setup()
{
//*****************************************************************
// 1. Check if the program has been programmed successfully
//*****************************************************************
answer = Utils.checkNewProgram();
switch(answer)
{
case 0:
USB.println(F("REPROGRAMMING ERROR"));
break;

case 1:
USB.println(F("REPROGRAMMING OK"));
break;

default:
USB.println(F("RESTARTING"));
}

// Wifi module setup
wifiSetup();

//*****************************************************************
// 2. User setup
//*****************************************************************

// Put your setup code here, to run once:
}


void loop()
{
// USB.println(F(""));
//*****************************************************************
// 3. User loop program
//*****************************************************************

// put your main code here, to run repeatedly:


//*****************************************************************
// 4. OTA request
//*****************************************************************

// 4.1. Wifi module ON
if( WIFI.ON(socket) == 1)
{
USB.println(F("WiFi module ready..."));

// 4.2. If it is manual, call join giving the name of the AP
if(WIFI.join(ESSID))
{
USB.println(F("Wifi module joined AP"));

// 4.3. Request OTA
answer = WIFI.requestOTA();

// If OTA fails, show the error code
USB.print(F("Error:"));
printError(answer);
}
else
{
USB.println(F("ERROR joining"));
}
}
else
{
USB.println(F("ERROR switching on"));
}

// 4.4. Reboot WiFi module
WIFI.OFF();
delay(3000);


}


/**********************************************************
*
* wifiSetup - It sets the main settings to the WiFi module
*
*
************************************************************/
void wifiSetup()
{
// Switch ON the WiFi module on the desired socket
if( WIFI.ON(socket) == 1 )
{
USB.println(F("Wifi switched ON"));
}
else
{
USB.println(F("Wifi did not initialize correctly"));
}

// 1. Configure the transport protocol (UDP, TCP, FTP, HTTP...)
WIFI.setConnectionOptions(CLIENT_SERVER);
// 2. Configure the way the modules will resolve the IP address.
WIFI.setDHCPoptions(DHCP_ON);
// 3. Set the Flush buffer to 100 Bytes
WIFI.setCommSize(700);
// 4. Set the Flush Timer to 50ms
WIFI.setCommTimer(50);
// 5. Set TX rate to 1Mbps
WIFI.setTXRate(0);


// 6. Set the server IP address, ports and FTP mode
WIFI.setFTP(IP_ADDRESS,PORT,FTP_PASIVE,20);

// 7.Set the server account with the username and password
WIFI.openFTP(USER,PASS);

// 8. Configure how to connect the AP
WIFI.setJoinMode(MANUAL);

// 9. Set the AP settings
WIFI.setESSID(ESSID);
WIFI.setAuthKey(WPA1,AUTHKEY);

// 10. Save Data to module's memory
WIFI.storeData();

}



/**********************************************************
*
* printError - prints the error related to OTA
*
*
************************************************************/
void printError(int8_t err)
{
switch(err)
{
case 0: USB.println(F("error"));
break;
case -1: USB.println(F("error downloading UPGRADE.TXT"));
break;
case -2: USB.println(F("filename in UPGRADE.TXT is not a 7-byte name"));
break;
case -3: USB.println(F("no FILE label is found in UPGRADE.TXT"));
break;
case -4: USB.println(F("NO_FILE is defined as FILE in UPGRADE.TXT"));
break;
case -5: USB.println(F("no PATH label is found in UPGRADE.TXT"));
break;
case -6: USB.println(F("no SIZE label is found in UPGRADE.TXT"));
break;
case -7: USB.println(F("no VERSION label is found in UPGRADE.TXT"));
break;
case -8: USB.println(F("version indicated in UPGRADE.TXT is lower/equal to Waspmote's version"));
break;
case -9: USB.println(F("file size does not match the indicated in UPGRADE.TXT"));
break;
case -10: USB.println(F("error downloading binary file"));
break;
default : USB.println(F("unkown"));
}
}

I am getting this error
Image

and i'm using this file
Image

libelium-dev
Posts: 27967
Joined: Mon Sep 28, 2009 1:06 pm

Re: Error filename in UPGRADE.TXT is not a 7-byte name

Post by libelium-dev » Fri Jan 24, 2014 9:37 am

gjokop,

could you please add a delay at the end of your loop? For example 2 minutes. Then check the content of the SD card and check if the file is really what it is expected to be.

let us know your progress.

Check if you are using last API version and last IDE version.

gjokop
Posts: 7
Joined: Wed Jan 22, 2014 1:15 pm

Re: Error filename in UPGRADE.TXT is not a 7-byte name

Post by gjokop » Fri Jan 24, 2014 12:23 pm

I am using the latest version of API and IDE. I've added two minutes delay and im still getting the same error. This is what i have on the sd card

Image

libelium-dev
Posts: 27967
Joined: Mon Sep 28, 2009 1:06 pm

Re: Error filename in UPGRADE.TXT is not a 7-byte name

Post by libelium-dev » Fri Jan 24, 2014 2:52 pm

gjokop,

we see now the misstake.

Did you add manually a "\" and a "n" characters? This is not the idea.

the idea is to add the ascii char "\n" which is the line feed char. LF char. hex value = 0x0A.

try with this and let us know.

gjokop
Posts: 7
Joined: Wed Jan 22, 2014 1:15 pm

Re: Error filename in UPGRADE.TXT is not a 7-byte name

Post by gjokop » Mon Jan 27, 2014 8:59 am

libelium-dev,

I've added line feed char. hex value 0x0A but it still gives me the same error. I have tried different ways to add the hexadecimal value.

Image

What is the correct way?

libelium-dev
Posts: 27967
Joined: Mon Sep 28, 2009 1:06 pm

Re: Error filename in UPGRADE.TXT is not a 7-byte name

Post by libelium-dev » Mon Jan 27, 2014 9:17 am

gjokop,

you need to add only one byte of information at the end of each line.

maybe you can use other text editor to see the file content in hexadecimal values. Geany, sublime, notepadC++...

with notepad, if you type 0x0A you are adding 4 bytes, the 0, the x, the 0 and A. (hexadecimal data 30 78 30 41).

It is just a formatting issue.

You can use this link to convert data to each format.

http://home.paulschou.net/tools/xlate/

gjokop
Posts: 7
Joined: Wed Jan 22, 2014 1:15 pm

Re: Error filename in UPGRADE.TXT is not a 7-byte name

Post by gjokop » Mon Jan 27, 2014 9:27 am

libelium-dev,

Thanks a lot for your help, now is working just fine.

libelium-dev
Posts: 27967
Joined: Mon Sep 28, 2009 1:06 pm

Re: Error filename in UPGRADE.TXT is not a 7-byte name

Post by libelium-dev » Mon Jan 27, 2014 1:10 pm

glad to hear that.

Post Reply

Who is online

Users browsing this forum: No registered users and 1 guest