Some help needed

Using OTA functions with Waspmote
raeroman
Posts: 21
Joined: Thu Aug 04, 2016 9:43 pm

Some help needed

Post by raeroman » Fri Aug 19, 2016 5:51 pm

Hi Dev Team,
I have some problems with OTA via grps.
I use my own ftp server (core ftp server), when I use your test server works fine but when I run in my server we have problems
( I already change the core.cpp file to delete .gprs folder in the two lines 7034,7102)

part of the code with debug 1 .....

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
Send command with 2 answers: AT+FTPGET=2,250
Answer: 1
FTP data: 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="/"
Answer: 1
Send command with 2 answers: AT+FTPSIZE
Answer: 1
Size in FTP: 44
Return from readDataFTP: 1
ftp_size: 44
ftp_retries: 3
file size SD: 44
Send command with 2 answers: AT+SAPBR=0,1
Answer: 1
OTA file: PWR_04_
File path: /

Version: 11
Downloading OTA FILE
Send command with 1 answer: AT
Answer: 0
Send command with 1 answer: AT
Answer: 0
Send command with 1 answer: AT
Answer: 0
Send command with 1 answer: AT
Answer: 0
Send command with 1 answer: AT
Answer: 0
Send command with 1 answer: AT
Answer: 0
GPRS status: 0
RESTARTING

Regards

Ramiro

raeroman
Posts: 21
Joined: Thu Aug 04, 2016 9:43 pm

Re: Some help needed

Post by raeroman » Fri Aug 19, 2016 9:30 pm

raeroman wrote:Hi Dev Team,
I have some problems with OTA via grps.
I use my own ftp server (core ftp server, filezilla), when I use your test server works fine but when I run in my server we have problems
( I already change the core.cpp file to delete .gprs folder in the two lines 7034,7102)

part of the code with debug 1 .....

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
Send command with 2 answers: AT+FTPGET=2,250
Answer: 1
FTP data: 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="/"
Answer: 1
Send command with 2 answers: AT+FTPSIZE
Answer: 1
Size in FTP: 44
Return from readDataFTP: 1
ftp_size: 44
ftp_retries: 3
file size SD: 44
Send command with 2 answers: AT+SAPBR=0,1
Answer: 1
OTA file: PWR_04_
File path: /

Version: 11
Downloading OTA FILE
Send command with 1 answer: AT
Answer: 0
Send command with 1 answer: AT
Answer: 0
Send command with 1 answer: AT
Answer: 0
Send command with 1 answer: AT
Answer: 0
Send command with 1 answer: AT
Answer: 0
Send command with 1 answer: AT
Answer: 0
GPRS status: 0
RESTARTING

Regards

Ramiro
My UPGRADE.TXT file
FILE:PWR_04_
PATH:/
SIZE:17268
VERSION:11

With Debug 2

...
+FTPGET:2
Length: 11
Command answer 2:
+FTPGET:2,
Length: 12
Answer: 1
FTP data: 0
Answer 1: +FTPGET:1,0
Answer 2: +FTPGET:1,0
Command answer 1:

Length: 1
Command answer 1:

Length: 2
Command answer 1:
O
Length: 3
Command answer 1:
OK
Length: 4
Command answer 1:
OK

Length: 5
Command answer 1:
OK

Length: 6
Command answer 1:
OK


Length: 7
Command answer 1:
OK


Length: 8
Command answer 1:
OK

+
Length: 9
Command answer 1:
OK

+F
Length: 10
Command answer 1:
OK

+FT
Length: 11
Command answer 1:
OK

+FTP
Length: 12
Command answer 3:
OK

+FTPG
Length: 12
Command answer 3: OK

+FTPGE
Length: 12
Command answer 3: K

+FTPGET
Length: 12
Command answer 3:

+FTPGET:
Length: 12
Command answer 3:

+FTPGET:1
Length: 12
Command answer 3:
+FTPGET:1,
Length: 12
Command answer 3:
+FTPGET:1,0
Length: 12
Inside FTPsize
Send command with 2 answers: AT+FTPSTATE
Answer 1: +FTPSTATE
Answer 2: +CME ERROR:
Command answer 1:

