-
Notifications
You must be signed in to change notification settings - Fork 91
New issue
Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.
By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.
Already on GitHub? Sign in to your account
[E][HTTPClient.cpp:251] beginInternal(): failed to parse protocol #99
Comments
thanks for your report, looks like a bug in the library code until this is fixed, one way to avoid the bug is to use a define or static variable to store the URL. String my_manifest_url = "https://systelfota.000webhostapp.com/fota.json";
void setup(void)
{
esp32FOTA.setManifestURL( my_manifest_url );
Serial.begin(115200);
setup_wifi();
}
|
Thanks @tobozo for your suggestion.. I will try it now.. I am not sure that everything is set correctly So i put here the json .. {
"type": "esp32-fota-http",
"version": "2",
"url": "https://systelfota.000webhostapp.com/update.bin"
} Can you check? I don't know if the web hosting provider is set correctly.. I have tried now with your suggestion.. always the same..
// Change to your WiFi credentials
const char *ssid = "zzzzz";
const char *password = "xxxx";
String my_manifest_url = "https://systelfota.000webhostapp.com/fota.json";
// 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(my_manifest_url);
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);
} Thanks a lot |
@tobozo please can you suggest a web hosting provider easy to configure to try all examples in your lib? |
@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);
}
|
hi @tobozo .. thanks for your code.. I have tried but it is failing
|
ok it was in the wrong location the json and the .bin file.. 172.16.10.67 Any ideas @tobozo ? |
maybe give it a domain name instead of an IP address when calling HTTPS urls, or just use plain HTTP ? 😉 |
Sorry @tobozo .. I don't understand.. which is the mistake? |
Hi @tobozo do i have to do something in the web hosting portal? Thanks a lot for your kind reply |
I don't know but 172.16.10.67 seems like a C class address (private) and those can't be routed on the internet, the domain name you specified earlier resolves to 145.14.145.212 and I don't see it in the logs, so maybe the failure is a consequence of that. |
ok @tobozo so what do you suggest to do ? |
I suggest you build more trust with yourself and stop relying on external assistance to disentangle local problems. |
BTW, I've faced same issues. Looks like constructor with String object as input parameter turns into dangling pointer with const char * in cfg struct. |
indeed that was goofy, sorry about that 🙇 looking at your PR: I didn't know this notation, how does it compare to String UpdateURL((char *)0);
String PartitionLabel((char *)0); |
Mostly useful if combined with |
thanks @tobozo and @vortigont . I will try the new commit asap |
@simogaspa84 there's a better implementation and more fixes from @vortigont on the 0.2.3 branch |
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
The text was updated successfully, but these errors were encountered: