mirror of
https://github.com/emsesp/EMS-ESP32.git
synced 2025-12-07 16:29:51 +03:00
prep for downloading beta versions via web upgrade
This commit is contained in:
@@ -2531,11 +2531,12 @@ void MyESP::_sendCustomStatus() {
|
|||||||
|
|
||||||
JsonObject root = doc.to<JsonObject>();
|
JsonObject root = doc.to<JsonObject>();
|
||||||
|
|
||||||
root["command"] = "custom_status";
|
root["command"] = "custom_status";
|
||||||
root["version"] = _app_version;
|
root["version"] = _app_version;
|
||||||
root["customname"] = _app_name;
|
root["customname"] = _app_name;
|
||||||
root["appurl"] = _app_url;
|
root["appurl"] = _app_url;
|
||||||
root["updateurl"] = _app_updateurl;
|
root["updateurl"] = _app_updateurl;
|
||||||
|
root["updateurl_dev"] = _app_updateurl_dev;
|
||||||
|
|
||||||
// add specific custom stuff
|
// add specific custom stuff
|
||||||
if (_web_callback_f) {
|
if (_web_callback_f) {
|
||||||
@@ -2914,12 +2915,20 @@ void MyESP::_bootupSequence() {
|
|||||||
}
|
}
|
||||||
|
|
||||||
// setup MyESP
|
// setup MyESP
|
||||||
void MyESP::begin(const char * app_hostname, const char * app_name, const char * app_version, const char * app_url, const char * app_updateurl) {
|
void MyESP::begin(const char * app_hostname, const char * app_name, const char * app_version, const char * app_url, const char * app_url_api) {
|
||||||
_general_hostname = strdup(app_hostname);
|
_general_hostname = strdup(app_hostname);
|
||||||
_app_name = strdup(app_name);
|
_app_name = strdup(app_name);
|
||||||
_app_version = strdup(app_version);
|
_app_version = strdup(app_version);
|
||||||
_app_url = strdup(app_url);
|
_app_url = strdup(app_url);
|
||||||
_app_updateurl = strdup(app_updateurl);
|
|
||||||
|
char s[100];
|
||||||
|
strlcpy(s, app_url_api, sizeof(s));
|
||||||
|
strlcat(s, "/releases/latest", sizeof(s)); // append "/releases/latest"
|
||||||
|
_app_updateurl = strdup(s);
|
||||||
|
|
||||||
|
strlcpy(s, app_url_api, sizeof(s));
|
||||||
|
strlcat(s, "/releases/tags/travis-dev-build", sizeof(s)); // append "/releases/tags/travis-dev-build"
|
||||||
|
_app_updateurl_dev = strdup(s);
|
||||||
|
|
||||||
_telnet_setup(); // Telnet setup, called first to set Serial
|
_telnet_setup(); // Telnet setup, called first to set Serial
|
||||||
|
|
||||||
|
|||||||
@@ -9,7 +9,7 @@
|
|||||||
#ifndef MyESP_h
|
#ifndef MyESP_h
|
||||||
#define MyESP_h
|
#define MyESP_h
|
||||||
|
|
||||||
#define MYESP_VERSION "1.2.12"
|
#define MYESP_VERSION "1.2.13"
|
||||||
|
|
||||||
#include <ArduinoJson.h>
|
#include <ArduinoJson.h>
|
||||||
#include <ArduinoOTA.h>
|
#include <ArduinoOTA.h>
|
||||||
@@ -308,7 +308,7 @@ class MyESP {
|
|||||||
// general
|
// general
|
||||||
void end();
|
void end();
|
||||||
void loop();
|
void loop();
|
||||||
void begin(const char * app_hostname, const char * app_name, const char * app_version, const char * app_url, const char * app_updateurl);
|
void begin(const char * app_hostname, const char * app_name, const char * app_version, const char * app_url, const char * app_url_api);
|
||||||
void resetESP();
|
void resetESP();
|
||||||
int getWifiQuality();
|
int getWifiQuality();
|
||||||
void showSystemStats();
|
void showSystemStats();
|
||||||
@@ -407,6 +407,7 @@ class MyESP {
|
|||||||
char * _app_version;
|
char * _app_version;
|
||||||
char * _app_url;
|
char * _app_url;
|
||||||
char * _app_updateurl;
|
char * _app_updateurl;
|
||||||
|
char * _app_updateurl_dev;
|
||||||
bool _suspendOutput;
|
bool _suspendOutput;
|
||||||
bool _general_serial;
|
bool _general_serial;
|
||||||
bool _general_log_events;
|
bool _general_log_events;
|
||||||
|
|||||||
@@ -31,7 +31,7 @@ DS18 ds18;
|
|||||||
#define APP_NAME "EMS-ESP"
|
#define APP_NAME "EMS-ESP"
|
||||||
#define APP_HOSTNAME "ems-esp"
|
#define APP_HOSTNAME "ems-esp"
|
||||||
#define APP_URL "https://github.com/proddy/EMS-ESP"
|
#define APP_URL "https://github.com/proddy/EMS-ESP"
|
||||||
#define APP_UPDATEURL "https://api.github.com/repos/proddy/EMS-ESP/releases/latest"
|
#define APP_URL_API "https://api.github.com/repos/proddy/EMS-ESP"
|
||||||
|
|
||||||
// set to value >0 if the ESP is overheating or there are timing issues. Recommend a value of 1.
|
// set to value >0 if the ESP is overheating or there are timing issues. Recommend a value of 1.
|
||||||
#define EMSESP_DELAY 0 // initially set to 0 for no delay. Change to 1 if getting WDT resets from wifi
|
#define EMSESP_DELAY 0 // initially set to 0 for no delay. Change to 1 if getting WDT resets from wifi
|
||||||
@@ -2016,7 +2016,7 @@ void setup() {
|
|||||||
myESP.setSettings(LoadSaveCallback, SetListCallback, false); // default is Serial off
|
myESP.setSettings(LoadSaveCallback, SetListCallback, false); // default is Serial off
|
||||||
myESP.setWeb(WebCallback); // web custom settings
|
myESP.setWeb(WebCallback); // web custom settings
|
||||||
myESP.setOTA(OTACallback_pre, OTACallback_post); // OTA callback which is called when OTA is starting and stopping
|
myESP.setOTA(OTACallback_pre, OTACallback_post); // OTA callback which is called when OTA is starting and stopping
|
||||||
myESP.begin(APP_HOSTNAME, APP_NAME, APP_VERSION, APP_URL, APP_UPDATEURL);
|
myESP.begin(APP_HOSTNAME, APP_NAME, APP_VERSION, APP_URL, APP_URL_API);
|
||||||
|
|
||||||
// at this point we have all the settings from our internall SPIFFS config file
|
// at this point we have all the settings from our internall SPIFFS config file
|
||||||
// fire up the UART now
|
// fire up the UART now
|
||||||
|
|||||||
@@ -156,6 +156,7 @@ function sendCustomStatus() {
|
|||||||
"customname": "EMS-ESP",
|
"customname": "EMS-ESP",
|
||||||
"appurl": "https://github.com/proddy/EMS-ESP",
|
"appurl": "https://github.com/proddy/EMS-ESP",
|
||||||
"updateurl": "https://api.github.com/repos/proddy/EMS-ESP/releases/latest",
|
"updateurl": "https://api.github.com/repos/proddy/EMS-ESP/releases/latest",
|
||||||
|
"updateurl_dev": "https://api.github.com/repos/proddy/EMS-ESP/releases/tags/travis-dev-build",
|
||||||
|
|
||||||
"emsbus": {
|
"emsbus": {
|
||||||
"ok": true,
|
"ok": true,
|
||||||
|
|||||||
Reference in New Issue
Block a user