mirror of
https://github.com/UtilitechAS/amsreader-firmware.git
synced 2026-01-13 15:37:03 +00:00
Some changes during testing
This commit is contained in:
parent
859220d33f
commit
e79a0585f0
@ -1005,6 +1005,7 @@ void AmsConfiguration::print(Print* debugger)
|
||||
debugger->printf("fuseSize: %i\r\n", this->getMainFuse());
|
||||
debugger->printf("productionCapacity: %i\r\n", this->getProductionCapacity());
|
||||
debugger->printf("Substitute missing: %s\r\n", this->isSubstituteMissing() ? "Yes" : "No");
|
||||
Serial.flush();
|
||||
|
||||
debugger->printf("HAN pin: %i\r\n", this->getHanPin());
|
||||
debugger->printf("LED pin: %i\r\n", this->getLedPin());
|
||||
@ -1015,6 +1016,7 @@ void AmsConfiguration::print(Print* debugger)
|
||||
debugger->printf("LED inverted: %s\r\n", this->isLedRgbInverted() ? "Yes" : "No");
|
||||
debugger->printf("AP pin: %i\r\n", this->getApPin());
|
||||
debugger->printf("Temperature pin: %i\r\n", this->getTempSensorPin());
|
||||
Serial.flush();
|
||||
|
||||
debugger->printf("Vcc pin: %i\r\n", this->getVccPin());
|
||||
debugger->printf("Vcc multiplier: %f\r\n", this->getVccMultiplier());
|
||||
|
||||
@ -158,14 +158,6 @@ void setup() {
|
||||
#endif
|
||||
}
|
||||
|
||||
uint8_t c = config.getTempSensorCount();
|
||||
for(int i = 0; i < c; i++) {
|
||||
TempSensorConfig* tsc = config.getTempSensorConfig(i);
|
||||
hw.confTempSensor(tsc->address, tsc->name, tsc->common);
|
||||
Debug.print("Sensor name: ");
|
||||
Debug.println(tsc->name);
|
||||
}
|
||||
|
||||
double vcc = hw.getVcc();
|
||||
|
||||
if (Debug.isActive(RemoteDebug::INFO)) {
|
||||
@ -255,11 +247,11 @@ void setup() {
|
||||
|
||||
if(config.hasConfig()) {
|
||||
if(Debug.isActive(RemoteDebug::INFO)) config.print(&Debug);
|
||||
WiFi_connect();
|
||||
if(config.isNtpEnable()) {
|
||||
configTime(config.getNtpOffset(), config.getNtpSummerOffset(), config.getNtpServer());
|
||||
sntp_servermode_dhcp(config.isNtpDhcp() ? 1 : 0);
|
||||
}
|
||||
WiFi_connect();
|
||||
} else {
|
||||
if(Debug.isActive(RemoteDebug::INFO)) {
|
||||
debugI("No configuration, booting AP");
|
||||
@ -389,8 +381,12 @@ void loop() {
|
||||
debugI("IP: %s", WiFi.localIP().toString().c_str());
|
||||
}
|
||||
if(strlen(config.getWifiHostname()) > 0 && config.isMdnsEnable()) {
|
||||
MDNS.begin(config.getWifiHostname());
|
||||
MDNS.addService("http", "tcp", 80);
|
||||
debugD("mDNS is enabled, using host: %s", config.getWifiHostname());
|
||||
if(MDNS.begin(config.getWifiHostname())) {
|
||||
MDNS.addService("http", "tcp", 80);
|
||||
} else {
|
||||
debugE("Failed to set up mDNS!");
|
||||
}
|
||||
}
|
||||
}
|
||||
if(config.isNtpChanged()) {
|
||||
@ -911,6 +907,10 @@ void WiFi_connect() {
|
||||
dns1.fromString(config.getWifiDns1());
|
||||
dns2.fromString(config.getWifiDns2());
|
||||
WiFi.config(ip, gw, sn, dns1, dns2);
|
||||
} else {
|
||||
#if defined(ESP32)
|
||||
WiFi.config(INADDR_NONE, INADDR_NONE, INADDR_NONE); // Workaround to make DHCP hostname work for ESP32
|
||||
#endif
|
||||
}
|
||||
if(strlen(config.getWifiHostname()) > 0) {
|
||||
#if defined(ESP8266)
|
||||
|
||||
@ -24,6 +24,7 @@
|
||||
#include "root/reset_html.h"
|
||||
#include "root/temperature_head_html.h"
|
||||
#include "root/temperature_row_html.h"
|
||||
#include "root/temperature_none_html.h"
|
||||
#include "root/temperature_foot_html.h"
|
||||
|
||||
#include "base64.h"
|
||||
@ -151,6 +152,10 @@ void AmsWebServer::temperature() {
|
||||
html += row;
|
||||
}
|
||||
|
||||
if(c == 0) {
|
||||
html += String((const __FlashStringHelper*) TEMPERATURE_NONE_HTML);
|
||||
}
|
||||
|
||||
if(start > 0 || end < c) {
|
||||
html += "<div class=\"row\"><div class=\"col-6\">";
|
||||
if(start > 0) {
|
||||
|
||||
@ -4,7 +4,7 @@
|
||||
<h6>NTP</h6>
|
||||
<label class="m-2"><input id="ntpEnable" type="checkbox" name="ntpEnable" value="true" ${config.ntpEnable}/> Enable</label>
|
||||
<div class="row">
|
||||
<div class="col-xl-2 col-lg-3 col-md-4 col-sm-5">
|
||||
<div class="col-lg-3 col-md-4 col-sm-5">
|
||||
<div class="m-2 input-group input-group-sm">
|
||||
<div class="input-group-prepend">
|
||||
<span class="input-group-text">Timezone</span>
|
||||
|
||||
1
web/temperature_none.html
Normal file
1
web/temperature_none.html
Normal file
@ -0,0 +1 @@
|
||||
<div class="alert alert-info">No temperature sensors is configured or found</div>
|
||||
Loading…
x
Reference in New Issue
Block a user