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

kian79
Posts: 30
Joined: Thu Jun 13, 2019 3:27 am

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

Postby kian79 » Sun Sep 08, 2024 11:20 am

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!

aliarifat794
Posts: 200
Joined: Sun Jun 23, 2024 6:18 pm

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

Postby aliarifat794 » Sun Sep 08, 2024 4:01 pm

Try to use WiFiClientSecure.h instead of WiFiClient.h when connecting to the GitHub server.

kian79
Posts: 30
Joined: Thu Jun 13, 2019 3:27 am

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

Postby kian79 » Mon Sep 09, 2024 9:19 am

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

lbernstone
Posts: 829
Joined: Mon Jul 22, 2019 3:20 pm

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

Postby lbernstone » Mon Sep 09, 2024 3:46 pm

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.

Who is online

Users browsing this forum: No registered users and 30 guests