requestOTA not working in WIFI V15 with the latest API V027

asaf1234567
Posts: 9
Joined: Thu Nov 03, 2016 10:27 am

requestOTA not working in WIFI V15 with the latest API V027

Post by asaf1234567 » Fri Feb 24, 2017 11:22 pm

in contniues to the post in :
viewtopic.php?f=30&t=16151

i have the same problem with the OTA in WIFI.

This is what i am getting after running the sample:

H#
Start program
***************************************
Once the module is set with one or more
AP settings, it attempts to join the AP
automatically once it is powered on
Refer to example 'WIFI_PRO_01' to configure
the WiFi module with proper settings
***************************************
RESTARTING
-------------------------------
Program id: ÿÿÿÿÿÿÿ
Program version: 255
-------------------------------
1. WiFi switched ON
2. WiFi is connected OK Time(ms):3357
2.1. Connection Status:
-------------------------------
Rate (Mbps):54
Signal Level (%):73
Link Quality(%):61
-------------------------------
2.2. Request OTA...
--------------------------------
[WIFI] FILE:SKETCH_
[WIFI] PATH:/
[WIFI] SIZE:16440
[WIFI] VERSION:0
--------------------------------
==> ERROR CODE: 0
==> ERROR CODE: 30
1
3. WiFi switched OFF
Wait...


I have the SKETCH_ in the root folder

what is the problem ????

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

Re: requestOTA not working in WIFI V15 with the latest API V

Post by libelium-dev » Mon Feb 27, 2017 9:58 am

Hi,

Are you using the example code? Are you trying with our test server?
Server: pruebas.libelium.com
WIFI user: w@libelium.com
GPRS user: tgprs@libelium.com
3G user: t3g@libelium.com
Pass: ftp1234
Please try with our test server and post the output with debug mode 1.

Regards

asaf1234567
Posts: 9
Joined: Thu Nov 03, 2016 10:27 am

Re: requestOTA not working in WIFI V15 with the latest API V

Post by asaf1234567 » Mon Feb 27, 2017 2:26 pm

this is what i am getting when running the exact example for OTA

H#
Start program
***************************************
Once the module is set with one or more
AP settings, it attempts to join the AP
automatically once it is powered on
Refer to example 'WIFI_PRO_01' to configure
the WiFi module with proper settings
***************************************
RESTARTING
-------------------------------
Program id: ÿÿÿÿÿÿÿ
Program version: 255
-------------------------------
1. WiFi switched ON
2. WiFi is connected OK Time(ms):2809
2.1. Connection Status:
-------------------------------
Rate (Mbps):54
Signal Level (%):84
Link Quality(%):72
-------------------------------
2.2. Request OTA...
==> ERROR CODE: 0
3. WiFi switched OFF
Wait...


1. WiFi switched ON
2. WiFi is connected OK Time(ms):2250
2.1. Connection Status:
-------------------------------
Rate (Mbps):54
Signal Level (%):85
Link Quality(%):73
-------------------------------
2.2. Request OTA...
==> ERROR CODE: 0
3. WiFi switched OFF
Wait...

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

Re: requestOTA not working in WIFI V15 with the latest API V

Post by libelium-dev » Tue Feb 28, 2017 12:06 pm

Hi,

Could you post the output with debug mode 1 enable?

Also include the next line of code in before USB.println(Utils.getProgramVersion(),DEC);

Code: Select all

  Utils.setProgramVersion(1);
  // show program version number
  USB.print(F("Program version: "));
  USB.println(Utils.getProgramVersion(),DEC);
Regards

asaf1234567
Posts: 9
Joined: Thu Nov 03, 2016 10:27 am

Re: requestOTA not working in WIFI V15 with the latest API V

Post by asaf1234567 » Tue Feb 28, 2017 4:07 pm

this is the log with debug mode 2

(the code i am running is bellow)

H#
Program version: 1
OLD VERSION
Start program
***************************************
Once the module is set with one or more
AP settings, it attempts to join the AP
automatically once it is powered on
Refer to example 'WIFI_PRO_01' to configure
the WiFi module with proper settings
***************************************
REPROGRAMMING ERROR-------------------------------
Program id: ÿÿÿÿÿÿÿ
Program version: 255
-------------------------------
[WIFI] no answer received
[WIFI] no answer received
1. WiFi switched ON
[WIFI] _command: AT+iRP10

[WIFI] reportStatus:AT+iRP10
I/(2,54,100,0)

