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.