Problem witho OTA GPRS

Using OTA functions with Waspmote
vinche84
Posts: 40
Joined: Mon Sep 26, 2016 9:59 am

Problem witho OTA GPRS

Post by vinche84 » Sun Nov 13, 2016 7:10 pm

Hi,
i have problem with OTA by GPRS.
I use a your ftp server to test my program, but waspmote cannot download UPGRADE.TXT file (AT+FTPSIZE Answer: 0).
I enabled debug mode and this is output:
  • E#
    Debug mode 1
    not_ready: 1
    not_ready: 1
    not_ready: 0
    Send command with 1 answer: AT+CMEE=1
    Answer: 1
    Send command with 1 answer: ATE0
    Answer: 1
    Send command with 1 answer: AT+CSCLK=0
    Answer: 1
    Send command with 2 answers: AT+CFUN=1
    Answer: 1
    GPRS_SIM928A module ready...
    Connecting to the network
    Send command with 1 answer: AT+CREG?
    Answer: 1
    Send command with 1 answer: AT+CREG?
    Answer: 1
    Network status: 5
    Connected to the network
    Send command with 1 answer: AT+SAPBR=3,1,"CONTYPE","GPRS"
    Answer: 1
    Send command with 1 answer: AT+SAPBR=3,1,"APN","em"
    Answer: 1
    Send command with 1 answer: AT+SAPBR=3,1,"USER",""
    Answer: 1
    Send command with 1 answer: AT+SAPBR=3,1,"PWD",""
    Answer: 1
    Send command with 1 answer: AT+SAPBR=5,1
    Answer: 1
    HTTP_FTP Correctly configured
    Starting OTA process
    Send command with 1 answer: AT+SAPBR=3,1,"CONTYPE","GPRS"
    Answer: 1
    Send command with 1 answer: AT+SAPBR=3,1,"APN","em"
    Answer: 1
    Send command with 1 answer: AT+SAPBR=3,1,"USER",""
    Answer: 1
    Send command with 1 answer: AT+SAPBR=3,1,"PWD",""
    Answer: 1
    Send command with 1 answer: AT+SAPBR=5,1
    Answer: 1
    Downloading OTA VER FILE
    Send command with 1 answer: AT+CGREG?
    Answer: 1
    Send command with 1 answer: AT+CGREG?
    Answer: 1
    Send command with 1 answer: AT+CGREG?
    Answer: 1
    Send command with 1 answer: AT+CGREG?
    Answer: 1
    Send command with 1 answer: AT+CGREG?
    Answer: 1
    Send command with 1 answer: AT+CGREG?
    Answer: 1
    Send command with 1 answer: AT+CGREG?
    Answer: 1
    GPRS status: 5
    Send command with 2 answers: AT+SAPBR=1,1
    Answer: 1
    Send command with 1 answer: AT+SAPBR=2,1
    Answer: 1
    Send command with 2 answers: AT+FTPCID=1
    Answer: 1
    Send command with 2 answers: AT+FTPMODE=1
    Answer: 1
    Send command with 2 answers: AT+FTPTYPE="I"
    Answer: 1
    Send command with 2 answers: AT+FTPSERV="pruebas.libelium.com"
    Answer: 1
    Send command with 2 answers: AT+FTPPORT=21
    Answer: 1
    Send command with 2 answers: AT+FTPUN="t3g@libelium.com"
    Answer: 1
    Send command with 2 answers: AT+FTPPW="ftp1234"
    Answer: 1
    Inside readDataFTP
    FTP file: .gprs/UPGRADE.TXT
    SD file:/UPGRADE.TXT
    Send command with 2 answers: AT+FTPSTATE
    Answer: 1
    Inside FTPsize
    Send command with 2 answers: AT+FTPSTATE
    Answer: 1
    Send command with 2 answers: AT+FTPGETNAME="/UPGRADE.TXT"
    Answer: 1
    Send command with 2 answers: AT+FTPGETPATH=".gprs"
    Answer: 1
    Send command with 2 answers: AT+FTPSIZE
    Answer: 0
    Inside FTPsize
    Send command with 2 answers: AT+FTPSTATE
    Answer: 1
    Send command with 2 answers: AT+FTPGETNAME="/UPGRADE.TXT"
    Answer: 1
    Send command with 2 answers: AT+FTPGETPATH=".gprs"
    Answer: 1
    Send command with 2 answers: AT+FTPSIZE
    Answer: 0
    Return from readDataFTP: -23
    ftp_size: -23
    ftp_retries: 3
    file size SD: 0
    Inside readDataFTP
    FTP file: .gprs/UPGRADE.TXT
    SD file:/UPGRADE.TXT
    Send command with 2 answers: AT+FTPSTATE
    Answer: 1
    Inside FTPsize
    Send command with 2 answers: AT+FTPSTATE
    Answer: 1
    Send command with 2 answers: AT+FTPGETNAME="/UPGRADE.TXT"
    Answer: 1
    Send command with 2 answers: AT+FTPGETPATH=".gprs"
    Answer: 1
    Send command with 2 answers: AT+FTPSIZE
    Answer: 0
    Inside FTPsize
    Send command with 2 answers: AT+FTPSTATE
    Answer: 1
    Send command with 2 answers: AT+FTPGETNAME="/UPGRADE.TXT"
    Answer: 1
    Send command with 2 answers: AT+FTPGETPATH=".gprs"
    Answer: 1
    Send command with 2 answers: AT+FTPSIZE
    Answer: 0
    Return from readDataFTP: -23
    ftp_size: -23
    ftp_retries: 2
    file size SD: 0
    Inside readDataFTP
    FTP file: .gprs/UPGRADE.TXT
    SD file:/UPGRADE.TXT
    Send command with 2 answers: AT+FTPSTATE
    Answer: 1
    Inside FTPsize
    Send command with 2 answers: AT+FTPSTATE
    Answer: 1
    Send command with 2 answers: AT+FTPGETNAME="/UPGRADE.TXT"
    Answer: 1
    Send command with 2 answers: AT+FTPGETPATH=".gprs"
    Answer: 1
    Send command with 2 answers: AT+FTPSIZE
    Answer: 0
    Inside FTPsize
    Send command with 2 answers: AT+FTPSTATE
    Answer: 1
    Send command with 2 answers: AT+FTPGETNAME="/UPGRADE.TXT"
    Answer: 1
    Send command with 2 answers: AT+FTPGETPATH=".gprs"
    Answer: 1
    Send command with 2 answers: AT+FTPSIZE
    Answer: 0
    Return from readDataFTP: -23
    ftp_size: -23
    ftp_retries: 1
    file size SD: 0
    Send command with 2 answers: AT+SAPBR=0,1
    Answer: 1
    Error code:-32