Length: 1
Command answer 1:

Length: 2
Command answer 1:
+
Length: 3
Command answer 1:
+F
Length: 4
Command answer 1:
+FT
Length: 5
Command answer 1:
+FTP
Length: 6
Command answer 1:
+FTPS
Length: 7
Command answer 1:
+FTPST
Length: 8
Command answer 1:
+FTPSTA
Length: 9
Command answer 1:
+FTPSTAT
Length: 10
Command answer 2:
+FTPSTATE
Length: 11
Answer: 1
Send command with 2 answers: AT+FTPGETNAME="/UPGRADE.TXT"
Answer 1: OK
Answer 2: +CME ERROR:
Command answer 1:

Length: 1
Command answer 1:

Length: 2
Command answer 1:
O
Length: 3
Command answer 2:
OK
Length: 4
Answer: 1
Send command with 2 answers: AT+FTPGETPATH="/"
Answer 1: OK
Answer 2: +CME ERROR:
Command answer 1:

Length: 1
Command answer 1:

Length: 2
Command answer 1:
O
Length: 3
Command answer 2:
OK
Length: 4
Answer: 1
Send command with 2 answers: AT+FTPSIZE
Answer 1: +FTPSIZE:1,0,
Answer 2: +CME ERROR:
Command answer 1:

Length: 1
Command answer 1:

Length: 2
Command answer 1:
O
Length: 3
Command answer 1:
OK
Length: 4
Command answer 1:
OK

Length: 5
Command answer 1:
OK

Length: 6
Command answer 1:
OK


Length: 7
Command answer 1:
OK


Length: 8
Command answer 1:
OK

+
Length: 9
Command answer 1:
OK

+F
Length: 10
Command answer 1:
OK

+FT
Length: 11
Command answer 1:
OK

+FTP
Length: 12
Command answer 2:
OK

+FTPS
Length: 13
Command answer 2:
OK

+FTPSI
Length: 14
Command answer 3:
OK

+FTPSIZ
Length: 14
Command answer 3: OK

+FTPSIZE
Length: 14
Command answer 3: K

+FTPSIZE:
Length: 14
Command answer 3:

+FTPSIZE:1
Length: 14
Command answer 3:

+FTPSIZE:1,
Length: 14
Command answer 3:
+FTPSIZE:1,0
Length: 14
Command answer 3:
+FTPSIZE:1,0,
Length: 14
Answer: 1
Size in FTP: 43
Return from readDataFTP: 1
ftp_size: 43
ftp_retries: 3
file size SD: 43
Send command with 2 answers: AT+SAPBR=0,1
Answer 1: OK
Answer 2: +CME ERROR:
Command answer 1:

Length: 1
Command answer 1:

Length: 2
Command answer 1:
O
Length: 3
Command answer 2:
OK
Length: 4
Answer: 1
OTA file: PWR_04_
File path: /

Version: 5
Downloading OTA FILE
Send command with 1 answer: AT
Answer 1:
Answer 2:
Answer: 0
Send command with 1 answer: AT
Answer 1:
Answer 2:
Answer: 0
Send command with 1 answer: AT
Answer 1:
Answer 2:
Answer: 0
Send command with 1 answer: AT
Answer 1:
Answer 2:
Answer: 0
Send command with 1 answer: AT
Answer 1:
Answer 2:
Answer: 0
GPRS status: 0
RESTARTING

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

Re: Some help needed

Post by libelium-dev » Mon Aug 22, 2016 1:12 pm

Hi,

We see no error in the output, it seems that OTA works correctly. What code you are uploading?

Regards.

raeroman
Posts: 21
Joined: Thu Aug 04, 2016 9:43 pm

Re: Some help needed

Post by raeroman » Mon Aug 22, 2016 4:54 pm

Hi

The following code

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

// tarjeta SIM
char APN_Operador[]="internet.***.***.**";
char APN_Usuario[]="";
char APN_Password[]="";
char pin_code[5] = "";


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"));
}
USB.print(F("Program version: "));
USB.println(Utils.getProgramVersion(), DEC);


// put your setup code here, to run once:

}


