BC660K - HTTP(S) POST - 20-30KB text files - How?

I need to send 20-30KB files to an HTTP(S) REST API endpoint. I cannot find any documentation on HTTPPOST etc. for the BK660. The goal is to be able to upload compressed log files.

Can anyone point me in the right direction?

I found Quectel_BC66&BC66-NA_HTTP(S)_Application_Note_V1.0.pdf which should help me get started.

Quectel_BC660K-GL&BC950K-GL_HTTP(S)_Application_Note_V1.0.pdf (238.7 KB)

1 Like

Thanks @herbert.pan-Q

I worked through that doc, but I’m running into +QHTTPPOST: 718 problems when trying to send anything >7KB of data. I’ve broken my data into 1KB chunks and I’m attempting to send them to my endpoint using the process below.

Firmware version: Revision: BC660KGLAAR01A05

My process at the moment:

AT+QHTTPCFG="contextid",0
AT+QHTTPURL=62,300
> http://2e0a42a4-26df-4d3c-b0ad-fb481d7a5172.mock.pstmn.io/test
AT+QHTTPCFG="requestheader",1
AT+QHTTPPOST=1234,80,80,1

> POST /test HTTP/1.1
Host: 2e0a42a4-26df-4d3c-b0ad-fb481d7a5172.mock.pstmn.io
Accept: */*
User-Agent: QUECTEL_MODULES
Connection: Keep-Alive
Content-Type: application/x-www-form-urlencoded
Content-Length: 8192

wertyqwertyqwertyqwertyqwertyqwertyqwertyqwertyqwertyqwertyqwertyqwertyqwertyqwertyqwertyqwertyqwertyqwertyqwertyqwertyqwertyqwertyqwertyqwertyqwertyqwertyqwertyqwertyqwertyqwertyqwertyqwertyqwertyqwertyqwertyqwertyqwertyqwertyqwertyqwertyqwertyqwertyqwertyqwertyqwertyqwertyqwertyqwertyqwertyqwertyqwertyqwertyqwertyqwertyqwertyqwertyqwertyqwertyqwertyqwertyqwertyqwertyqwertyqwertyqwertyqwertyqwertyqwertyqwertyqwertyqwertyqwertyqwertyqwertyqwertyqwertyqwertyqwertyqwertyqwertyqwertyqwertyqwertyqwertyqwertyqwertyqwertyqwertyqwertyqwertyqwertyqwertyqwertyqwertyqwertyqwertyqwertyqwertyqwertyqwertyqwertyqwertyqwertyqwertyqwertyqwertyqwertyqwertyqwertyqwertyqwertyqwertyqwertyqwertyqwertyqwertyqwertyqwertyqwertyqwertyqwertyqwertyqwertyqwertyqwertyqwertyqwertyqwertyqwertyqwertyqwertyqwertyqwertyqwertyqwertyqwertyqwertyqwertyqwertyqwertyqwertyqwertyqwertyqwertyqwertyqwertyqwertyqwertyqwertyqwertyqwertyqwertyqwertyqwertyqwertyqwertyqwertyqwertyqwertyqwertyqwertyqwertyqwertyqwertyqwertyqwertyqwertyqwertyqwtyqwertyqwertyq

I then do 6 x …

AT+QHTTPPOST=1024,80,80,1

> wertyqwertyqwertyqwertyqwertyqwertyqwertyqwertyqwertyqwertyqwertyqwertyqwertyqwertyqwertyqwertyqwertyqwertyqwertyqwertyqwertyqwertyqwertyqwertyqwertyqwertyqwertyqwertyqwertyqwertyqwertyqwertyqwertyqwertyqwertyqwertyqwertyqwertyqwertyqwertyqwertyqwertyqwertyqwertyqwertyqwertyqwertyqwertyqwertyqwertyqwertyqwertyqwertyqwertyqwertyqwertyqwertyqwertyqwertyqwertyqwertyqwertyqwertyqwertyqwertyqwertyqwertyqwertyqwertyqwertyqwertyqwertyqwertyqwertyqwertyqwertyqwertyqwertyqwertyqwertyqwertyqwertyqwertyqwertyqwertyqwertyqwertyqwertyqwertyqwertyqwertyqwertyqwertyqwertyqwertyqwertyqwertyqwertyqwertyqwertyqwertyqwertyqwertyqwertyqwertyqwertyqwertyqwertyqwertyqwertyqwertyqwertyqwertyqwertyqwertyqwertyqwertyqwertyqwertyqwertyqwertyqwertyqwertyqwertyqwertyqwertyqwertyqwertyqwertyqwertyqwertyqwertyqwertyqwertyqwertyqwertyqwertyqwertyqwertyqwertyqwertyqwertyqwertyqwertyqwertyqwertyqwertyqwertyqwertyqwertyqwertyqwertyqwertyqwertyqwertyqwertyqwertyqwertyqwertyqwertyqwertyqwertyqwertyqwertyqwertyqwertyqwertyqwertyqwtyqwertyqwertyq

… and end with …

AT+QHTTPPOST=1024,80,80,0

> wertyqwertyqwertyqwertyqwertyqwertyqwertyqwertyqwertyqwertyqwertyqwertyqwertyqwertyqwertyqwertyqwertyqwertyqwertyqwertyqwertyqwertyqwertyqwertyqwertyqwertyqwertyqwertyqwertyqwertyqwertyqwertyqwertyqwertyqwertyqwertyqwertyqwertyqwertyqwertyqwertyqwertyqwertyqwertyqwertyqwertyqwertyqwertyqwertyqwertyqwertyqwertyqwertyqwertyqwertyqwertyqwertyqwertyqwertyqwertyqwertyqwertyqwertyqwertyqwertyqwertyqwertyqwertyqwertyqwertyqwertyqwertyqwertyqwertyqwertyqwertyqwertyqwertyqwertyqwertyqwertyqwertyqwertyqwertyqwertyqwertyqwertyqwertyqwertyqwertyqwertyqwertyqwertyqwertyqwertyqwertyqwertyqwertyqwertyqwertyqwertyqwertyqwertyqwertyqwertyqwertyqwertyqwertyqwertyqwertyqwertyqwertyqwertyqwertyqwertyqwertyqwertyqwertyqwertyqwertyqwertyqwertyqwertyqwertyqwertyqwertyqwertyqwertyqwertyqwertyqwertyqwertyqwertyqwertyqwertyqwertyqwertyqwertyqwertyqwertyqwertyqwertyqwertyqwertyqwertyqwertyqwertyqwertyqwertyqwertyqwertyqwertyqwertyqwertyqwertyqwertyqwertyqwertyqwertyqwertyqwertyqwertyqwertyqwertyqwertyqwertyqwertyqwertyqwtyqwertyqwertyq

I’m unable to sniff the data transmission, but it seems that the data is not being transmitted with every AT+QHTTPPOST but instead ends up in a buffer and only transmitted once I indicate AT+QHTTPPOST=1024,80,80,0 (0 - Packet is the last one). If this is the case, I assume that I’m probably overflowing an HTTP tx buffer causing the socket to throw a write error (718). If so, what is the solution to sending >7KB payloads?

Example of a successful POST with a 7KB content-length:

I’m still stuck on 7KB max HTTP payload sizes. Does anyone know how to overcome this problem? @herbert.pan-Q ?

The BC660k has an internal buffer limit of 1024 chars, any more than that are simply trimmed and discarded (silently). I wouldn’t believe the 1-2048 in the data sheet. If you can split your data so it is in smaller chunks, it should work.
Note: From the TCP/IP QISEND command: “The maximum length is 1024 bytes in text mode and 512 bytes in hex mode”. i.e. TCP/IP frames can only have 1024 bytes, or half that if hex. I have found this limit cropping up in other places when it said that the limit was > 1024 so I limit frames to slightly less than 1024 bytes and have no issues.

Since BC660KGLAAR01A05_01.002.01.002 you can send 1024 bytes in hex mode as well.

Im also working on uploading a lot of data using the BC660K-GL. For me sending up to 2048 bytes in a single POST request works fine. Due to having lots of data I also tried sending multiple packages using the flag (eg 1 at the end and for the last package 0).

I hve setup a log server and it turns out the behaivour when sending to much data at once is somehow undefined. It can happen that only part of the data is beein transmitted at the server. Most of the time the module seems to crash or the server returns a socket error (718)

I also encountered that sending up to 7kb eg 3 x 2048 packages works fine most of the time.

If anyone has a solution or improvement to that it would be really appriciated. Sadly I’m bound to using HTTPS for transmission.

Regards to all,
Marco