[WIFI] port:2
[WIFI] _rate:54
[WIFI] _level:100
[WIFI] _quality:0
[WIFI] reportStatus:2
[WIFI] _command: AT+iRP10

[WIFI] reportStatus:AT+iRP10
I/(2,54,100,0)

[WIFI] port:2
[WIFI] _rate:54
[WIFI] _level:100
[WIFI] _quality:0
[WIFI] reportStatus:2
[WIFI] _command: AT+iRP10

[WIFI] reportStatus:AT+iRP10
I/(2,54,100,0)

[WIFI] port:2
[WIFI] _rate:54
[WIFI] _level:100
[WIFI] _quality:0
[WIFI] reportStatus:2
[WIFI] _command: AT+iRP10

[WIFI] reportStatus:AT+iRP10
I/(2,54,73,61)

[WIFI] port:2
[WIFI] _rate:54
[WIFI] _level:73
[WIFI] _quality:61
[WIFI] reportStatus:2
[WIFI] _command: AT+iRP10

[WIFI] reportStatus:AT+iRP10
I/(4,54,75,63)

[WIFI] port:4
[WIFI] _rate:54
[WIFI] _level:75
[WIFI] _quality:63
[WIFI] _command: AT+iIPA?

2. WiFi is connected OK Time(ms):3104
2.1. Connection Status:
-------------------------------
Rate (Mbps):54
Signal Level (%):75
Link Quality(%):63
-------------------------------
2.2. Request OTA...
[WIFI] Downloading OTA config file...
[WIFI] _command: AT+iFOPN:10.10.10.1,21,ota,libelium

[WIFI] FTP openSession TIMEOUT
[WIFI] Error opening FTP session
[WIFI] ==> ERROR CODE: Timeout
3. WiFi switched OFF
Wait...


[WIFI] no answer received
[WIFI] no answer received
1. WiFi switched ON
[WIFI] _command: AT+iRP10

[WIFI] reportStatus:AT+iRP10
I/(2,54,100,0)

[WIFI] port:2
[WIFI] _rate:54
[WIFI] _level:100
[WIFI] _quality:0
[WIFI] reportStatus:2
[WIFI] _command: AT+iRP10

[WIFI] reportStatus:AT+iRP10
I/(2,54,100,0)

[WIFI] port:2
[WIFI] _rate:54
[WIFI] _level:100
[WIFI] _quality:0
[WIFI] reportStatus:2
[WIFI] _command: AT+iRP10

[WIFI] reportStatus:AT+iRP10
I/(2,54,100,0)

[WIFI] port:2
[WIFI] _rate:54
[WIFI] _level:100
[WIFI] _quality:0
[WIFI] reportStatus:2
[WIFI] _command: AT+iRP10

[WIFI] reportStatus:AT+iRP10
I/(4,54,75,63)

[WIFI] port:4
[WIFI] _rate:54
[WIFI] _level:75
[WIFI] _quality:63
[WIFI] _command: AT+iIPA?

2. WiFi is connected OK Time(ms):2469
2.1. Connection Status:
-------------------------------
Rate (Mbps):54
Signal Level (%):75
Link Quality(%):63
-------------------------------
2.2. Request OTA...
[WIFI] Downloading OTA config file...
[WIFI] _command: AT+iFOPN:10.10.10.1,21,ota,libelium

[WIFI] FTP openSession TIMEOUT
[WIFI] Error opening FTP session
[WIFI] ==> ERROR CODE: Timeout
3. WiFi switched OFF
Wait...


[WIFI] no answer received
[WIFI] no answer received
1. WiFi switched ON
[WIFI] _command: AT+iRP10

[WIFI] reportStatus:AT+iRP10
I/(2,54,100,0)

[WIFI] port:2
[WIFI] _rate:54
[WIFI] _level:100
[WIFI] _quality:0
[WIFI] reportStatus:2
[WIFI] _command: AT+iRP10

[WIFI] reportStatus:AT+iRP10
I/(2,54,100,0)

[WIFI] port:2
[WIFI] _rate:54
[WIFI] _level:100
[WIFI] _quality:0
[WIFI] reportStatus:2
[WIFI] _command: AT+iRP10

[WIFI] reportStatus:AT+iRP10
I/(2,54,100,0)

[WIFI] port:2
[WIFI] _rate:54
[WIFI] _level:100
[WIFI] _quality:0
[WIFI] reportStatus:2
[WIFI] _command: AT+iRP10

[WIFI] reportStatus:AT+iRP10
I/(2,54,78,66)

