mirror of
https://github.com/EyeTrackVR/OpenIris.git
synced 2025-11-04 15:39:42 +08:00
Add basic OTA updates handling (#3)
This commit is contained in:
parent
c80b665077
commit
a569ac21e6
@ -2,5 +2,5 @@
|
|||||||
#include "pinout.h"
|
#include "pinout.h"
|
||||||
|
|
||||||
namespace WiFiHandler {
|
namespace WiFiHandler {
|
||||||
void setupWifi();
|
void setupWifi(const char* ssid, const char* password);
|
||||||
}
|
}
|
||||||
@ -1,2 +1,5 @@
|
|||||||
const char* ssid = "";
|
const char* ssid = "";
|
||||||
const char* password = "";
|
const char* password = "";
|
||||||
|
|
||||||
|
const char* OTAPassword = ""; // if empty, no password will be required
|
||||||
|
uint16_t OTAServerPort = 3232;
|
||||||
@ -15,8 +15,15 @@ framework = arduino
|
|||||||
monitor_speed = 115200
|
monitor_speed = 115200
|
||||||
monitor_rts = 0
|
monitor_rts = 0
|
||||||
monitor_dtr = 0
|
monitor_dtr = 0
|
||||||
build_flags = -O2
|
build_flags =
|
||||||
|
-O2
|
||||||
build_unflags = -Os
|
build_unflags = -Os
|
||||||
|
;upload_port = 192.168.1.43 ;replace this with your own ip
|
||||||
|
;upload_protocol = espota
|
||||||
|
upload_flags =
|
||||||
|
--auth=Password
|
||||||
|
board_build.partitions = min_spiffs.csv
|
||||||
|
|
||||||
lib_deps =
|
lib_deps =
|
||||||
esp32-camera
|
esp32-camera
|
||||||
|
|
||||||
@ -1,9 +1,11 @@
|
|||||||
#include <Arduino.h>
|
#include <Arduino.h>
|
||||||
#include "pinout.h"
|
#include "pinout.h"
|
||||||
|
#include "credentials.h"
|
||||||
#include "WifiHandler.h"
|
#include "WifiHandler.h"
|
||||||
#include "cameraHandler.h"
|
#include "cameraHandler.h"
|
||||||
#include "LEDManager.h"
|
#include "LEDManager.h"
|
||||||
#include "httpdHandler.h"
|
#include "httpdHandler.h"
|
||||||
|
#include "OTA.h"
|
||||||
|
|
||||||
void setup(){
|
void setup(){
|
||||||
Serial.begin(115200);
|
Serial.begin(115200);
|
||||||
@ -14,12 +16,14 @@ void setup(){
|
|||||||
LEDManager::setupLED();
|
LEDManager::setupLED();
|
||||||
// todo add blink handling
|
// todo add blink handling
|
||||||
CameraHandler::setupCamera();
|
CameraHandler::setupCamera();
|
||||||
WiFiHandler::setupWifi();
|
WiFiHandler::setupWifi(ssid, password);
|
||||||
// todo add blink handling
|
// todo add blink handling
|
||||||
HttpdHandler::startStreamServer();
|
HttpdHandler::startStreamServer();
|
||||||
LEDManager::on();
|
LEDManager::on();
|
||||||
|
|
||||||
|
OTA::SetupOTA(OTAPassword, OTAServerPort);
|
||||||
}
|
}
|
||||||
|
|
||||||
void loop(){
|
void loop(){
|
||||||
delay(1);
|
OTA::HandleOTAUpdate();
|
||||||
}
|
}
|
||||||
@ -1,9 +1,8 @@
|
|||||||
#include "WifiHandler.h"
|
#include "WifiHandler.h"
|
||||||
#include "credentials.h"
|
|
||||||
#include "LEDManager.h"
|
#include "LEDManager.h"
|
||||||
|
|
||||||
namespace WiFiHandler {
|
namespace WiFiHandler {
|
||||||
void setupWifi(){
|
void setupWifi(const char* ssid, const char* password){
|
||||||
Serial.println("Initializing connection to wifi");
|
Serial.println("Initializing connection to wifi");
|
||||||
|
|
||||||
WiFi.begin(ssid, password);
|
WiFi.begin(ssid, password);
|
||||||
|
|||||||
Loading…
Reference in New Issue
Block a user