Occasionally when using the BG96 to perform an http post there is “+QHTTPPOST: 702” error. As an http post is not actually one command, but a composite of four separate commands (AT+QHTTPURL, URL, AT+QHTTPPOST, DATA), it is not clear how to recover from this failure. Should I retry the last part of the command or from the start of the set of four commands or perhaps neither of these? I know that a reset of the BG96 will recover it, but as our application is battery powered I would much prefer to recover without having to redial the network.
Here is an example of a successful http post:
19/05/20 10:10:49.495 INFO: TX> "AT+QHTTPURL=25"
19/05/20 10:10:49.511 INFO: RX> "AT+QHTTPURL=25"
19/05/20 10:10:49.516 INFO: RX> "CONNECT"
19/05/20 10:10:49.525 INFO: TX> "http://iot.exampleurl.com"
19/05/20 10:10:49.534 INFO: RX> "OK"
19/05/20 10:10:49.539 INFO: TX> "AT+QHTTPPOST=1005"
19/05/20 10:10:49.545 INFO: RX> "AT+QHTTPPOST=1005"
19/05/20 10:10:50.259 INFO: RX> "CONNECT"
19/05/20 10:10:50.351 INFO: TX> "{"sn":"866425035318361","ni":"03EA000A008403FA2E5035000000001CC91300000000006D340000D8560000483007E80ED500000E","msgs":[{"sq":"136","fp":"4","pl":"5EC3A26B00B00B00B00B00B00B00B00D00B00B00B00D00B00B00B000"},{"sq":"137","fp":"4","pl":"5EC3A3E200B00D00D00B01100B00B01100D00D01000D00B00B00B000"},{"sq":"138","fp":"4","pl":"5EC3A55901100B00B00B00B00D00D00B00B00B00B00B00B01800D000"},{"sq":"139","fp":"4","pl":"5EC3A6D000B00B00D00D01A00D00D00D00B00B01000B00D01100B000"},{"sq":"140","fp":"4","pl":"5EC3A84701300D00D01101101001000D00D00D00D00B013011013000"},{"sq":"141","fp":"4","pl":"5EC3A9BE00B01301301101100D00B01101001000D01001C182011000"},{"sq":"142","fp":"4","pl":"5EC3AB3501101801001101101101801100B01901101300D00D00D000"},{"sq":"143","fp":"4","pl":"5EC3ACAC00D01100D00B00D01100D00D01001101100B00D010010000"},{"sq":"144","fp":"4","pl":"5EC3AE2301001101801A01101000B01A011020011011011019010000"},{"sq":"145","fp":"12","pl":"5EC3B0940000C07F0000C07F"},{"sq":"146","fp":"15","pl":"5EC3B09485EBE34134078044"}]}"
19/05/20 10:10:50.445 INFO: RX> "OK"
19/05/20 10:10:52.201 INFO: RX> "+QHTTPPOST: 0,200,0"
And here is what it looks like when the 702 error occurs:
19/05/20 15:43:47.912 INFO: TX> "AT+QHTTPURL=25"
19/05/20 15:43:47.928 INFO: RX> "AT+QHTTPURL=25"
19/05/20 15:43:47.934 INFO: RX> "CONNECT"
19/05/20 15:43:47.943 INFO: TX> "http://iot.exampleurl.com"
19/05/20 15:43:47.952 INFO: RX> "OK"
19/05/20 15:43:47.958 INFO: TX> "AT+QHTTPPOST=366"
19/05/20 15:43:47.965 INFO: RX> "AT+QHTTPPOST=366"
19/05/20 15:43:53.542 INFO: RX> "CONNECT"
19/05/20 15:43:53.578 INFO: TX> "{"sn":"866425035318361","ni":"03EA000A008403FA2E5035000000001CC91300000000006D340000D8560000483007E80ED5000013","msgs":[{"sq":"6","fp":"20","pl":"5EC3FEB201725B0000D85600006D3400004C0147534D20393030"},{"sq":"7","fp":"20","pl":"5EC3FEB201865B000022080000CC010000380147534D2031383030"},{"sq":"8","fp":"20","pl":"5EC3FEB201775B00003201000028210000430147534D20393030"}]}"
19/05/20 15:43:53.616 INFO: RX> "OK"
19/05/20 15:44:13.647 INFO: TX> "{"sn":"866425035318361","ni":"03EA000A008403FA2E5035000000001CC91300000000006D340000D8560000483007E80ED5000013","msgs":[{"sq":"6","fp":"20","pl":"5EC3FEB201725B0000D85600006D3400004C0147534D20393030"},{"sq":"7","fp":"20","pl":"5EC3FEB201865B000022080000CC010000380147534D2031383030"},{"sq":"8","fp":"20","pl":"5EC3FEB201775B00003201000028210000430147534D20393030"}]}"
19/05/20 15:44:33.715 INFO: TX> "{"sn":"866425035318361","ni":"03EA000A008403FA2E5035000000001CC91300000000006D340000D8560000483007E80ED5000013","msgs":[{"sq":"6","fp":"20","pl":"5EC3FEB201725B0000D85600006D3400004C0147534D20393030"},{"sq":"7","fp":"20","pl":"5EC3FEB201865B000022080000CC010000380147534D2031383030"},{"sq":"8","fp":"20","pl":"5EC3FEB201775B00003201000028210000430147534D20393030"}]}"
19/05/20 15:44:53.583 INFO: RX> "+QHTTPPOST: 702"
What is the correct way to recover in this case? As you can see my current mechanism of retrying the failed “data” command is not successful.