[WIFI] port:2
[WIFI] _rate:54
[WIFI] _level:78
[WIFI] _quality:66
[WIFI] reportStatus:2
[WIFI] _command: AT+iRP10

[WIFI] reportStatus:AT+iRP10
I/(4,54,78,66)

[WIFI] port:4
[WIFI] _rate:54
[WIFI] _level:78
[WIFI] _quality:66
[WIFI] _command: AT+iIPA?

2. WiFi is connected OK Time(ms):3106
2.1. Connection Status:
-------------------------------
Rate (Mbps):54
Signal Level (%):78
Link Quality(%):66
-------------------------------
2.2. Request OTA...
[WIFI] Downloading OTA config file...
[WIFI] _command: AT+iFOPN:10.10.10.1,21,ota,libelium

[WIFI] FTP openSession TIMEOUT
[WIFI] Error opening FTP session
[WIFI] ==> ERROR CODE: Timeout
3. WiFi switched OFF
Wait...



and this is the code i am running:


/*
* ------ WIFI Example --------
*
* Explanation: This example shows how perform OTA programming using the
* WiFi module. It is necessary to specify the correct AP settings.
* Besides, it is necessary to setup an FTP server and change the parameters
* defined in the example.
*
* Copyright (C) 2017 Libelium Comunicaciones Distribuidas S.L.
* http://www.libelium.com
*
* This program is free software: you can redistribute it and/or modify
* it under the terms of the GNU General Public License as published by
* the Free Software Foundation, either version 3 of the License, or
* (at your option) any later version.
*
* This program is distributed in the hope that it will be useful,
* but WITHOUT ANY WARRANTY; without even the implied warranty of
* MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the
* GNU General Public License for more details.
*
* You should have received a copy of the GNU General Public License
* along with this program. If not, see <http://www.gnu.org/licenses/>.
*
* Version: 3.1
* Design: David Gascon
* Implementation: Yuri Carmona
*/

// include WiFi library
#include <WaspWIFI_PRO.h>


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

// FTP server settings
/////////////////////////////////
char server[] = "10.10.10.1";
char port[] = "21";
char user[] = "ota";
char password[] = "libelium";
/////////////////////////////////


// define variables
uint8_t error;
uint8_t status;
unsigned long previous;
int8_t answer;
char programID[10];

void setup()
{
USB.ON();

Utils.setProgramVersion(1);
// show program version number
USB.print(F("Program version: "));
USB.println(Utils.getProgramVersion(),DEC);



USB.println(F("OLD VERSION"));
USB.println(F("Start program"));
USB.println(F("***************************************"));
USB.println(F("Once the module is set with one or more"));
USB.println(F("AP settings, it attempts to join the AP"));
USB.println(F("automatically once it is powered on"));
USB.println(F("Refer to example 'WIFI_PRO_01' to configure"));
USB.println(F("the WiFi module with proper settings"));
USB.println(F("***************************************"));

//////////////////////////////////////////////////
// 1. Check if the program has been programmed ok
//////////////////////////////////////////////////
answer = Utils.checkNewProgram();

switch (answer)
{
case 0:
USB.print(F("REPROGRAMMING ERROR"));
Utils.blinkRedLED(300, 3);
break;

case 1:
USB.println(F("REPROGRAMMING OK"));
Utils.blinkGreenLED(300, 3);
break;

default:
USB.println(F("RESTARTING"));
Utils.blinkGreenLED(500, 1);
}


// show program ID
Utils.getProgramID(programID);
USB.println(F("-------------------------------"));
USB.print(F("Program id: "));
USB.println(programID);

// show program version number
USB.print(F("Program version: "));
USB.println(Utils.getProgramVersion(),DEC);
USB.println(F("-------------------------------"));


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

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

}


