esp32FOTA: [E][HTTPClient.cpp:251] beginInternal(): failed to parse protocol

Hi… I created a web hosting account here…

https://systelfota.000webhostapp.com/

I am trying to update the fw after I have created the json file and uploaded with the .bin…

Running the example with https but not certificate I get [E][HTTPClient.cpp:251] beginInternal(): failed to parse protocol

Can you tell me the meaning of this error ?

Thanks


#include <esp32fota.h>
#include <WiFi.h>

// Change to your WiFi credentials
const char *ssid = "";
const char *password = "";

// esp32fota esp32fota("<Type of Firme for this device>", <this version>, <validate signature>);
esp32FOTA esp32FOTA("esp32-fota-http", 1, false, true);

void setup_wifi()
{
  delay(10);
  Serial.print("Connecting to ");
  Serial.println(ssid);

  WiFi.begin(ssid, password);

  while (WiFi.status() != WL_CONNECTED)
  {
    delay(500);
    Serial.print(".");
  }

  Serial.println("");
  Serial.println(WiFi.localIP());
}

/**
 * @brief  Function to execute the setup generated by the arduino framework
 * @param  None
 * @retval None
 */
void setup(void)
{
  esp32FOTA.setManifestURL("https://systelfota.000webhostapp.com/fota.json");
  Serial.begin(115200);
  setup_wifi();
}
/**
 * @brief  Function to execute in loop generated by the arduino framework
 * @param  None
 * @retval None
 */
void loop(void)
{
  bool updatedNeeded = esp32FOTA.execHTTPcheck();
  if (updatedNeeded)
  {
    esp32FOTA.execOTA();
  }

  delay(2000);
}

About this issue

  • Original URL
  • State: closed
  • Created 2 years ago
  • Comments: 17

Commits related to this issue

Most upvoted comments

I suggest you build more trust with yourself and stop relying on external assistance to disentangle local problems. If you managed to get this far then you already have the skills to troubleshoot that, it’s just a matter of not giving up 😃

@simogaspa84 your config looks good, can you try this sketch?


#include <esp32fota.h> // fota pulls WiFi library

const char *ssid = "zzzzz";
const char *password = "xxxx";

const char* firmware_name   = "esp32-fota-http";
const bool check_signature  = false;
const bool disable_security = true;

#define FOTA_URL "https://systelfota.000webhostapp.com/fota.json"

int firmware_version_major  = 2;
int firmware_version_minor  = 0;
int firmware_version_patch  = 0;

esp32FOTA FOTA; // empty constructor

void setup_wifi()
{
  delay(10);
  Serial.print("Connecting to ");
  Serial.println(ssid);
  WiFi.begin(ssid, password);
  while (WiFi.status() != WL_CONNECTED)
  {
    delay(500);
    Serial.print(".");
  }
  Serial.println("");
  Serial.println(WiFi.localIP());
}

void setup(void)
{
  Serial.begin(115200);
  {
    auto cfg = FOTA.getConfig();
    cfg.name         = firmware_name;
    cfg.manifest_url = FOTA_URL;
    cfg.sem          = SemverClass( firmware_version_major, firmware_version_minor, firmware_version_patch );
    cfg.check_sig    = check_signature;
    cfg.unsafe       = disable_security;
    //cfg.root_ca      = MyRootCA;
    //cfg.pub_key      = MyRSAKey;
    FOTA.setConfig( cfg );
  }
  setup_wifi();
}

void loop(void)
{
  bool updatedNeeded = FOTA.execHTTPcheck();
  if (updatedNeeded)
  {
    FOTA.execOTA();
  }
  delay(2000);
}