void loop(){

//*****************************************************************
// User loop program
//*****************************************************************

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


//*****************************************************************
// 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("201.***.***.***", "21", "***", "***");

// 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();
}


Also attached the print screen of log of FileZilla

Logged on
Warning: FTP over TLS is not enabled, users cannot securely log in.
(000430)22/08/16 09:36:23 - (not logged in) (200.85.83.113)> Connected on port 21, sending welcome message...
(000430)22/08/16 09:36:24 - (not logged in) (200.85.83.113)> USER xxx
(000430)22/08/16 09:36:24 - (not logged in) (200.85.83.113)> 331 Password required for admin
(000430)22/08/16 09:36:27 - (not logged in) (200.85.83.113)> PASS xxx
(000430)22/08/16 09:36:27 - admin (200.85.83.113)> 230 Logged on
(000430)22/08/16 09:36:27 - admin (200.85.83.113)> TYPE I
(000430)22/08/16 09:36:27 - admin (200.85.83.113)> 200 Type set to I
(000430)22/08/16 09:36:28 - admin (200.85.83.113)> SIZE //UPGRADE.TXT
(000430)22/08/16 09:36:28 - admin (200.85.83.113)> 213 50
(000430)22/08/16 09:36:29 - admin (200.85.83.113)> QUIT
(000430)22/08/16 09:36:29 - admin (200.85.83.113)> 221 Goodbye
(000430)22/08/16 09:36:29 - admin (200.85.83.113)> disconnected.
(000431)22/08/16 09:36:37 - (not logged in) (200.85.83.113)> Connected on port 21, sending welcome message...
(000431)22/08/16 09:36:41 - (not logged in) (200.85.83.113)> USER xxx
(000431)22/08/16 09:36:41 - (not logged in) (200.85.83.113)> 331 Password required for admin
(000431)22/08/16 09:36:42 - (not logged in) (200.85.83.113)> PASS xxx
(000431)22/08/16 09:36:42 - admin (200.85.83.113)> 230 Logged on
(000431)22/08/16 09:36:42 - admin (200.85.83.113)> TYPE I
(000431)22/08/16 09:36:42 - admin (200.85.83.113)> 200 Type set to I
(000431)22/08/16 09:36:43 - admin (200.85.83.113)> PASV
(000431)22/08/16 09:36:43 - admin (200.85.83.113)> 227 Entering Passive Mode (201,xxx,xxx,xxx,247,174)
(000431)22/08/16 09:36:47 - admin (200.85.83.113)> RETR //UPGRADE.TXT
(000431)22/08/16 09:36:47 - admin (200.85.83.113)> 150 Opening data channel for file download from server of "/UPGRADE.TXT"
(000431)22/08/16 09:36:47 - admin (200.85.83.113)> 226 Successfully transferred "/UPGRADE.TXT"
(000431)22/08/16 09:37:02 - admin (200.85.83.113)> QUIT
(000431)22/08/16 09:37:02 - admin (200.85.83.113)> 221 Goodbye
(000431)22/08/16 09:37:02 - admin (200.85.83.113)> disconnected.
(000432)22/08/16 09:37:06 - (not logged in) (200.85.83.113)> Connected on port 21, sending welcome message...
(000432)22/08/16 09:37:10 - (not logged in) (200.85.83.113)> USER xxx
(000432)22/08/16 09:37:10 - (not logged in) (200.85.83.113)> 331 Password required for admin
(000432)22/08/16 09:37:11 - (not logged in) (200.85.83.113)> PASS xxx
(000432)22/08/16 09:37:11 - admin (200.85.83.113)> 230 Logged on
(000432)22/08/16 09:37:13 - admin (200.85.83.113)> TYPE I
(000432)22/08/16 09:37:13 - admin (200.85.83.113)> 200 Type set to I
(000432)22/08/16 09:37:16 - admin (200.85.83.113)> SIZE //UPGRADE.TXT
(000432)22/08/16 09:37:16 - admin (200.85.83.113)> 213 50
(000432)22/08/16 09:37:17 - admin (200.85.83.113)> QUIT
(000432)22/08/16 09:37:17 - admin (200.85.83.113)> 221 Goodbye
(000432)22/08/16 09:37:17 - admin (200.85.83.113)> disconnected.