void loop()
{
//////////////////////////////////////////////////
// 3. User loop program
//////////////////////////////////////////////////

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



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

//////////////////////////////
// 4.1. Switch ON
//////////////////////////////
error = WIFI_PRO.ON(socket);

if (error == 0)
{
USB.println(F("1. WiFi switched ON"));
}
else
{
USB.println(F("1. WiFi did not initialize correctly"));
}


//////////////////////////////
// 4.2. Check if connected
//////////////////////////////
// get actual time
previous = millis();

// check connectivity
status = WIFI_PRO.isConnected();

// Check if module is connected
if (status == true)
{
USB.print(F("2. WiFi is connected OK"));
USB.print(F(" Time(ms):"));
USB.println(millis()-previous);


USB.println(F("2.1. Connection Status:"));
USB.println(F("-------------------------------"));
USB.print(F("Rate (Mbps):"));
USB.println(WIFI_PRO._rate);
USB.print(F("Signal Level (%):"));
USB.println(WIFI_PRO._level);
USB.print(F("Link Quality(%):"));
USB.println(WIFI_PRO._quality);
USB.println(F("-------------------------------"));

//////////////////////////////
// 4.3. Request OTA
//////////////////////////////
USB.println(F("2.2. Request OTA..."));
error = WIFI_PRO.requestOTA(server, port, user, password);

// If OTA fails, show the error code
WIFI_PRO.printErrorCode();
Utils.blinkRedLED(300, 3);

}
else
{
USB.print(F("2. WiFi is connected ERROR"));
USB.print(F(" Time(ms):"));
USB.println(millis()-previous);
Utils.blinkRedLED(100, 10);
}


//////////////////////////////////////////////////
// 5. Switch OFF
//////////////////////////////////////////////////
WIFI_PRO.OFF(socket);
USB.println(F("3. WiFi switched OFF"));
USB.println(F("Wait...\n\n"));
delay(10000);


}

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

Re: requestOTA not working in WIFI V15 with the latest API V

Post by libelium-dev » Wed Mar 01, 2017 9:26 am

Hi,

Are you trying to do OTA through Meshlium FTP Server? If not, please change the FTP server settings by our testing FTP.

Code: Select all

// FTP server settings
/////////////////////////////////
char server[] = "pruebas.libelium.com";
char port[] = "21";
char user[] = "w@libelium.com";
//char user[] = "tgprs@libelium.com";
//char user[] = "t3g@libelium.com";
char password[] = "ftp1234";
/////////////////////////////////
Regards

asaf1234567
Posts: 9
Joined: Thu Nov 03, 2016 10:27 am

Re: requestOTA not working in WIFI V15 with the latest API V

Post by asaf1234567 » Wed Mar 01, 2017 1:55 pm

i changed the ftp settings and still not ok



H#
Program version: 1
OLD VERSION
Start program
***************************************
Once the module is set with one or more
AP settings, it attempts to join the AP
automatically once it is powered on
Refer to example 'WIFI_PRO_01' to configure
the WiFi module with proper settings
***************************************
REPROGRAMMING ERROR-------------------------------
Program id: ÿÿÿÿÿÿÿ
Program version: 255
-------------------------------
[WIFI] no answer received
[WIFI] no answer received
1. WiFi switched ON
[WIFI] _command: AT+iRP10

[WIFI] reportStatus:AT+iRP10
I/(2,54,100,0)

[WIFI] port:2
[WIFI] _rate:54
[WIFI] _level:100
[WIFI] _quality:0
[WIFI] reportStatus:2
[WIFI] _command: AT+iRP10

[WIFI] reportStatus:AT+iRP10
I/(2,54,100,0)

[WIFI] port:2
[WIFI] _rate:54
[WIFI] _level:100
[WIFI] _quality:0
[WIFI] reportStatus:2
[WIFI] _command: AT+iRP10

[WIFI] reportStatus:AT+iRP10
I/(2,54,100,0)

[WIFI] port:2
[WIFI] _rate:54
[WIFI] _level:100
[WIFI] _quality:0
[WIFI] reportStatus:2
[WIFI] _command: AT+iRP10

[WIFI] reportStatus:AT+iRP10
I/(2,54,90,78)

[WIFI] port:2
[WIFI] _rate:54
[WIFI] _level:90
[WIFI] _quality:78
[WIFI] reportStatus:2
[WIFI] _command: AT+iRP10

[WIFI] reportStatus:AT+iRP10
I/(4,54,90,78)

[WIFI] port:4
[WIFI] _rate:54
[WIFI] _level:90
[WIFI] _quality:78
[WIFI] _command: AT+iIPA?

2. WiFi is connected OK Time(ms):3124
2.1. Connection Status:
-------------------------------
Rate (Mbps):54
Signal Level (%):90
Link Quality(%):78
-------------------------------
2.2. Request OTA...
[WIFI] delete file
[WIFI] Downloading OTA config file...
[WIFI] _command: AT+iFOPN:pruebas.libelium.com,21,w@libelium.com,ftp1234

[WIFI] FTP handle: 0
[WIFI] _buffer:000

[WIFI] Open FTP session OK
[WIFI] _command: AT+iBDRA

[WIFI] _command: AT+iFSZ:0,UPGRADE.TXT

[WIFI] FTP file size: 41
[WIFI] _command: AT+iFRCV:0,UPGRADE.TXT

