Compare commits

..

3 Commits

Author SHA1 Message Date
Gunnar Skjold
0f4848c872 Added missing dep 2020-04-07 20:56:49 +02:00
Gunnar Skjold
6911d203ca Merge pull request #56 from gskjold/dev-v1.2
Version 1.2
2020-04-07 20:53:39 +02:00
Gunnar Skjold
e96b5bbf1b Changes during testing 2020-03-30 21:14:58 +02:00
4 changed files with 13 additions and 6 deletions

View File

@@ -4,7 +4,7 @@ extra_configs = platformio-user.ini
[common]
framework = arduino
lib_deps = HanReader@1.0.1, ArduinoJson@6.14.1, MQTT@2.4.7, DallasTemperature@3.8.1, EspSoftwareSerial@6.7.1, Base64@1.0.0, RemoteDebug@3.0.5
lib_deps = HanReader@1.0.1, ArduinoJson@6.14.1, MQTT@2.4.7, DallasTemperature@3.8.1, EspSoftwareSerial@6.7.1, Base64@1.0.0, RemoteDebug@3.0.5, Time@1.6
[env:hw1esp12e]
platform = espressif8266@2.3.3

View File

@@ -61,7 +61,6 @@ void setup() {
if(config.hasConfig()) {
config.load();
}
#if DEBUG_MODE
#if HW_ROARFRED
if(config.getMeterType() == 3) {
Serial.begin(2400, SERIAL_8N1);
@@ -70,15 +69,14 @@ void setup() {
}
#else
Serial.begin(115200);
#endif
#endif
if(config.hasConfig()) {
Debug.begin(config.getWifiHostname(), (uint8_t) config.getDebugLevel());
if(config.getAuthSecurity() > 0) {
Debug.setPassword(config.getAuthPassword());
}
Debug.setSerialEnabled(config.isDebugSerial());
Debug.begin(config.getWifiHostname(), (uint8_t) config.getDebugLevel());
if(!config.isDebugTelnet()) {
Debug.stop();
}
@@ -96,7 +94,7 @@ void setup() {
debugI("Voltage: %.2fV", vcc);
}
if (vcc > 0 && vcc < 3.1) {
if (vcc > 0 && vcc < 3.25) {
if(Debug.isActive(RemoteDebug::INFO)) {
debugI("Votltage is too low, sleeping");
Serial.flush();

View File

@@ -248,6 +248,9 @@ void AmsWebServer::configMqttHtml() {
html.replace("${config.mqttUser}", config->getMqttUser());
html.replace("${config.mqttPassword}", config->getMqttPassword());
html.replace("${config.mqttPayloadFormat}", String(config->getMqttPayloadFormat()));
for(int i = 0; i<2; i++) {
html.replace("${config.mqttPayloadFormat" + String(i) + "}", config->getMqttPayloadFormat() == i ? "selected" : "");
}
server.setContentLength(html.length());
server.send(200, "text/html", html);
@@ -496,7 +499,9 @@ void AmsWebServer::handleSave() {
if(config->getAuthSecurity() > 0) {
config->setAuthUser(server.arg("authUser"));
config->setAuthPassword(server.arg("authPassword"));
debugger->setPassword(config->getAuthPassword());
} else {
debugger->setPassword("");
config->clearAuth();
}
}
@@ -505,12 +510,15 @@ void AmsWebServer::handleSave() {
config->setDebugTelnet(server.hasArg("debugTelnet") && server.arg("debugTelnet") == "true");
config->setDebugSerial(server.hasArg("debugSerial") && server.arg("debugSerial") == "true");
config->setDebugLevel(server.arg("debugLevel").toInt());
debugger->stop();
debugger->begin(config->getWifiHostname(), (uint8_t) config->getDebugLevel());
if(config->getAuthSecurity() > 0) {
debugger->setPassword(config->getAuthPassword());
} else {
debugger->setPassword("");
}
debugger->setSerialEnabled(config->isDebugSerial());
debugger->begin(config->getWifiHostname(), (uint8_t) config->getDebugLevel());
if(!config->isDebugTelnet()) {
debugger->stop();
}

View File

@@ -41,6 +41,7 @@
<form method="post" action="/save">
<input type="hidden" name="sysConfig" value="true"/>
<div class="my-3 p-3 bg-white rounded shadow">
<div class="alert alert-warning">!!WARNING!!<br/>Remote debugging is considered insecure and should not be left enabled when not debugging</div>
<div class="row">
<div class="col-md-3">
<label><input type="checkbox" name="debugTelnet" value="true" ${config.debugTelnet}/> Telnet debugger</label>