@ -38,10 +38,10 @@ build_flags =
|
|||||||
lib_deps = # Switched to forks for better version control.
|
lib_deps = # Switched to forks for better version control.
|
||||||
# Using local copy of these libraries
|
# Using local copy of these libraries
|
||||||
#https://github.com/jrowberg/i2cdevlib.git#<document>
|
#https://github.com/jrowberg/i2cdevlib.git#<document>
|
||||||
https://github.com/mp-se/ESP_WiFiManager#v1.9.0 # https://github.com/khoih-prog/ESP_WiFiManager
|
|
||||||
https://github.com/mp-se/ESP_DoubleResetDetector#v1.2.1 # https://github.com/khoih-prog/ESP_DoubleResetDetector
|
|
||||||
#https://github.com/PaulStoffregen/OneWire
|
#https://github.com/PaulStoffregen/OneWire
|
||||||
#https://github.com/milesburton/Arduino-Temperature-Control-Library
|
#https://github.com/milesburton/Arduino-Temperature-Control-Library
|
||||||
|
https://github.com/mp-se/ESP_WiFiManager#v1.9.0 # https://github.com/khoih-prog/ESP_WiFiManager
|
||||||
|
https://github.com/mp-se/ESP_DoubleResetDetector#v1.2.1 # https://github.com/khoih-prog/ESP_DoubleResetDetector
|
||||||
https://github.com/mp-se/tinyexpr # https://github.com/codeplea/tinyexpr
|
https://github.com/mp-se/tinyexpr # https://github.com/codeplea/tinyexpr
|
||||||
https://github.com/mp-se/incbin # https://github.com/graphitemaster/incbin
|
https://github.com/mp-se/incbin # https://github.com/graphitemaster/incbin
|
||||||
https://github.com/mp-se/Arduino-Log#1.1.1 # https://github.com/thijse/Arduino-Log
|
https://github.com/mp-se/Arduino-Log#1.1.1 # https://github.com/thijse/Arduino-Log
|
||||||
|
@ -318,7 +318,7 @@ void PerfLogging::pushInflux() {
|
|||||||
if (!myConfig.isInfluxDb2Active()) return;
|
if (!myConfig.isInfluxDb2Active()) return;
|
||||||
|
|
||||||
if (myConfig.isInfluxSSL()) {
|
if (myConfig.isInfluxSSL()) {
|
||||||
Log.warning(F("PERF: InfluxDB2 with SSL is not supported when pushing performance data, skipping" CR);
|
Log.warning(F("PERF: InfluxDB2 with SSL is not supported when pushing performance data, skipping" CR));
|
||||||
return;
|
return;
|
||||||
}
|
}
|
||||||
|
|
||||||
|
@ -32,6 +32,8 @@ SOFTWARE.
|
|||||||
#include <webserver.hpp>
|
#include <webserver.hpp>
|
||||||
#include <wifi.hpp>
|
#include <wifi.hpp>
|
||||||
|
|
||||||
|
//#define FORCE_GRAVITY_MODE
|
||||||
|
|
||||||
// Define constats for this program
|
// Define constats for this program
|
||||||
#ifdef DEACTIVATE_SLEEPMODE
|
#ifdef DEACTIVATE_SLEEPMODE
|
||||||
const int interval = 1000; // ms, time to wait between changes to output
|
const int interval = 1000; // ms, time to wait between changes to output
|
||||||
@ -46,8 +48,6 @@ uint32_t runtimeMillis; // Used to calculate the total time since start/wakeup
|
|||||||
uint32_t stableGyroMillis; // Used to calculate the total time since last
|
uint32_t stableGyroMillis; // Used to calculate the total time since last
|
||||||
// stable gyro reading
|
// stable gyro reading
|
||||||
|
|
||||||
enum RunMode { gravityMode = 0, configurationMode = 1, wifiSetupMode = 2 };
|
|
||||||
|
|
||||||
RunMode runMode = RunMode::gravityMode;
|
RunMode runMode = RunMode::gravityMode;
|
||||||
|
|
||||||
//
|
//
|
||||||
@ -63,6 +63,7 @@ void checkSleepMode(float angle, float volt) {
|
|||||||
#if defined(FORCE_GRAVITY_MODE)
|
#if defined(FORCE_GRAVITY_MODE)
|
||||||
Log.notice(F("MAIN: Forcing device into gravity mode for debugging" CR));
|
Log.notice(F("MAIN: Forcing device into gravity mode for debugging" CR));
|
||||||
runMode = RunMode::gravityMode;
|
runMode = RunMode::gravityMode;
|
||||||
|
return;
|
||||||
#endif
|
#endif
|
||||||
|
|
||||||
const RawGyroData &g = myConfig.getGyroCalibration();
|
const RawGyroData &g = myConfig.getGyroCalibration();
|
||||||
|
@ -29,6 +29,9 @@ SOFTWARE.
|
|||||||
#include <ArduinoLog.h>
|
#include <ArduinoLog.h>
|
||||||
#include <stdlib.h>
|
#include <stdlib.h>
|
||||||
|
|
||||||
|
enum RunMode { gravityMode = 0, configurationMode = 1, wifiSetupMode = 2 };
|
||||||
|
extern RunMode runMode;
|
||||||
|
|
||||||
#if defined(ESP8266)
|
#if defined(ESP8266)
|
||||||
#include <LittleFS.h>
|
#include <LittleFS.h>
|
||||||
#define ESP_RESET ESP.reset
|
#define ESP_RESET ESP.reset
|
||||||
|
@ -204,12 +204,18 @@ void PushTarget::sendInfluxDb2(TemplatingEngine& engine, bool isSecure) {
|
|||||||
String auth = "Token " + String(myConfig.getInfluxDb2PushToken());
|
String auth = "Token " + String(myConfig.getInfluxDb2PushToken());
|
||||||
|
|
||||||
if (isSecure) {
|
if (isSecure) {
|
||||||
|
if (runMode == RunMode::configurationMode) {
|
||||||
|
Log.notice(F("PUSH: Skipping InfluxDB since SSL is enabled and we are in config mode." CR));
|
||||||
|
return;
|
||||||
|
}
|
||||||
|
|
||||||
Log.notice(F("PUSH: InfluxDB, SSL enabled without validation." CR));
|
Log.notice(F("PUSH: InfluxDB, SSL enabled without validation." CR));
|
||||||
_wifiSecure.setInsecure();
|
_wifiSecure.setInsecure();
|
||||||
probeMaxFragement(serverPath);
|
probeMaxFragement(serverPath);
|
||||||
_httpSecure.setTimeout(myAdvancedConfig.getPushTimeout() * 1000);
|
_httpSecure.setTimeout(myAdvancedConfig.getPushTimeout() * 1000);
|
||||||
_httpSecure.begin(_wifiSecure, serverPath);
|
_httpSecure.begin(_wifiSecure, serverPath);
|
||||||
_httpSecure.addHeader(F("Authorization"), auth.c_str());
|
_httpSecure.addHeader(F("Authorization"), auth.c_str());
|
||||||
|
_httpSecure.setReuse(true);
|
||||||
_lastCode = _httpSecure.POST(doc);
|
_lastCode = _httpSecure.POST(doc);
|
||||||
} else {
|
} else {
|
||||||
_http.setTimeout(myAdvancedConfig.getPushTimeout() * 1000);
|
_http.setTimeout(myAdvancedConfig.getPushTimeout() * 1000);
|
||||||
@ -284,6 +290,11 @@ void PushTarget::sendHttpPost(TemplatingEngine& engine, bool isSecure,
|
|||||||
#endif
|
#endif
|
||||||
|
|
||||||
if (isSecure) {
|
if (isSecure) {
|
||||||
|
if (runMode == RunMode::configurationMode) {
|
||||||
|
Log.notice(F("PUSH: Skipping HTTP since SSL is enabled and we are in config mode." CR));
|
||||||
|
return;
|
||||||
|
}
|
||||||
|
|
||||||
Log.notice(F("PUSH: HTTP, SSL enabled without validation." CR));
|
Log.notice(F("PUSH: HTTP, SSL enabled without validation." CR));
|
||||||
_wifiSecure.setInsecure();
|
_wifiSecure.setInsecure();
|
||||||
probeMaxFragement(serverPath);
|
probeMaxFragement(serverPath);
|
||||||
@ -353,6 +364,11 @@ void PushTarget::sendHttpGet(TemplatingEngine& engine, bool isSecure) {
|
|||||||
#endif
|
#endif
|
||||||
|
|
||||||
if (isSecure) {
|
if (isSecure) {
|
||||||
|
if (runMode == RunMode::configurationMode) {
|
||||||
|
Log.notice(F("PUSH: Skipping HTTP since SSL is enabled and we are in config mode." CR));
|
||||||
|
return;
|
||||||
|
}
|
||||||
|
|
||||||
Log.notice(F("PUSH: HTTP, SSL enabled without validation." CR));
|
Log.notice(F("PUSH: HTTP, SSL enabled without validation." CR));
|
||||||
_wifiSecure.setInsecure();
|
_wifiSecure.setInsecure();
|
||||||
probeMaxFragement(serverPath);
|
probeMaxFragement(serverPath);
|
||||||
@ -399,6 +415,11 @@ void PushTarget::sendMqtt(TemplatingEngine& engine, bool isSecure) {
|
|||||||
int port = myConfig.getMqttPort();
|
int port = myConfig.getMqttPort();
|
||||||
|
|
||||||
if (myConfig.isMqttSSL()) {
|
if (myConfig.isMqttSSL()) {
|
||||||
|
if (runMode == RunMode::configurationMode) {
|
||||||
|
Log.notice(F("PUSH: Skipping MQTT since SSL is enabled and we are in config mode." CR));
|
||||||
|
return;
|
||||||
|
}
|
||||||
|
|
||||||
Log.notice(F("PUSH: MQTT, SSL enabled without validation." CR));
|
Log.notice(F("PUSH: MQTT, SSL enabled without validation." CR));
|
||||||
_wifiSecure.setInsecure();
|
_wifiSecure.setInsecure();
|
||||||
|
|
||||||
|
Reference in New Issue
Block a user