BG96 downloading file over HTTPS

Hello.

My goal is to see the content (at first if this is easier than downloading and create bin file inside BG96 memory) of my file from this site: https://filebin.net/
This is free file binary hosting site.

I uploaded my binary file. You can find a link with my file here:
https://filebin.net/hngzfyaze95l5ojx

Now I m trying to see the content of this file but have still errors:

RDY
AT+QHTTPCFG="responseheader",1

OK
AT+QHTTPCFG="contenttype",1

OK
AT+QIACT?

OK
AT+QICSGP=1,1,"iot1","","",1

OK
AT+QIACT=1

OK
AT+QIACT?

+QIACT: 1,1,1,"172.29.10.167"

OK
AT+QHTTPCFG="sslctxid",1

OK
AT+QSSLCFG="sslversion",1,1

OK
AT+QSSLCFG="ciphersuite",1,0x0005

OK
AT+QSSLCFG="seclevel",1,0 

OK
AT+QHTTPURL=36,60

CONNECT

OK
AT+QHTTPURL=36,60

CONNECT

-> "https://filebin.net/hngzfyaze95l5ojx"

OK
AT+QHTTPGET=80

OK

+QHTTPGET: 701

AT+QHTTPREAD=80

+CME ERROR: 705

How to open this file over HTTPS protocol?

1 Like

The url you provided is not really the url for the file. You need a different url.
Try this : https://filebin.net/hngzfyaze95l5ojx/USARTidle.bin

1 Like

The site and the file are public so I don’t think you require the SSL configuration. I recently downloaded a file from AWS S3 bucket to my modem using this same sequence.

Try this script and let me know :

AT+QHTTPURL=62,80

CONNECT

https://samplebucketlogs.s3.us-west-2.amazonaws.com/sample.txt

AT+QHTTPGET=80

[ QHTTPREAD command displays the fetched content , omit this command and move to the next one if you need to store the content as a file]
AT+QHTTPREAD=80

[ Stores the file onto the storage ]
AT+QHTTPREADFILE="ufs:file.txt",80

AT+QFLST

1 Like

Tauqir_Hassan thanks, here is result:

AT+QHTTPURL=62,60

CONNECT

OK
AT+QHTTPGET=80

OK

+QHTTPGET: 0,200,20
AT+QHTTPREAD=80

CONNECT
HTTP/1.1 200 OK
x-amz-id-2: zDJZAVQFQ8H99ZUtkreBK6tBH7Z7v6eFudM1JJIJ8QysIe3dlxGav32wjf3qwdMv0b7ssTJmUgc=
x-amz-request-id: 30MH21Z28WWEAJ4R
Date: Tue, 11 Jan 2022 08:36:07 GMT
Last-Modified: Fri, 19 Nov 2021 13:25:38 GMT
ETa

Did you see the content of the text file, it was "OTA sample for BG96."

1 Like

Yes I opened your link on my web browser.
There were: “OTA sample for BG96.”

Not from the web browser, it should appear in your AT command logs , as below :

image

1 Like

Yes.

CONNECT
HTTP/1.1 200 OK
x-amz-id-2: gX1YzUX1cWDfD+j7AJKx08omaAdfzzRi/lgXmv1pdIDzAZt2+DgRaITPl4PQNDx4USFBX6XnCzQ=
x-amz-request-id: Q9509AB5XQHRHEBR
Date: Tue, 11 Jan 2022 08:52:45 GMT
Last-Modified: Fri, 19 Nov 2021 13:25:38 GMT
ETag: “ea6c9597f66f72d4dba8bbc5ef2ec1e9”
Accept-Ranges: bytes
Content-Type: text/plain
Server: AmazonS3
Content-Length: 20

OTA sample for BG96.
OK

+QHTTPREAD: 0

So you see the file content was printed, the problem was not with the SSL configuration but with the filebin URL that you’re using.

Try a different file hosting service or use AWS S3 bucket if you have an AWS account.

1 Like