Skip to content

Commit

Permalink
Merge pull request #1 from TaixMiguel/dev
Browse files Browse the repository at this point in the history
Dev
  • Loading branch information
TaixMiguel authored Feb 2, 2022
2 parents 0d85d9b + ce2c326 commit 3d692c6
Show file tree
Hide file tree
Showing 5 changed files with 547 additions and 0 deletions.
5 changes: 5 additions & 0 deletions .gitignore
Original file line number Diff line number Diff line change
@@ -0,0 +1,5 @@
.pio
.vscode/.browse.c_cpp.db*
.vscode/c_cpp_properties.json
.vscode/launch.json
.vscode/ipch
7 changes: 7 additions & 0 deletions .vscode/extensions.json
Original file line number Diff line number Diff line change
@@ -0,0 +1,7 @@
{
// See http://go.microsoft.com/fwlink/?LinkId=827846
// for the documentation about the extensions.json format
"recommendations": [
"platformio.platformio-ide"
]
}
54 changes: 54 additions & 0 deletions include/esp32fota.h
Original file line number Diff line number Diff line change
@@ -0,0 +1,54 @@
/*
esp32 firmware OTA
Date: December 2018
Author: Chris Joyce <https://github.com/chrisjoyce911/esp32FOTA/esp32FOTA>
Purpose: Perform an OTA update from a bin located on a webserver (HTTP Only)
*/

#ifndef esp32fota_h
#define esp32fota_h

#include "Arduino.h"
#include <WiFiClientSecure.h>

class esp32FOTA {
public:
esp32FOTA(String firwmareType, int firwmareVersion);
void forceUpdate(String firwmareHost, int firwmarePort, String firwmarePath);
void execOTA();
bool execHTTPcheck();
bool useDeviceID;
String checkURL;

private:
String getDeviceID();
String _firwmareType;
int _firwmareVersion;
String _host;
String _bin;
int _port;
};

class secureEsp32FOTA {
public:
secureEsp32FOTA(String firwmareType, int firwmareVersion);
bool execHTTPSCheck();
void executeOTA();
String _descriptionOfFirmwareURL;
char *_certificate;
unsigned int _securePort = 443;
WiFiClientSecure clientForOta;
String _host;

private:
bool prepareConnection(String locationOfServer);
String secureGetContent();
bool isValidContentType(String line);
String _firwmareType;
int _firwmareVersion;
String locationOfFirmware;
String _bin;
int _port;
};

#endif
7 changes: 7 additions & 0 deletions platformio.ini
Original file line number Diff line number Diff line change
@@ -0,0 +1,7 @@
; TaixArduEsp32Fota Project
; @author TaixMiguel

[env:esp32doit-devkit-v1]
platform = espressif32
board = esp32doit-devkit-v1
framework = arduino
Loading

0 comments on commit 3d692c6

Please sign in to comment.