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"
|
||||
|
||||
namespace WiFiHandler {
|
||||
void setupWifi();
|
||||
void setupWifi(const char* ssid, const char* password);
|
||||
}
|
||||
@ -1,2 +1,5 @@
|
||||
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_rts = 0
|
||||
monitor_dtr = 0
|
||||
build_flags = -O2
|
||||
build_flags =
|
||||
-O2
|
||||
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 =
|
||||
esp32-camera
|
||||
esp32-camera
|
||||
|
||||
@ -1,9 +1,11 @@
|
||||
#include <Arduino.h>
|
||||
#include "pinout.h"
|
||||
#include "credentials.h"
|
||||
#include "WifiHandler.h"
|
||||
#include "cameraHandler.h"
|
||||
#include "LEDManager.h"
|
||||
#include "httpdHandler.h"
|
||||
#include "OTA.h"
|
||||
|
||||
void setup(){
|
||||
Serial.begin(115200);
|
||||
@ -14,12 +16,14 @@ void setup(){
|
||||
LEDManager::setupLED();
|
||||
// todo add blink handling
|
||||
CameraHandler::setupCamera();
|
||||
WiFiHandler::setupWifi();
|
||||
WiFiHandler::setupWifi(ssid, password);
|
||||
// todo add blink handling
|
||||
HttpdHandler::startStreamServer();
|
||||
LEDManager::on();
|
||||
|
||||
OTA::SetupOTA(OTAPassword, OTAServerPort);
|
||||
}
|
||||
|
||||
void loop(){
|
||||
delay(1);
|
||||
OTA::HandleOTAUpdate();
|
||||
}
|
||||
@ -1,9 +1,8 @@
|
||||
#include "WifiHandler.h"
|
||||
#include "credentials.h"
|
||||
#include "LEDManager.h"
|
||||
|
||||
namespace WiFiHandler {
|
||||
void setupWifi(){
|
||||
void setupWifi(const char* ssid, const char* password){
|
||||
Serial.println("Initializing connection to wifi");
|
||||
|
||||
WiFi.begin(ssid, password);
|
||||
|
||||
Loading…
Reference in New Issue
Block a user