mirror of
https://github.com/UtilitechAS/amsreader-firmware.git
synced 2026-01-13 23:45:25 +00:00
Added option to substitute missing I2 for Aidon IT meters. Also cleaned up some more UI
This commit is contained in:
parent
dc83853d2e
commit
c3c0ca0a1b
@ -254,6 +254,14 @@ void AmsConfiguration::setProductionCapacity(uint8_t productionCapacity) {
|
||||
config.productionCapacity = productionCapacity;
|
||||
}
|
||||
|
||||
bool AmsConfiguration::isSubstituteMissing() {
|
||||
return config.substituteMissing;
|
||||
}
|
||||
|
||||
void AmsConfiguration::setSubstituteMissing(bool substituteMissing) {
|
||||
config.substituteMissing = substituteMissing;
|
||||
}
|
||||
|
||||
bool AmsConfiguration::isDebugTelnet() {
|
||||
return config.debugTelnet;
|
||||
}
|
||||
@ -278,43 +286,43 @@ void AmsConfiguration::setDebugLevel(uint8_t debugLevel) {
|
||||
config.debugLevel = debugLevel;
|
||||
}
|
||||
|
||||
int AmsConfiguration::getDomoELIDX() {
|
||||
uint16_t AmsConfiguration::getDomoELIDX() {
|
||||
return config.domoELIDX;
|
||||
}
|
||||
int AmsConfiguration::getDomoVL1IDX() {
|
||||
uint16_t AmsConfiguration::getDomoVL1IDX() {
|
||||
return config.domoVL1IDX;
|
||||
}
|
||||
int AmsConfiguration::getDomoVL2IDX() {
|
||||
uint16_t AmsConfiguration::getDomoVL2IDX() {
|
||||
return config.domoVL2IDX;
|
||||
}
|
||||
int AmsConfiguration::getDomoVL3IDX() {
|
||||
uint16_t AmsConfiguration::getDomoVL3IDX() {
|
||||
return config.domoVL3IDX;
|
||||
}
|
||||
int AmsConfiguration::getDomoCL1IDX() {
|
||||
uint16_t AmsConfiguration::getDomoCL1IDX() {
|
||||
return config.domoCL1IDX;
|
||||
}
|
||||
|
||||
void AmsConfiguration::setDomoELIDX(int domoELIDX) {
|
||||
void AmsConfiguration::setDomoELIDX(uint16_t domoELIDX) {
|
||||
domoChanged |= config.domoELIDX != domoELIDX;
|
||||
config.domoELIDX = domoELIDX;
|
||||
}
|
||||
|
||||
void AmsConfiguration::setDomoVL1IDX(int domoVL1IDX) {
|
||||
void AmsConfiguration::setDomoVL1IDX(uint16_t domoVL1IDX) {
|
||||
domoChanged |= config.domoVL1IDX != domoVL1IDX;
|
||||
config.domoVL1IDX = domoVL1IDX;
|
||||
}
|
||||
|
||||
void AmsConfiguration::setDomoVL2IDX(int domoVL2IDX) {
|
||||
void AmsConfiguration::setDomoVL2IDX(uint16_t domoVL2IDX) {
|
||||
domoChanged |= config.domoVL2IDX != domoVL2IDX;
|
||||
config.domoVL2IDX = domoVL2IDX;
|
||||
}
|
||||
|
||||
void AmsConfiguration::setDomoVL3IDX(int domoVL3IDX) {
|
||||
void AmsConfiguration::setDomoVL3IDX(uint16_t domoVL3IDX) {
|
||||
domoChanged |= config.domoVL3IDX != domoVL3IDX;
|
||||
config.domoVL3IDX = domoVL3IDX;
|
||||
}
|
||||
|
||||
void AmsConfiguration::setDomoCL1IDX(int domoCL1IDX) {
|
||||
void AmsConfiguration::setDomoCL1IDX(uint16_t domoCL1IDX) {
|
||||
domoChanged |= config.domoCL1IDX != domoCL1IDX;
|
||||
config.domoCL1IDX = domoCL1IDX;
|
||||
}
|
||||
@ -450,14 +458,14 @@ void AmsConfiguration::setVccMultiplier(double vccMultiplier) {
|
||||
}
|
||||
|
||||
double AmsConfiguration::getVccBootLimit() {
|
||||
return config.vccBootLimit / 10;
|
||||
return config.vccBootLimit / 10.0;
|
||||
}
|
||||
|
||||
void AmsConfiguration::setVccBootLimit(double vccBootLimit) {
|
||||
if(vccBootLimit == 0.0)
|
||||
config.vccBootLimit = 0;
|
||||
else
|
||||
config.vccBootLimit = max(2.5, min(vccBootLimit, 3.5)) * 10;
|
||||
config.vccBootLimit = max(25, min((int)(vccBootLimit * 10), 35));
|
||||
}
|
||||
bool AmsConfiguration::isDomoChanged() {
|
||||
return domoChanged;
|
||||
@ -800,6 +808,7 @@ void AmsConfiguration::print(Print* debugger)
|
||||
debugger->printf("distSys: %i\r\n", this->getDistributionSystem());
|
||||
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");
|
||||
|
||||
debugger->printf("HAN pin: %i\r\n", this->getHanPin());
|
||||
debugger->printf("LED pin: %i\r\n", this->getLedPin());
|
||||
@ -811,6 +820,10 @@ void AmsConfiguration::print(Print* debugger)
|
||||
debugger->printf("AP pin: %i\r\n", this->getApPin());
|
||||
debugger->printf("Temperature pin: %i\r\n", this->getTempSensorPin());
|
||||
|
||||
debugger->printf("Vcc pin: %i\r\n", this->getVccPin());
|
||||
debugger->printf("Vcc multiplier: %f\r\n", this->getVccMultiplier());
|
||||
debugger->printf("Vcc boot limit: %f\r\n", this->getVccBootLimit());
|
||||
|
||||
if(this->getDomoELIDX() > 0) {
|
||||
debugger->printf("Domoticz ELIDX: %i\r\n", this->getDomoELIDX());
|
||||
debugger->printf("Domoticz VL1IDX: %i\r\n", this->getDomoVL1IDX());
|
||||
|
||||
@ -28,6 +28,7 @@ struct ConfigObject {
|
||||
uint8_t distributionSystem;
|
||||
uint8_t mainFuse;
|
||||
uint8_t productionCapacity;
|
||||
bool substituteMissing;
|
||||
|
||||
bool debugTelnet;
|
||||
bool debugSerial;
|
||||
@ -46,11 +47,11 @@ struct ConfigObject {
|
||||
uint16_t vccMultiplier;
|
||||
uint8_t vccBootLimit;
|
||||
|
||||
int domoELIDX;
|
||||
int domoVL1IDX;
|
||||
int domoVL2IDX;
|
||||
int domoVL3IDX;
|
||||
int domoCL1IDX;
|
||||
uint16_t domoELIDX;
|
||||
uint16_t domoVL1IDX;
|
||||
uint16_t domoVL2IDX;
|
||||
uint16_t domoVL3IDX;
|
||||
uint16_t domoCL1IDX;
|
||||
};
|
||||
|
||||
class AmsConfiguration {
|
||||
@ -122,6 +123,8 @@ public:
|
||||
void setMainFuse(uint8_t mainFuse);
|
||||
uint8_t getProductionCapacity();
|
||||
void setProductionCapacity(uint8_t productionCapacity);
|
||||
bool isSubstituteMissing();
|
||||
void setSubstituteMissing(bool substituteMissing);
|
||||
|
||||
bool isDebugTelnet();
|
||||
void setDebugTelnet(bool debugTelnet);
|
||||
@ -161,17 +164,16 @@ public:
|
||||
|
||||
void print(Print* debugger);
|
||||
|
||||
int getDomoELIDX();
|
||||
int getDomoVL1IDX();
|
||||
int getDomoVL2IDX();
|
||||
int getDomoVL3IDX();
|
||||
int getDomoCL1IDX();
|
||||
double getDomoEnergy();
|
||||
void setDomoELIDX(int domoELIDX);
|
||||
void setDomoVL1IDX(int domoVL1IDX);
|
||||
void setDomoVL2IDX(int domoVL2IDX);
|
||||
void setDomoVL3IDX(int domoVL3IDX);
|
||||
void setDomoCL1IDX(int domoCL1IDX);
|
||||
uint16_t getDomoELIDX();
|
||||
uint16_t getDomoVL1IDX();
|
||||
uint16_t getDomoVL2IDX();
|
||||
uint16_t getDomoVL3IDX();
|
||||
uint16_t getDomoCL1IDX();
|
||||
void setDomoELIDX(uint16_t domoELIDX);
|
||||
void setDomoVL1IDX(uint16_t domoVL1IDX);
|
||||
void setDomoVL2IDX(uint16_t domoVL2IDX);
|
||||
void setDomoVL3IDX(uint16_t domoVL3IDX);
|
||||
void setDomoCL1IDX(uint16_t domoCL1IDX);
|
||||
void clearDomo();
|
||||
|
||||
bool isDomoChanged();
|
||||
@ -206,6 +208,7 @@ private:
|
||||
0, // Distribution system
|
||||
0, // Main fuse
|
||||
0, // Production capacity
|
||||
false, // Substitute
|
||||
false, // Debug telnet
|
||||
false, // Debug serial
|
||||
5, // Debug level
|
||||
|
||||
@ -5,7 +5,7 @@
|
||||
|
||||
AmsData::AmsData() {}
|
||||
|
||||
AmsData::AmsData(int meterType, HanReader& hanReader) {
|
||||
AmsData::AmsData(int meterType, bool substituteMissing, HanReader& hanReader) {
|
||||
lastUpdateMillis = millis();
|
||||
packageTimestamp = hanReader.getPackageTime();
|
||||
|
||||
@ -15,7 +15,7 @@ AmsData::AmsData(int meterType, HanReader& hanReader) {
|
||||
extractFromKaifa(hanReader, listSize);
|
||||
break;
|
||||
case METER_TYPE_AIDON:
|
||||
extractFromAidon(hanReader, listSize);
|
||||
extractFromAidon(hanReader, listSize, substituteMissing);
|
||||
break;
|
||||
case METER_TYPE_KAMSTRUP:
|
||||
extractFromKamstrup(hanReader, listSize);
|
||||
@ -87,7 +87,7 @@ void AmsData::extractFromKaifa(HanReader& hanReader, int listSize) {
|
||||
}
|
||||
}
|
||||
|
||||
void AmsData::extractFromAidon(HanReader& hanReader, int listSize) {
|
||||
void AmsData::extractFromAidon(HanReader& hanReader, int listSize, bool substituteMissing) {
|
||||
switch(listSize) {
|
||||
case (int)Aidon::List1:
|
||||
listType = 1;
|
||||
@ -168,7 +168,9 @@ void AmsData::extractFromAidon(HanReader& hanReader, int listSize) {
|
||||
l1voltage = ((double) hanReader.getInt( (int)Aidon_List3PhaseIT::VoltageL1)) / 10;
|
||||
l2voltage = ((double) hanReader.getInt( (int)Aidon_List3PhaseIT::VoltageL2)) / 10;
|
||||
l3voltage = ((double) hanReader.getInt( (int)Aidon_List3PhaseIT::VoltageL3)) / 10;
|
||||
//l2current = ((activeImportPower * sqrt(3)) - (l1voltage * l1current) - (l3voltage * l3current)) / l2voltage;
|
||||
if(substituteMissing) {
|
||||
l2current = ((activeImportPower * sqrt(3)) - (l1voltage * l1current) - (l3voltage * l3current)) / l2voltage;
|
||||
}
|
||||
break;
|
||||
}
|
||||
}
|
||||
|
||||
@ -12,7 +12,7 @@
|
||||
class AmsData {
|
||||
public:
|
||||
AmsData();
|
||||
AmsData(int meterType, HanReader& hanReader);
|
||||
AmsData(int meterType, bool substituteMissing, HanReader& hanReader);
|
||||
|
||||
void apply(AmsData& other);
|
||||
|
||||
@ -60,7 +60,7 @@ private:
|
||||
bool threePhase = false;
|
||||
|
||||
void extractFromKaifa(HanReader& hanReader, int listSize);
|
||||
void extractFromAidon(HanReader& hanReader, int listSize);
|
||||
void extractFromAidon(HanReader& hanReader, int listSize, bool substituteMissing);
|
||||
void extractFromKamstrup(HanReader& hanReader, int listSize);
|
||||
};
|
||||
|
||||
|
||||
@ -503,7 +503,7 @@ void readHanPort() {
|
||||
else
|
||||
hw.ledBlink(LED_INTERNAL, 1);
|
||||
|
||||
AmsData data(config.getMeterType(), hanReader);
|
||||
AmsData data(config.getMeterType(), config.isSubstituteMissing(), hanReader);
|
||||
if(data.getListType() > 0) {
|
||||
ws.setData(data);
|
||||
|
||||
@ -525,20 +525,7 @@ void readHanPort() {
|
||||
// Start DOMOTICZ
|
||||
//
|
||||
} else if(config.getMqttPayloadFormat() == 3) {
|
||||
//
|
||||
// This part is also publishing standard json message for now. May be removed.
|
||||
//
|
||||
StaticJsonDocument<512> json;
|
||||
hanToJson(json, data, hw, temperature);
|
||||
if (Debug.isActive(RemoteDebug::INFO)) {
|
||||
debugI("Sending data to MQTT");
|
||||
if (Debug.isActive(RemoteDebug::DEBUG)) {
|
||||
serializeJsonPretty(json, Debug);
|
||||
}
|
||||
}
|
||||
String msg;
|
||||
serializeJson(json, msg);
|
||||
mqtt.publish(config.getMqttPublishTopic(), msg.c_str()); // keep for now, this is identical to option 0.
|
||||
debugI("Sending data to MQTT");
|
||||
//
|
||||
// Special MQTT messages for DOMOTIZ (https://www.domoticz.com/wiki/MQTT)
|
||||
// -All messages should be published to topic "domoticz/in"
|
||||
|
||||
@ -211,6 +211,7 @@ void AmsWebServer::configMeterHtml() {
|
||||
html.replace("${config.mainFuse" + String(i) + "}", config->getMainFuse() == i ? "selected" : "");
|
||||
}
|
||||
html.replace("${config.productionCapacity}", String(config->getProductionCapacity()));
|
||||
html.replace("${config.substituteMissing}", config->isSubstituteMissing() ? "checked" : "");
|
||||
|
||||
server.setContentLength(html.length());
|
||||
server.send(200, "text/html", html);
|
||||
@ -230,7 +231,7 @@ void AmsWebServer::configWifiHtml() {
|
||||
|
||||
html.replace("${config.wifiSsid}", config->getWifiSsid());
|
||||
html.replace("${config.wifiPassword}", config->getWifiPassword());
|
||||
html.replace("${config.wifiIpType1}", strlen(config->getWifiIp()) > 0 ? "selected" : "");
|
||||
html.replace("${config.wifiStaticIp}", strlen(config->getWifiIp()) > 0 ? "checked" : "");
|
||||
html.replace("${config.wifiIp}", config->getWifiIp());
|
||||
html.replace("${config.wifiGw}", config->getWifiGw());
|
||||
html.replace("${config.wifiSubnet}", config->getWifiSubnet());
|
||||
@ -639,6 +640,7 @@ void AmsWebServer::handleSave() {
|
||||
config->setDistributionSystem(server.arg("distributionSystem").toInt());
|
||||
config->setMainFuse(server.arg("mainFuse").toInt());
|
||||
config->setProductionCapacity(server.arg("productionCapacity").toInt());
|
||||
config->setSubstituteMissing(server.hasArg("substituteMissing") && server.arg("substituteMissing") == "true");
|
||||
}
|
||||
|
||||
if(server.hasArg("wifiConfig") && server.arg("wifiConfig") == "true") {
|
||||
|
||||
@ -4,7 +4,7 @@
|
||||
<meta name="viewport" content="width=device-width, initial-scale=1">
|
||||
<title>AMS reader - WiFi configuration</title>
|
||||
<meta http-equiv="X-UA-Compatible" content="IE=edge">
|
||||
<link rel="stylesheet" href="https://stackpath.bootstrapcdn.com/bootstrap/4.4.1/css/bootstrap.min.css" integrity="sha384-Vkoo8x4CGsO3+Hhxv8T/Q5PaXtkKtu6ug5TOeNV6gBiFeWPGFN9MuhOf23Q9Ifjh" crossorigin="anonymous">
|
||||
<link rel="stylesheet" href="https://stackpath.bootstrapcdn.com/bootstrap/4.4.1/css/bootstrap.min.css">
|
||||
</head>
|
||||
<body class="bg-light">
|
||||
<main role="main" class="container">
|
||||
|
||||
@ -4,7 +4,8 @@
|
||||
<meta name="viewport" content="width=device-width, initial-scale=1">
|
||||
<title>AMS reader - Meter configuration</title>
|
||||
<meta http-equiv="X-UA-Compatible" content="IE=edge">
|
||||
<link rel="stylesheet" href="https://stackpath.bootstrapcdn.com/bootstrap/4.4.1/css/bootstrap.min.css" integrity="sha384-Vkoo8x4CGsO3+Hhxv8T/Q5PaXtkKtu6ug5TOeNV6gBiFeWPGFN9MuhOf23Q9Ifjh" crossorigin="anonymous">
|
||||
<link rel="stylesheet" href="https://stackpath.bootstrapcdn.com/bootstrap/4.4.1/css/bootstrap.min.css">
|
||||
<script src="https://code.jquery.com/jquery-3.4.1.slim.min.js"></script>
|
||||
</head>
|
||||
<body class="bg-light">
|
||||
<main role="main" class="container">
|
||||
@ -41,52 +42,61 @@
|
||||
<input type="hidden" name="meterConfig" value="true"/>
|
||||
<div class="my-3 p-3 bg-white rounded shadow">
|
||||
<div class="row">
|
||||
<div class="col-md-4">
|
||||
<div class="row form-group">
|
||||
<label class="col-6">Meter type</label>
|
||||
<div class="col-6">
|
||||
<select class="form-control" name="meterType">
|
||||
<option value="0" ${config.meterType0}>Autodetect</option>
|
||||
<option value="1" ${config.meterType1}>Kaifa</option>
|
||||
<option value="2" ${config.meterType2}>Aidon</option>
|
||||
<option value="3" ${config.meterType3}>Kamstrup</option>
|
||||
</select>
|
||||
<div class="col-lg-3 col-md-4 col-sm-6">
|
||||
<div class="m-2 input-group input-group-sm">
|
||||
<div class="input-group-prepend">
|
||||
<span class="input-group-text">Meter type</span>
|
||||
</div>
|
||||
<select id="meterType" class="form-control subtitute-dependent" name="meterType">
|
||||
<option value="0" ${config.meterType0}>Autodetect</option>
|
||||
<option value="1" ${config.meterType1}>Kaifa</option>
|
||||
<option value="2" ${config.meterType2}>Aidon</option>
|
||||
<option value="3" ${config.meterType3}>Kamstrup</option>
|
||||
</select>
|
||||
</div>
|
||||
<div class="row form-group">
|
||||
<label class="col-6">Distribution system</label>
|
||||
<div class="col-6">
|
||||
<select class="form-control" name="distributionSystem">
|
||||
<option value="0" ${config.distributionSystem0}></option>
|
||||
<option value="1" ${config.distributionSystem1}>IT (230V)</option>
|
||||
<option value="2" ${config.distributionSystem2}>TN (400V)</option>
|
||||
</select>
|
||||
</div>
|
||||
<div class="col-xl-3 col-lg-4 col-md-5 col-sm-6">
|
||||
<div class="m-2 input-group input-group-sm">
|
||||
<div class="input-group-prepend">
|
||||
<span class="input-group-text">Distribution system</span>
|
||||
</div>
|
||||
<select id="distributionSystem" class="form-control subtitute-dependent" name="distributionSystem">
|
||||
<option value="0" ${config.distributionSystem0}></option>
|
||||
<option value="1" ${config.distributionSystem1}>IT (230V)</option>
|
||||
<option value="2" ${config.distributionSystem2}>TN (400V)</option>
|
||||
</select>
|
||||
</div>
|
||||
</div>
|
||||
<div class="col-xl-2 col-md-3 col-sm-5">
|
||||
<div class="m-2 input-group input-group-sm">
|
||||
<div class="input-group-prepend">
|
||||
<span class="input-group-text">Main fuse</span>
|
||||
</div>
|
||||
<select class="form-control" name="mainFuse">
|
||||
<option value="0" ${config.mainFuse0}></option>
|
||||
<option value="25" ${config.mainFuse25}>25A</option>
|
||||
<option value="32" ${config.mainFuse32}>32A</option>
|
||||
<option value="35" ${config.mainFuse32}>35A</option>
|
||||
<option value="40" ${config.mainFuse40}>40A</option>
|
||||
<option value="50" ${config.mainFuse50}>50A</option>
|
||||
<option value="63" ${config.mainFuse63}>63A</option>
|
||||
</select>
|
||||
</div>
|
||||
</div>
|
||||
<div class="col-xl-3 col-lg-4 col-md-5 col-sm-7">
|
||||
<div class="m-2 input-group input-group-sm">
|
||||
<div class="input-group-prepend">
|
||||
<span class="input-group-text">Production capacity</span>
|
||||
</div>
|
||||
<input class="form-control" name="productionCapacity" type="number" min="0" max="50" value="${config.productionCapacity}"/>
|
||||
<div class="input-group-append">
|
||||
<span class="input-group-text">kWp</span>
|
||||
</div>
|
||||
</div>
|
||||
</div>
|
||||
<div class="col-md-4">
|
||||
<div class="row form-group">
|
||||
<label class="col-6">Main fuse</label>
|
||||
<div class="col-6">
|
||||
<select class="form-control" name="mainFuse">
|
||||
<option value="0" ${config.mainFuse0}></option>
|
||||
<option value="25" ${config.mainFuse25}>25A</option>
|
||||
<option value="32" ${config.mainFuse32}>32A</option>
|
||||
<option value="35" ${config.mainFuse32}>35A</option>
|
||||
<option value="40" ${config.mainFuse40}>40A</option>
|
||||
<option value="50" ${config.mainFuse50}>50A</option>
|
||||
<option value="63" ${config.mainFuse63}>63A</option>
|
||||
</select>
|
||||
</div>
|
||||
</div>
|
||||
<div class="row form-group">
|
||||
<label class="col-6">Production capacity</label>
|
||||
<div class="col-6">
|
||||
<div class="input-group">
|
||||
<input class="form-control" name="productionCapacity" type="number" min="0" max="50" value="${config.productionCapacity}"/>
|
||||
<div class="input-group-append"><span class="input-group-text">kWp</span></div>
|
||||
</div>
|
||||
</div>
|
||||
<div id="substitute" class="col-lg-3 col-md-4 col-sm-5">
|
||||
<div class="m-2">
|
||||
<label class="small"><input id="substituteMissing" type="checkbox" name="substituteMissing" value="true" ${config.substituteMissing}/> Substitute missing values</label>
|
||||
</div>
|
||||
</div>
|
||||
</div>
|
||||
@ -102,5 +112,16 @@
|
||||
</div>
|
||||
</form>
|
||||
</main>
|
||||
<script>
|
||||
$('.subtitute-dependent').on('change', function() {
|
||||
console.log("test");
|
||||
if($('#meterType').val() == 2 && $('#distributionSystem').val() == 1) {
|
||||
$('#substitute').show();
|
||||
} else {
|
||||
$('#substitute').hide();
|
||||
}
|
||||
});
|
||||
$('#meterType').trigger('change');
|
||||
</script>
|
||||
</body>
|
||||
</html>
|
||||
|
||||
@ -4,8 +4,8 @@
|
||||
<meta name="viewport" content="width=device-width, initial-scale=1">
|
||||
<title>AMS reader - MQTT configuration</title>
|
||||
<meta http-equiv="X-UA-Compatible" content="IE=edge">
|
||||
<link rel="stylesheet" href="https://stackpath.bootstrapcdn.com/bootstrap/4.4.1/css/bootstrap.min.css" integrity="sha384-Vkoo8x4CGsO3+Hhxv8T/Q5PaXtkKtu6ug5TOeNV6gBiFeWPGFN9MuhOf23Q9Ifjh" crossorigin="anonymous">
|
||||
<script src="https://code.jquery.com/jquery-3.4.1.slim.min.js" integrity="sha384-J6qa4849blE2+poT4WnyKhv5vZF5SrPo0iEjwBvKU7imGFAV0wwj1yYfoRSJoZ+n" crossorigin="anonymous"></script>
|
||||
<link rel="stylesheet" href="https://stackpath.bootstrapcdn.com/bootstrap/4.4.1/css/bootstrap.min.css">
|
||||
<script src="https://code.jquery.com/jquery-3.4.1.slim.min.js"></script>
|
||||
</head>
|
||||
<body class="bg-light">
|
||||
<main role="main" class="container">
|
||||
|
||||
@ -4,7 +4,7 @@
|
||||
<meta name="viewport" content="width=device-width, initial-scale=1">
|
||||
<title>AMS reader - System configuration</title>
|
||||
<meta http-equiv="X-UA-Compatible" content="IE=edge">
|
||||
<link rel="stylesheet" href="https://stackpath.bootstrapcdn.com/bootstrap/4.4.1/css/bootstrap.min.css" integrity="sha384-Vkoo8x4CGsO3+Hhxv8T/Q5PaXtkKtu6ug5TOeNV6gBiFeWPGFN9MuhOf23Q9Ifjh" crossorigin="anonymous">
|
||||
<link rel="stylesheet" href="https://stackpath.bootstrapcdn.com/bootstrap/4.4.1/css/bootstrap.min.css">
|
||||
</head>
|
||||
<body class="bg-light">
|
||||
<main role="main" class="container">
|
||||
|
||||
@ -4,8 +4,8 @@
|
||||
<meta name="viewport" content="width=device-width, initial-scale=1">
|
||||
<title>AMS reader - Web configuration</title>
|
||||
<meta http-equiv="X-UA-Compatible" content="IE=edge">
|
||||
<link rel="stylesheet" href="https://stackpath.bootstrapcdn.com/bootstrap/4.4.1/css/bootstrap.min.css" integrity="sha384-Vkoo8x4CGsO3+Hhxv8T/Q5PaXtkKtu6ug5TOeNV6gBiFeWPGFN9MuhOf23Q9Ifjh" crossorigin="anonymous">
|
||||
<script src="https://code.jquery.com/jquery-3.4.1.slim.min.js" integrity="sha384-J6qa4849blE2+poT4WnyKhv5vZF5SrPo0iEjwBvKU7imGFAV0wwj1yYfoRSJoZ+n" crossorigin="anonymous"></script>
|
||||
<link rel="stylesheet" href="https://stackpath.bootstrapcdn.com/bootstrap/4.4.1/css/bootstrap.min.css">
|
||||
<script src="https://code.jquery.com/jquery-3.4.1.slim.min.js"></script>
|
||||
</head>
|
||||
<body class="bg-light">
|
||||
<main role="main" class="container">
|
||||
@ -42,32 +42,32 @@
|
||||
<input type="hidden" name="authConfig" value="true"/>
|
||||
<div class="my-3 p-3 bg-white rounded shadow">
|
||||
<div class="row">
|
||||
<div class="col-md-4">
|
||||
<div class="row form-group">
|
||||
<label class="col-4">Security</label>
|
||||
<div class="col-8">
|
||||
<select id="authSecurity" class="form-control" name="authSecurity">
|
||||
<option value="0" ${config.authSecurity0}>None</option>
|
||||
<option value="1" ${config.authSecurity1}>Only configuration</option>
|
||||
<option value="2" ${config.authSecurity2}>Everything</option>
|
||||
</select>
|
||||
<div class="col-xl-3 col-lg-4 col-md-7">
|
||||
<div class="m-2 input-group input-group-sm">
|
||||
<div class="input-group-prepend">
|
||||
<span class="input-group-text">Security</span>
|
||||
</div>
|
||||
<select id="authSecurity" class="form-control" name="authSecurity">
|
||||
<option value="0" ${config.authSecurity0}>None</option>
|
||||
<option value="1" ${config.authSecurity1}>Only configuration</option>
|
||||
<option value="2" ${config.authSecurity2}>Everything</option>
|
||||
</select>
|
||||
</div>
|
||||
</div>
|
||||
<div class="col-md-4">
|
||||
<div class="row form-group">
|
||||
<label class="col-4">Username</label>
|
||||
<div class="col-8">
|
||||
<input type="text" class="form-control auth-config" name="authUser" value="${config.authUser}"/>
|
||||
<div class="col-xl-3 col-lg-4 col-md-6">
|
||||
<div class="m-2 input-group input-group-sm">
|
||||
<div class="input-group-prepend">
|
||||
<span class="input-group-text">Username</span>
|
||||
</div>
|
||||
<input type="text" class="form-control auth-config" name="authUser" value="${config.authUser}" maxlength="64"/>
|
||||
</div>
|
||||
</div>
|
||||
<div class="col-md-4">
|
||||
<div class="row form-group">
|
||||
<label class="col-4">Password</label>
|
||||
<div class="col-8">
|
||||
<input type="password" class="form-control auth-config" name="authPassword" value="${config.authPassword}"/>
|
||||
<div class="col-xl-3 col-lg-4 col-md-6">
|
||||
<div class="m-2 input-group input-group-sm">
|
||||
<div class="input-group-prepend">
|
||||
<span class="input-group-text">Password</span>
|
||||
</div>
|
||||
<input type="password" class="form-control auth-config" name="authPassword" value="${config.authPassword}" maxlength="64"/>
|
||||
</div>
|
||||
</div>
|
||||
</div>
|
||||
|
||||
@ -4,8 +4,7 @@
|
||||
<meta name="viewport" content="width=device-width, initial-scale=1">
|
||||
<title>AMS reader - WiFi configuration</title>
|
||||
<meta http-equiv="X-UA-Compatible" content="IE=edge">
|
||||
<link rel="stylesheet" href="https://stackpath.bootstrapcdn.com/bootstrap/4.4.1/css/bootstrap.min.css" integrity="sha384-Vkoo8x4CGsO3+Hhxv8T/Q5PaXtkKtu6ug5TOeNV6gBiFeWPGFN9MuhOf23Q9Ifjh" crossorigin="anonymous">
|
||||
<script src="https://code.jquery.com/jquery-3.4.1.slim.min.js" integrity="sha384-J6qa4849blE2+poT4WnyKhv5vZF5SrPo0iEjwBvKU7imGFAV0wwj1yYfoRSJoZ+n" crossorigin="anonymous"></script>
|
||||
<link rel="stylesheet" href="https://stackpath.bootstrapcdn.com/bootstrap/4.4.1/css/bootstrap.min.css">
|
||||
</head>
|
||||
<body class="bg-light">
|
||||
<main role="main" class="container">
|
||||
@ -42,67 +41,73 @@
|
||||
<input type="hidden" name="wifiConfig" value="true"/>
|
||||
<div class="my-3 p-3 bg-white rounded shadow">
|
||||
<div class="row">
|
||||
<div class="col-md-4">
|
||||
<div class="row form-group">
|
||||
<label class="col-3">SSID</label>
|
||||
<div class="col-9">
|
||||
<input type="text" class="form-control" name="wifiSsid" value="${config.wifiSsid}" maxlength="32" placeholder="Name of your WiFi" required/>
|
||||
</div>
|
||||
</div>
|
||||
<div class="row form-group">
|
||||
<label class="col-3">Password</label>
|
||||
<div class="col-9">
|
||||
<input type="password" class="form-control" name="wifiPassword" value="${config.wifiPassword}" maxlength="63" placeholder="Password for WiFi" required/>
|
||||
</div>
|
||||
</div>
|
||||
<div class="row form-group">
|
||||
<label class="col-3">Hostname</label>
|
||||
<div class="col-9">
|
||||
<input type="text" class="form-control" name="wifiHostname" value="${config.wifiHostname}" maxlength="32" pattern="[a-z0-9_-]+" placeholder="Ex.: ams-reader" required/>
|
||||
<div class="col-xl-3 col-md-6 form-group">
|
||||
<div class="input-group input-group-sm">
|
||||
<div class="input-group-prepend">
|
||||
<span class="input-group-text">SSID</span>
|
||||
</div>
|
||||
<input type="text" name="wifiSsid" class="form-control" maxlength="32" placeholder="Name of your WiFi" value="${config.wifiSsid}" required/>
|
||||
</div>
|
||||
</div>
|
||||
<div class="col-md-4">
|
||||
<div class="row form-group">
|
||||
<label class="col-6">IP configuration</label>
|
||||
<div class="col-6">
|
||||
<select id="wifiIpType" class="form-control" name="wifiIpType">
|
||||
<option value="0" ${config.wifiIpType0}>DHCP</option>
|
||||
<option value="1" ${config.wifiIpType1}>Static</option>
|
||||
</select>
|
||||
</div>
|
||||
</div>
|
||||
<div class="row form-group">
|
||||
<label class="col-6">IP</label>
|
||||
<div class="col-6">
|
||||
<input type="text" class="form-control wifiip-config" name="wifiIp" value="${config.wifiIp}" pattern="\d?\d?\d.\d?\d?\d.\d?\d?\d.\d?\d?\d" placeholder="Ex: 192.168.1.200"/>
|
||||
</div>
|
||||
</div>
|
||||
<div class="row form-group">
|
||||
<label class="col-6">Subnet</label>
|
||||
<div class="col-6">
|
||||
<input type="text" class="form-control wifiip-config" name="wifiSubnet" value="${config.wifiSubnet}" pattern="\d?\d?\d.\d?\d?\d.\d?\d?\d.\d?\d?\d" placeholder="Ex: 255.255.255.0"/>
|
||||
<div class="col-xl-3 col-md-6 form-group">
|
||||
<div class="input-group input-group-sm">
|
||||
<div class="input-group-prepend">
|
||||
<span class="input-group-text">PSK</span>
|
||||
</div>
|
||||
<input type="password" name="wifiPassword" class="form-control" maxlength="63" placeholder="Password for WiFi" value="${config.wifiPassword}" required/>
|
||||
</div>
|
||||
</div>
|
||||
<div class="col-md-4">
|
||||
<div class="row form-group">
|
||||
<label class="col-6">Gateway</label>
|
||||
<div class="col-6">
|
||||
<input type="text" class="form-control wifiip-config" name="wifiGw" value="${config.wifiGw}" pattern="\d?\d?\d.\d?\d?\d.\d?\d?\d.\d?\d?\d" placeholder="Ex: 192.168.1.1"/>
|
||||
<div class="col-xl-4 col-md-6 form-group">
|
||||
<div class="input-group input-group-sm">
|
||||
<div class="input-group-prepend">
|
||||
<span class="input-group-text">Hostname</span>
|
||||
</div>
|
||||
<input type="text" name="wifiHostname" class="form-control" maxlength="32" pattern="[a-z0-9_-]+" placeholder="Optional, ex.: ams-reader" value="${config.wifiHostname}"/>
|
||||
</div>
|
||||
<div class="row form-group">
|
||||
<label class="col-6">Primary DNS</label>
|
||||
<div class="col-6">
|
||||
<input type="text" class="form-control wifiip-config" name="wifiDns1" value="${config.wifiDns1}" pattern="\d?\d?\d.\d?\d?\d.\d?\d?\d.\d?\d?\d" placeholder="Ex: 192.168.1.1"/>
|
||||
</div>
|
||||
<div class="col-xl-2 col-md-6 form-group">
|
||||
<label><input type="checkbox" name="wifiIpType" value="1" onchange="staticChecked(this);" ${config.wifiStaticIp}/> Static IP</label>
|
||||
</div>
|
||||
</div>
|
||||
<div class="row" id="staticIp">
|
||||
<div class="col-xl-3 col-lg-4 form-group">
|
||||
<div class="input-group input-group-sm">
|
||||
<div class="input-group-prepend">
|
||||
<span class="input-group-text">IP</span>
|
||||
</div>
|
||||
<input type="text" name="wifiIp" class="form-control" pattern="\d?\d?\d.\d?\d?\d.\d?\d?\d.\d?\d?\d" placeholder="Ex: 192.168.1.200" value="${config.wifiIp}"/>
|
||||
</div>
|
||||
<div class="row form-group">
|
||||
<label class="col-6">Secondary DNS</label>
|
||||
<div class="col-6">
|
||||
<input type="text" class="form-control wifiip-config" name="wifiDns2" value="${config.wifiDns2}" pattern="\d?\d?\d.\d?\d?\d.\d?\d?\d.\d?\d?\d" placeholder="Ex: 8.8.8.8"/>
|
||||
</div>
|
||||
<div class="col-xl-3 col-lg-4 form-group">
|
||||
<div class="input-group input-group-sm">
|
||||
<div class="input-group-prepend">
|
||||
<span class="input-group-text">Subnet</span>
|
||||
</div>
|
||||
<input type="text" name="wifiSubnet" class="form-control" pattern="\d?\d?\d.\d?\d?\d.\d?\d?\d.\d?\d?\d" placeholder="Ex.: 255.255.255.0" value="${config.wifiSubnet}"/>
|
||||
</div>
|
||||
</div>
|
||||
<div class="col-xl-3 col-lg-4 form-group">
|
||||
<div class="input-group input-group-sm">
|
||||
<div class="input-group-prepend">
|
||||
<span class="input-group-text">Gateway</span>
|
||||
</div>
|
||||
<input type="text" name="wifiGw" class="form-control" pattern="\d?\d?\d.\d?\d?\d.\d?\d?\d.\d?\d?\d" placeholder="Ex.: 192.168.1.1" value="${config.wifiGw}"/>
|
||||
</div>
|
||||
</div>
|
||||
<div class="col-xl-4 col-lg-5 form-group">
|
||||
<div class="input-group input-group-sm">
|
||||
<div class="input-group-prepend">
|
||||
<span class="input-group-text">Primary DNS</span>
|
||||
</div>
|
||||
<input type="text" name="wifiDns1" class="form-control" pattern="\d?\d?\d.\d?\d?\d.\d?\d?\d.\d?\d?\d" placeholder="Ex.: 192.168.1.1" value="${config.wifiDns1}"/>
|
||||
</div>
|
||||
</div>
|
||||
<div class="col-xl-4 col-lg-5 form-group">
|
||||
<div class="input-group input-group-sm">
|
||||
<div class="input-group-prepend">
|
||||
<span class="input-group-text">Secondary DNS</span>
|
||||
</div>
|
||||
<input type="text" name="wifiDns2" class="form-control" pattern="\d?\d?\d.\d?\d?\d.\d?\d?\d.\d?\d?\d" placeholder="Ex.: 8.8.8.8" value="${config.wifiDns2}"/>
|
||||
</div>
|
||||
</div>
|
||||
</div>
|
||||
@ -119,14 +124,10 @@
|
||||
</form>
|
||||
</main>
|
||||
<script>
|
||||
$('#wifiIpType').on('change', function() {
|
||||
var inputs = $('.wifiip-config');
|
||||
inputs.prop('disabled', $(this).val() != 1);
|
||||
});
|
||||
|
||||
$(function() {
|
||||
$('#wifiIpType').trigger('change');
|
||||
});
|
||||
document.getElementById('staticIp').style.display = "none";
|
||||
var staticChecked = function(el) {
|
||||
document.getElementById('staticIp').style.display = el.checked ? "" : "none";
|
||||
}
|
||||
</script>
|
||||
</body>
|
||||
</html>
|
||||
|
||||
@ -4,7 +4,7 @@
|
||||
<meta name="viewport" content="width=device-width, initial-scale=1">
|
||||
<title>AMS reader - Delete</title>
|
||||
<meta http-equiv="X-UA-Compatible" content="IE=edge">
|
||||
<link rel="stylesheet" href="https://stackpath.bootstrapcdn.com/bootstrap/4.4.1/css/bootstrap.min.css" integrity="sha384-Vkoo8x4CGsO3+Hhxv8T/Q5PaXtkKtu6ug5TOeNV6gBiFeWPGFN9MuhOf23Q9Ifjh" crossorigin="anonymous">
|
||||
<link rel="stylesheet" href="https://stackpath.bootstrapcdn.com/bootstrap/4.4.1/css/bootstrap.min.css">
|
||||
</head>
|
||||
<body class="bg-light">
|
||||
<main role="main" class="container">
|
||||
|
||||
@ -4,7 +4,7 @@
|
||||
<meta name="viewport" content="width=device-width, initial-scale=1">
|
||||
<title>AMS reader</title>
|
||||
<meta http-equiv="X-UA-Compatible" content="IE=edge">
|
||||
<link rel="stylesheet" href="https://stackpath.bootstrapcdn.com/bootstrap/4.4.1/css/bootstrap.min.css" integrity="sha384-Vkoo8x4CGsO3+Hhxv8T/Q5PaXtkKtu6ug5TOeNV6gBiFeWPGFN9MuhOf23Q9Ifjh" crossorigin="anonymous">
|
||||
<link rel="stylesheet" href="https://stackpath.bootstrapcdn.com/bootstrap/4.4.1/css/bootstrap.min.css">
|
||||
<script src="https://code.jquery.com/jquery-3.4.1.min.js"></script>
|
||||
<script src="https://cdnjs.cloudflare.com/ajax/libs/moment.js/2.24.0/moment.min.js"></script>
|
||||
<script src="gaugemeter.js"></script>
|
||||
|
||||
@ -4,10 +4,10 @@
|
||||
<meta name="viewport" content="width=device-width, initial-scale=1">
|
||||
<title>AMS reader - Upload</title>
|
||||
<meta http-equiv="X-UA-Compatible" content="IE=edge">
|
||||
<link rel="stylesheet" href="https://stackpath.bootstrapcdn.com/bootstrap/4.4.1/css/bootstrap.min.css" integrity="sha384-Vkoo8x4CGsO3+Hhxv8T/Q5PaXtkKtu6ug5TOeNV6gBiFeWPGFN9MuhOf23Q9Ifjh" crossorigin="anonymous">
|
||||
<script src="https://code.jquery.com/jquery-3.4.1.slim.min.js" integrity="sha384-J6qa4849blE2+poT4WnyKhv5vZF5SrPo0iEjwBvKU7imGFAV0wwj1yYfoRSJoZ+n" crossorigin="anonymous"></script>
|
||||
<script src="https://cdn.jsdelivr.net/npm/popper.js@1.16.0/dist/umd/popper.min.js" integrity="sha384-Q6E9RHvbIyZFJoft+2mJbHaEWldlvI9IOYy5n3zV9zzTtmI3UksdQRVvoxMfooAo" crossorigin="anonymous"></script>
|
||||
<script src="https://stackpath.bootstrapcdn.com/bootstrap/4.4.1/js/bootstrap.min.js" integrity="sha384-wfSDF2E50Y2D1uUdj0O3uMBJnjuUD4Ih7YwaYd1iqfktj0Uod8GCExl3Og8ifwB6" crossorigin="anonymous"></script>
|
||||
<link rel="stylesheet" href="https://stackpath.bootstrapcdn.com/bootstrap/4.4.1/css/bootstrap.min.css">
|
||||
<script src="https://code.jquery.com/jquery-3.4.1.slim.min.js"></script>
|
||||
<script src="https://cdn.jsdelivr.net/npm/popper.js@1.16.0/dist/umd/popper.min.js"></script>
|
||||
<script src="https://stackpath.bootstrapcdn.com/bootstrap/4.4.1/js/bootstrap.min.js"></script>
|
||||
</head>
|
||||
<body class="bg-light">
|
||||
<main role="main" class="container">
|
||||
|
||||
Loading…
x
Reference in New Issue
Block a user