raeroman
Posts: 21
Joined: Thu Aug 04, 2016 9:43 pm

Re: Some help needed

Post by raeroman » Mon Aug 22, 2016 6:27 pm

One more thing,
If I run debug 1 in my own FTP server the log is:
(I test in several FTP Servers, included external ftp Hosting)
....
OTA file: PWR_04_
File path: /

Version: 11
Downloading OTA FILE
Send command with 1 answer: AT
Answer: 0
Send command with 1 answer: AT
Answer: 0
Send command with 1 answer: AT
Answer: 0
Send command with 1 answer: AT
Answer: 0
GPRS status: 0
RESTARTING


But if I run the code with libelium ftp test server I have the following response:
....
OTA file: OTA_PRU
File path: /
Version: 4
Downloading OTA FILE
Send command with 1 answer: AT+CGREG?
Answer: 1
GPRS status: 5

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

Re: Some help needed

Post by libelium-dev » Tue Aug 23, 2016 1:27 pm

Hi raeroman,

We attach the information of configuration of our ftp server. Due to it's working the OTA process at our server maybe you can configure your server at the same way to try to solve the issue.
http://www.libelium.com/forum/libelium_ ... server.txt

Regards

raeroman
Posts: 21
Joined: Thu Aug 04, 2016 9:43 pm

Re: Some help needed

Post by raeroman » Tue Aug 23, 2016 1:59 pm

Thank you,
It is possible for to send the upgrade.txt file and the path of files ( directory) in your server ?
Which ftp server do you use? Pure ftp?

Regards

raeroman
Posts: 21
Joined: Thu Aug 04, 2016 9:43 pm

Re: Some help needed

Post by raeroman » Tue Aug 23, 2016 4:18 pm

raeroman wrote:Thank you,
It is possible for to send the upgrade.txt file and the path of files ( directory) in your server ?
Which ftp server do you use? Pure ftp?

I review the attached file, is VSFTP, sorry...

Please help me with the UPGRADE.TXT and the path... thanks


Regards

raeroman
Posts: 21
Joined: Thu Aug 04, 2016 9:43 pm

Re: Some help needed

Post by raeroman » Tue Aug 23, 2016 6:45 pm

raeroman wrote:
raeroman wrote:Thank you,
It is possible for to send the upgrade.txt file and the path of files ( directory) in your server ?
Which ftp server do you use? Pure ftp?

I review the attached file, is VSFTP, sorry...

Today I tried again with Libelium server, but exist some erros, yesterday the file for upgrade file was OTA_PRU, today is UT_02_U, maybe the size of the file?
---


Inside FTPsize
Send command with 2 answers: AT+FTPSTATE
Answer: 1
Send command with 2 answers: AT+FTPGETNAME="/UT_02_U"
Answer: 1
Send command with 2 answers: AT+FTPGETPATH="/
"
special error3
Answer: 2
Return from readDataFTP: -54
ftp_size: -54
ftp_retries: 2
file size SD: 0
Inside readDataFTP
FTP file: /
/UT_02_U
SD file:UT_02_U
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="/UT_02_U"
Answer: 1
Send command with 2 answers: AT+FTPGETPATH="/
"
special error3
Answer: 2
Inside FTPsize
Send command with 2 answers: AT+FTPSTATE
Answer: 1
Send command with 2 answers: AT+FTPGETNAME="/UT_02_U"
Answer: 1
Send command with 2 answers: AT+FTPGETPATH="/
"
special error3
Answer: 2
Return from readDataFTP: -54
ftp_size: -54
ftp_retries: 1
file size SD: 0
Send command with 2 answers: AT+SAPBR=0,1
Answer: 1
Error code:-125
Debug mode 1
not_ready: 1
not_ready: 1
not_ready: 0
Send command with 1 answer: AT+CMEE=1
Answer: 1
Send command


Regards

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

Re: Some help needed

Post by libelium-dev » Wed Aug 24, 2016 9:33 am

Hi,

We were doing tests and changed the files. You should modify UPGRADE.TXT file with the name of your file, size and version.

Regards.

Post Reply

Who is online

Users browsing this forum: No registered users and 1 guest