[WIFI] DOWNLOAD OK
[WIFI] sd_filesize:41
[WIFI] server_filesize:41
[WIFI] _command: AT+iBDRA

[WIFI] OTA_ver_file downloaded OK
[WIFI] _command: AT+iFCLS:0

[WIFI] length:-911
[WIFI] ==> ERROR CODE: filename in UPGRADE.TXT is not a 7-byte name
3. WiFi switched OFF
Wait...


[WIFI] no answer received
[WIFI] no answer received
1. WiFi switched ON
[WIFI] _command: AT+iRP10

[WIFI] reportStatus:AT+iRP10
I/(2,54,100,0)

[WIFI] port:2
[WIFI] _rate:54
[WIFI] _level:100
[WIFI] _quality:0
[WIFI] reportStatus:2
[WIFI] _command: AT+iRP10

[WIFI] reportStatus:AT+iRP10
I/(2,54,100,0)

[WIFI] port:2
[WIFI] _rate:54
[WIFI] _level:100
[WIFI] _quality:0
[WIFI] reportStatus:2
[WIFI] _command: AT+iRP10

[WIFI] reportStatus:AT+iRP10
I/(2,54,100,0)

[WIFI] port:2
[WIFI] _rate:54
[WIFI] _level:100
[WIFI] _quality:0
[WIFI] reportStatus:2
[WIFI] _command: AT+iRP10

[WIFI] reportStatus:AT+iRP10
I/(2,54,90,78)

[WIFI] port:2
[WIFI] _rate:54
[WIFI] _level:90
[WIFI] _quality:78
[WIFI] reportStatus:2
[WIFI] _command: AT+iRP10

[WIFI] reportStatus:AT+iRP10
I/(4,54,90,78)

[WIFI] port:4
[WIFI] _rate:54
[WIFI] _level:90
[WIFI] _quality:78
[WIFI] _command: AT+iIPA?

2. WiFi is connected OK Time(ms):3126
2.1. Connection Status:
-------------------------------
Rate (Mbps):54
Signal Level (%):90
Link Quality(%):78
-------------------------------
2.2. Request OTA...
[WIFI] delete file
[WIFI] Downloading OTA config file...
[WIFI] _command: AT+iFOPN:pruebas.libelium.com,21,w@libelium.com,ftp1234

[WIFI] FTP handle: 0
[WIFI] _buffer:000

[WIFI] Open FTP session OK
[WIFI] _command: AT+iBDRA

[WIFI] _command: AT+iFSZ:0,UPGRADE.TXT

[WIFI] FTP file size: 41
[WIFI] _command: AT+iFRCV:0,UPGRADE.TXT

[WIFI] DOWNLOAD OK
[WIFI] sd_filesize:41
[WIFI] server_filesize:41
[WIFI] _command: AT+iBDRA

[WIFI] OTA_ver_file downloaded OK
[WIFI] _command: AT+iFCLS:0

[WIFI] length:-911
[WIFI] ==> ERROR CODE: filename in UPGRADE.TXT is not a 7-byte name
3. WiFi switched OFF
Wait...

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

Re: requestOTA not working in WIFI V15 with the latest API V

Post by libelium-dev » Wed Mar 01, 2017 6:14 pm

Hi,

Did you follow the steps of this guide to create the UPGRADE.TXT file? http://www.libelium.com/downloads/docum ... amming.pdf

Also, as we said in previous posts, include the function Utils.setProgramVersion(1); in the setup of you code because you actual version is 255.

Regards

asaf1234567
Posts: 9
Joined: Thu Nov 03, 2016 10:27 am

Re: requestOTA not working in WIFI V15 with the latest API V

Post by asaf1234567 » Wed Mar 01, 2017 7:23 pm

look at the code i sent !!!!

i am connecting to your FTP server !!!!!!

so if there is an error in the upgrade.txt it's because of your code

enough of this ping pong - we are talking for 3 days !!!!

i want to talk to someone by phone !!!

this can't go on !!!

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

Re: requestOTA not working in WIFI V15 with the latest API V

Post by libelium-dev » Thu Mar 02, 2017 9:24 am

Hi,

We offer our FTP test server so that customers can test this feature. If you want to do OTA you must create the files indicated in the guide for yourself. Many users use our FTP server and modify the files for their tests.

If you want to solve urgent questions Libelium offers Technical Consultancy services to discuss your issue directly with a Libelium R&D engineer. Please contact your sales agent for more information.

Regards

Post Reply

Who is online

Users browsing this forum: No registered users and 1 guest