Page 1 of 1

ESP32 OTA from Github - Not connecting to raw.githubusercontent.com

Posted: Sun Sep 08, 2024 11:20 am
by kian79
Hi all,

I am trying to do OTA updates where the bin file is fetched from github. I tried to follow this simple example here:

https://medium.com/@adityabangde/esp32- ... 3a95f4a97b

However, my program is unable to connect to GitHub server. This is the line of code that is giving me problems:

Code: Select all

// Define server details and file path
#define HOST "raw.githubusercontent.com"
#define PORT 443

if (client.connect(HOST, PORT)) { // Connect to the server
Can someone advise me on what could be the problem? Thanks in advance!

Re: ESP32 OTA from Github - Not connecting to raw.githubusercontent.com

Posted: Sun Sep 08, 2024 4:01 pm
by aliarifat794
Try to use WiFiClientSecure.h instead of WiFiClient.h when connecting to the GitHub server.

Re: ESP32 OTA from Github - Not connecting to raw.githubusercontent.com

Posted: Mon Sep 09, 2024 9:19 am
by kian79
aliarifat794 wrote:
Sun Sep 08, 2024 4:01 pm
Try to use WiFiClientSecure.h instead of WiFiClient.h when connecting to the GitHub server.
The example uses this library

#include <WiFiClientSecure.h>

But it sets it to allow unsecure connections:

Code: Select all

 WiFiClientSecure client;
  client.setInsecure(); // Set client to allow insecure connections

  if (client.connect(HOST, PORT)) { // Connect to the server

Re: ESP32 OTA from Github - Not connecting to raw.githubusercontent.com

Posted: Mon Sep 09, 2024 3:46 pm
by lbernstone
Turn core debugging to verbose for much more information about the http transaction.
If you post the code you are using, and the response, we will be much more able to help.