Xinyuan-LilyGO / LilyGO-T-A76XX

LilyGo A7670X A7608X SIM7670G series
MIT License
126 stars 57 forks source link

HTTPS Post Issue With A7670G . Error 715 #162

Open JMartinezEco opened 1 month ago

JMartinezEco commented 1 month ago

Description:

When trying to perform an HTTP POST request using the SIMCOM A7670G module, I encounter the error HTTP post failed ! error code = 715. The module successfully connects to the network and retrieves an IP address, but fails when sending the HTTP POST request using the AT+HTTPACTION=1 command.

image

Actual Behavior:

I'm using the base example HttpsBuiltInPost.ino. The module connects to the network and obtains an IP, but the request fails with error 715 when sending a POST.


#include <Arduino.h>
#include "config.h"
#include "modules.h"
#include <TinyGsmClient.h>

TinyGsm modem(SerialAT);

// Crear instancias de los módulos
SIM A7670G(&modem);

...

  const char *server_url = "https://xxxxxx.xxx/insertXXXXxxxxXXXxxx";

  // Initialize HTTPS
  modem.https_begin();

  // Set GET URT
  if (!modem.https_set_url(server_url))
  {
    Serial.println("Failed to set the URL. Please check the validity of the URL!");
    return;
  }

  //
  modem.https_set_content_type("application/json");

  String post_body = "This is post example!";

  int httpCode = modem.https_post(post_body);

  if (httpCode != 200)
  {
    Serial.print("HTTP post failed ! error code = ");
    Serial.println(httpCode);
    return;
  }

  // Get HTTPS header information
  String header = modem.https_header();
  Serial.print("HTTP Header : ");
  Serial.println(header);

  // Get HTTPS response
  String body = modem.https_body();
  Serial.print("HTTP body : ");
  Serial.println(body);

...

As in https://github.com/Xinyuan-LilyGO/LilyGO-T-A76XX/issues/117 It is said that the AT commands for this type of requests are not suported by the A767X modules, is there any firmware update available for the module to make this work?

kgmuzungu commented 1 month ago

You can get the firmware version with the command ATI and AT+SIMCOMATI commands. (mode.sendAT("I") and modem.sendAT("+SIMCOMATI"))

maybe try to connect to https://vsh.pp.ua/TinyGSM/logo.txt first (this is the test page from the TinyGSM guy). AWS or Google could services might be trickier.

You can connect to good old HTTP, right? HTTPS is the problem?

lewisxhe commented 1 month ago

Please update the latest baseband version firmware and test again, this problem should be fixed. https://github.com/Xinyuan-LilyGO/LilyGO-T-A76XX/blob/main/docs/update_fw.md