Forums - QCA4020 http OTA error

5 posts / 0 new
Last post
QCA4020 http OTA error
akshay.b
Join Date: 2 Aug 19
Posts: 62
Posted: Thu, 2019-11-21 02:20

Hello,

I am testing OTA communication over http between two qca4020 boards with QCLI_demo project, one board runs as http server and other board as http client. Below are the commends executed on server and client side, getting error while executing client commands.

SERVER SIDE:

After connecting board to wifi AP.
 
Net> httpsvr init v4 http
 
Net: init selected..........
 
Net: IPv4 selected..........
 
Net: HTTP selected..........
 
Net: SUCCESSFUL to Init HTTP server
 
Net> httpsvr start
 
Net: qapi_Net_HTTPs_Start == QAPI_OK
 
 
CLIENT SIDE:
After connecting board to wifi AP.
Net> httpc start
 
Net> httpc new
 
Net: HTTP client created. <client num> = 1
Net: insecure  rxbuf:512  bodybuf:300  headerbuf:200  timeout:5000ms
 
Net> httpc sslconfig 1 protocol TLS1.2 cipher QAPI_NET_TLS_RSA_WITH_AES_256_GCM_SHA384
 
FwUp> http wlan1 5000:192.168.1.36:80/firmware-download ota.bin
 
FwUp>
FwUp: 0 0
FwUp: 1 0
FwUp: 2 0
FwUp: 4 0
FwUp: 5 0
FwUp: 8 0
FwUp: svr_ptr: 192.168.43.167
FwUp: port=80
FwUp: file uri: firmware-download/ota.bin
FwUp: new session done
FwUp: connect done !!!
FwUp: request done
FwUp: 11 0
FwUp: 13 0
FwUp: 13 1025
FwUp: Firmware Upgrade Image Download Failed ERR:1025
 
ERR:1025 says that Image file name is invalid.
 
Not able to get how to load image file in file system?  
 
We are able to generate .bin file using python command.
But how to copy this file to file system? please brief me commands step by step.
 
Thank You,
 
Akshaay

 

  • Up0
  • Down0
c_rpedad
Profile picture
Join Date: 18 Jun 18
Location: San Jose
Posts: 317
Posted: Thu, 2019-11-21 12:21
We internally use Webserver to processes requests that have been placed on its queue by the HTTP server, our default web page is called "index.iws".
To verify HTTP Server, connect PC to same wifi and provide IP:PORT of qca4020 in brower to view the server web page.
 
 
To Modify HTTP server functionality kindly follow below procedure for VFS and http server demo compilation 
1. Copy input.txt,index.iws from target/src/net/httpsvr/web to target/src/net/httpsvr/tool path 
2. Modify index.iws as per your requirement 
3. Ran vfscomp command as below to build C file with data array 
vfscomp -o input.txt -o htmldata.c 
4. vfscomp will generated below three files, copy these three files into /src/net/httsvr/cgi  
cgi_template.c, htmldata.c and htmldata.h 
5. Build QCA4020 demo,flash the image, bootup board and start http server. 
6. Connect PC to same wifi and provide HTTP server IP to view webpage changes.
 
 
In case of your test case to verify OTA:
you can use any PC to copy OTA.bin and start http server "python -m SimpleHTTPServer 8080"
On QCA4020 try to download OTA.bin " Fwup http wlan1 10:192.168.1.2:8080 ota.bin"
 
Since the ota.bin is of large size and copying the file into webserver during generation of htmldata.c file is not recommended.
However you can always implement mechanism to download OTA from remote/personal server.
 
  • Up0
  • Down0
akshay.b
Join Date: 2 Aug 19
Posts: 62
Posted: Mon, 2019-11-25 11:40

Hi,

I have not done any change in index.iws as its not my requirement. 

I am struggling to download .bin, .elf file to QCA4020 server filesystem. Performed below procedure:

1. We have started the server on a PC using the command python -m SimpleHTTPServer 8080.

2. Opened the PC server ip in browser http://1952.168.1.120:8080.

3. On opening the server ip we are able to see the ota.bin file and .elf file. 

My question is how to download these files to the QCA4020 board file system, not getting it ?

Tried to configure the qca4020 board as http client and connect it to the PC server and using httpc get  1 ota.bin command able to receive the ota.bin file sucessfully. Is this correct way download the file to file syste, if not please brief the commands and procedure?

 

Thank you

 

Akshaay

 

 

  • Up0
  • Down0
c_rpedad
Profile picture
Join Date: 18 Jun 18
Location: San Jose
Posts: 317
Posted: Mon, 2019-11-25 12:28

If you requirement is to perform OTA over http, kindly follow below instructions:

Server : python -m SimpleHTTPServer 8080

Client :
Connect QCA49020 to same Wifi and acquire IP address.
> "FwUp  http wlan1 5000:192.168.1.120:8080 ota.bin"  //if the wlan1 interface is being used(wlan setdevice 1)
after successful download you can accept the trial image to verify the OTA "FwUP trial 1" to accept and reboot the device.