Could you help me?

Thanks in advance,
Vincenzo

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

Re: Problem witho OTA GPRS

Post by libelium-dev » Mon Nov 14, 2016 9:30 am

Hi,

First delete the UPGRADE.TXT file and the ota file of the ftp server because the current files on the server may not be correct. Now follow the Over the Air Programming Guide (OTAP) (v12) to create the UPGRADE.TXT file and run OTA properly.

Regards

vinche84
Posts: 40
Joined: Mon Sep 26, 2016 9:59 am

Re: Problem witho OTA GPRS

Post by vinche84 » Tue Nov 15, 2016 12:29 am

I tried what you suggest.
I created an UPGRADE.TXT file with this information:
FILE:UT_02_U
PATH:/demo
SIZE:14516
VERSION:7
This is whayt i obtain:
  • Inside readDataFTP
    FTP file: /UPGRADE.TXT
    SD file:/UPGRADE.TXT
    Send command with 2 answers: AT+FTPSTATE
    Answer: 1
    Inside FTPsize
    Send command with 2 answers: AT+FTPSTATE
    Answer: 1
    Send command with 2 answers: AT+FTPGETNAME="/UPGRADE.TXT"
    Answer: 1
    Send command with 2 answers: AT+FTPGETPATH="/"
    Answer: 1
    Send command with 2 answers: AT+FTPSIZE
    Answer: 1
    Size in FTP: 44
    Send command with 2 answers: AT+FTPGETNAME="/UPGRADE.TXT"
    Answer: 1
    Send command with 2 answers: AT+FTPGETPATH="/"
    Answer: 1
    Send command with 2 answers: AT+FTPGET=1
    Answer: 1
    Send command with 2 answers: AT+FTPGET=2,250
    Answer: 1
    FTP data: 44
    Bytes stored: 44/44
    Inside FTPsize
    Send command with 2 answers: AT+FTPSTATE
    Answer: 1
    Send command with 2 answers: AT+FTPGETNAME="/UPGRADE.TXT"
    Answer: 1
    Send command with 2 answers: AT+FTPGETPATH="/"
    Answer: 1
    Send command with 2 answers: AT+FTPSIZE
    Answer: 1
    Size in FTP: 44
    Return from readDataFTP: -18
    ftp_size: 44
    ftp_retries: 3
    file size SD: -1
    Inside readDataFTP
    FTP file: /UPGRADE.TXT
    SD file:/UPGRADE.TXT
    Send command with 2 answers: AT+FTPSTATE
    Answer: 1
    Inside FTPsize
    Send command with 2 answers: AT+FTPSTATE
    Answer: 1
    Send command with 2 answers: AT+FTPGETNAME="/UPGRADE.TXT"
    Answer: 1
    Send command with 2 answers: AT+FTPGETPATH="/"
    Answer: 1
    Send command with 2 answers: AT+FTPSIZE
    Answer: 1
    Size in FTP: 44
    Return from readDataFTP: -16
    ftp_size: 44
    ftp_retries: 2
    file size SD: -1
    Inside readDataFTP
    FTP file: /UPGRADE.TXT
    SD file:/UPGRADE.TXT
    Send command with 2 answers: AT+FTPSTATE
    Answer: 1
    Inside FTPsize
    Send command with 2 answers: AT+FTPSTATE
    Answer: 1
    Send command with 2 answers: AT+FTPGETNAME="/UPGRADE.TXT"
    Answer: 1
    Send command with 2 answers: AT+FTPGETPATH="/"
    Answer: 1
    Send command with 2 answers: AT+FTPSIZE
    Answer: 1
    Size in FTP: 44
    Return from readDataFTP: -16
    ftp_size: 44
    ftp_retries: 1
    file size SD: -1
    Send command with 2 answers: AT+SAPBR=0,1
    Answer: 1
    Error code:-25
