Added Updater to automatically perform OTA updates without user interaction.
This commit is contained in:
@ -1,13 +1,21 @@
|
||||
#pragma once
|
||||
#include <Arduino.h>
|
||||
|
||||
// This is a simple number indicating the version for the HTTP Updater.
|
||||
#define OTA_VERSION 1
|
||||
// Comment out to prevent automatic updates.
|
||||
#define OTA_UPDATE_URL "https://files.schle.nz/esmp3/update.manifest"
|
||||
#define OTA_CHECK_INTERVAL 12*60*60*1000 // 12 hours
|
||||
|
||||
#define SHOW_DEBUG
|
||||
//#define SHOW_TRACE
|
||||
#define FTP_DEBUG
|
||||
#define DELAY_AFTER_DEBUG_AND_TRACE 0
|
||||
|
||||
#define WIFI_SSID "---CHANGEME---"
|
||||
#define WIFI_PASS "---CHANGEME---"
|
||||
// Here you can define WiFi data to use. But actually, the better way to do
|
||||
// this is by using /_wifi.txt on the sd card.
|
||||
//#define WIFI_SSID "---CHANGEME---"
|
||||
//#define WIFI_PASS "---CHANGEME---"
|
||||
|
||||
#define VS1053_SLEEP_DELAY 5000
|
||||
#define POSITION_SEND_INTERVAL 5000
|
||||
|
@ -32,6 +32,7 @@ private:
|
||||
|
||||
unsigned long _last_rfid_scan_at = 0;
|
||||
unsigned long _last_position_info_at = 0;
|
||||
unsigned long _last_update_check_at = 0;
|
||||
String _serial_buffer = String();
|
||||
String _cmd_queue = "";
|
||||
void _execute_command_ls(String path);
|
||||
|
8
include/updater.h
Normal file
8
include/updater.h
Normal file
@ -0,0 +1,8 @@
|
||||
#pragma once
|
||||
|
||||
class Updater {
|
||||
public:
|
||||
static void run();
|
||||
static bool do_update(int cmd, String url);
|
||||
static void update_spiffs();
|
||||
};
|
Reference in New Issue
Block a user