You can also verify using "FwUp fwd" to find the cuurent and trial image contents.

  • Up0
  • Down0
akshay.b
Join Date: 2 Aug 19
Posts: 62
Posted: Tue, 2019-11-26 11:38

Hello,

I tried this commands, after starting the server on my PC and entering the command FwUp  http wlan1 5000:192.168.1.120:8080 ota.bin.

Below are the output i am getting:

FwUp>  http wlan1 5000:192.168.1.120:80 ota.bin 

FwUp>
FwUp: 0 0
FwUp: 1 0
FwUp: 2 0
FwUp: 4 0
FwUp: 5 0
FwUp: 8 0
FwUp: svr_ptr: 192.168.1.120
FwUp: port=80
FwUp: file uri: ota.bin
FwUp: new session done
FwUp: connect done !!!
FwUp: request done
FwUp: 11 0
FwUp: 13 0
FwUp: 12 0
FwUp: 8 0
FwUp: svr_ptr: 192.168.1.120
FwUp: port=80
FwUp: file uri: Quartz_HASHED.elf
FwUp: new session done
FwUp: connect done !!!
FwUp: request done
FwUp: 11 0
FwUp: 14 0
FwUp: 11 0
FwUp: 14 0
FwUp: 11 0
.
...... (
FwUp: 14 0   FwUp: 11 0  continues for few seconds)
(It ends as below)
FwUp: 11 0
FwUp: 14 0
FwUp: 11 0
FwUp: 14 0
FwUp: 12 0
FwUp: 15 0
FwUp: 16 0
FwUp: 17 0
FwUp: 17 0
FwUp: Firmware Upgrade Image Download Completed successfully
 
FwUp> trial 1 1
 
FwUp: Fail to Accept Trial FWD 1
 
FwUp> fwd
FwUp: Active FWD: Current  index:0, present:2
FwUp: FWD 0
FwUp: Magic: 0x54445746
FwUp: Rank: 0x1
FwUp: Version: 0x1
FwUp: Status: 0x1
FwUp: Total Images: 0x6
FwUp:         Image ID: 0xA
FwUp:    Image Version: 0x0
FwUp:      Image Start: 0x23000
FwUp:       Image Size: 0x16F000
FwUp:         Image ID: 0xB
FwUp:    Image Version: 0x0
FwUp:      Image Start: 0x192000
FwUp:       Image Size: 0x16000
FwUp:         Image ID: 0xD
FwUp:    Image Version: 0x0
FwUp:      Image Start: 0x1A8000
FwUp:       Image Size: 0x1F000
FwUp:         Image ID: 0x5
FwUp:    Image Version: 0x0
FwUp:      Image Start: 0x3000
FwUp:       Image Size: 0x10000
FwUp:         Image ID: 0x80
FwUp:    Image Version: 0x0
FwUp:      Image Start: 0x13000
FwUp:       Image Size: 0x10000
FwUp:         Image ID: 0x81
FwUp:    Image Version: 0x0
FwUp:      Image Start: 0x1000
FwUp:       Image Size: 0x2000
FwUp:
FwUp: FWD 1
FwUp: Magic: 0x54445746
FwUp: Rank: 0xFFFFFFFF
FwUp: Version: 0x1
FwUp: Status: 0x1
FwUp: Total Images: 0x3
FwUp:         Image ID: 0x80
FwUp:    Image Version: 0x0
FwUp:      Image Start: 0x3000
FwUp:       Image Size: 0x10000
FwUp:         Image ID: 0x5
FwUp:    Image Version: 0x1
FwUp:      Image Start: 0x13000
FwUp:       Image Size: 0x10000
FwUp:         Image ID: 0xA
FwUp:    Image Version: 0x1
FwUp:      Image Start: 0x211000
FwUp:       Image Size: 0x16F000
FwUp:
FwUp: FWD 2
FwUp: Magic: 0xFFFFFFFF
FwUp: Rank: 0xFFFFFFFF
FwUp: Version: 0xFFFFFFFF
FwUp: Status: 0xFF
FwUp: Total Images: 0xFF
FwUp:

 

1) Error for trail command it was showing "Fail to Accept Trial FWD".
Referring a forum link i found to do following changes to make FS2IMG=KEEP to eliminate above said error . 
But how and where can i find FS2IMG & make the the change to FS2IMG?please explain.

Tried a solution eferring a forum post and made Flag = QAPI_FW_UPGRADE_FLAG_DUPLICATE_ACTIVE_FS inside Command_Fw_Upgrade_HTTP_Upgrade  function. But still error for Trial command.

 

Thank you,

Akshaay

  • Up0
  • Down0
or Register

Opinions expressed in the content posted here are the personal opinions of the original authors, and do not necessarily reflect those of Qualcomm Incorporated or its subsidiaries (“Qualcomm”). The content is provided for informational purposes only and is not meant to be an endorsement or representation by Qualcomm or any other party. This site may also provide links or references to non-Qualcomm sites and resources. Qualcomm makes no representations, warranties, or other commitments whatsoever about any non-Qualcomm sites or third-party resources that may be referenced, accessible from, or linked to this site.