What is wrong?

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

Re: Problem witho OTA GPRS

Post by libelium-dev » Tue Nov 15, 2016 9:10 am

Hi,

The errors that you get in the last output are referred to the SD card. Please format the sd card with the example code SD 12: Format SD and try again.

Regards

vinche84
Posts: 40
Joined: Mon Sep 26, 2016 9:59 am

Re: Problem witho OTA GPRS

Post by vinche84 » Tue Nov 15, 2016 9:27 am

I tried what you suggest, but output error is the same...
Could I control something else?

Thanks,
Vincenzo

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

Re: Problem witho OTA GPRS

Post by libelium-dev » Tue Nov 15, 2016 2:32 pm

Hi,

Could you try with the tgprs@libelium.com server? Don't change the files, we have done some test and they work.

Run the following code, just change the apn, login and password settings.

Code: Select all

#include <WaspGPRS_Pro.h>
int answer, counter;

char apn[] = "apn";
char login[] = "login";
char password[] = "password";

void setup(){
    
    //Check if the program has been programmed succesfully
    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"));
    }
    GPRS_Pro.set_APN(apn, login, password);
    Utils.setProgramVersion(1);
    USB.print(F("Program version: "));
    USB.println(Utils.getProgramVersion(), DEC);
    
}


void loop(){
    
    //*****************************************************************
    //    OTA standart loop
    //*****************************************************************
    
    //Starts the GPRS_Pro module
    answer = GPRS_Pro.ON();
    
    //Checks the start sequence: 1 for correct start and -3 for correct start with low battery level
    if ((answer == 1) || (answer == -3))
    {
        USB.println(F("GPRS_Pro module ready..."));
        USB.println(F("Connecting to the network")); 
        
        answer = GPRS_Pro.check(60);
        
        if (answer == 1)
        {              
            USB.println(F("GPRS_Pro module connected to the network")); 
            USB.println(F("Starting OTA process")); 
            
            answer = GPRS_Pro.requestOTA("pruebas.libelium.com", "21", "tgprs@libelium.com", "ftp1234");
            
            // If OTA process fails, show the error code
            USB.print(F("Error code:"));
            USB.println( answer, DEC);
        }
        else
        {
            USB.println(F("Error connecting to the network"));                
        }
    }
    else
    {
        USB.println(F("Error starting the GPRS_Pro module"));        
    }
        
    GPRS_Pro.OFF();
}
Regards

vinche84
Posts: 40
Joined: Mon Sep 26, 2016 9:59 am

Re: Problem witho OTA GPRS

Post by vinche84 » Tue Nov 15, 2016 11:37 pm

Thanks for your suggestions! I succeded in OTA procedure on your ftp server, but a new problem occurred,
I tried 4 times OTA procedure, and during the last something got wrong: now I'm not enable to program the waspmote by IDE! When I try I get the error "avrdude: stk500_getsync(): not in sync: resp=0x00"

I tried to charge waspmote, change USB cable, restar PC, but nothing..
What could I do?

Thanks in advance,
Vincenzo

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

Re: Problem witho OTA GPRS

Post by libelium-dev » Wed Nov 16, 2016 11:30 am

Hi,

Please charge the battery for a few hours. Also make sure the right COM port is selected and the switch is in the ON position.

What IDE version are you using?

Regards

vinche84
Posts: 40
Joined: Mon Sep 26, 2016 9:59 am

Re: Problem witho OTA GPRS

Post by vinche84 » Wed Nov 16, 2016 12:00 pm

IDE version 04, API version 023.
I charged for 3 hours and the COM is right..
The switch is in ON position when I try to upload program and in OFF position when I charge.

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

Re: Problem witho OTA GPRS

Post by libelium-dev » Wed Nov 16, 2016 5:53 pm

Hi,

Please fill the RMA form and our tech support team will contact you to solve the issue.

http://www.libelium.com/contact/#RMA

Thanks.

Post Reply

Who is online

Users browsing this forum: No registered users and 1 guest