mirror of
https://github.com/UtilitechAS/amsreader-firmware.git
synced 2026-03-26 18:33:12 +00:00
Compare commits
3 Commits
| Author | SHA1 | Date | |
|---|---|---|---|
|
|
254e010594 | ||
|
|
4c92e592d6 | ||
|
|
72bdb6e363 |
38
.github/ISSUE_TEMPLATE/bug_report.md
vendored
Normal file
38
.github/ISSUE_TEMPLATE/bug_report.md
vendored
Normal file
@@ -0,0 +1,38 @@
|
|||||||
|
---
|
||||||
|
name: Bug report
|
||||||
|
about: Report a bug
|
||||||
|
title: ''
|
||||||
|
labels: ''
|
||||||
|
assignees: ''
|
||||||
|
|
||||||
|
---
|
||||||
|
|
||||||
|
**Describe the bug**
|
||||||
|
A clear and concise description of what the bug is.
|
||||||
|
|
||||||
|
**To Reproduce**
|
||||||
|
Steps to reproduce the behavior:
|
||||||
|
1. Go to '...'
|
||||||
|
2. Click on '....'
|
||||||
|
3. Scroll down to '....'
|
||||||
|
4. See error
|
||||||
|
|
||||||
|
**Expected behavior**
|
||||||
|
A clear and concise description of what you expected to happen.
|
||||||
|
|
||||||
|
**Screenshots**
|
||||||
|
If applicable, add screenshots to help explain your problem.
|
||||||
|
|
||||||
|
**Hardware information:**
|
||||||
|
- Meter: [e.g. Aidon]
|
||||||
|
- AMS reader: [e.g. Pow-U, ESP32 etc]
|
||||||
|
- M-bus adapter (if applicable):
|
||||||
|
|
||||||
|
**Relevant firmware information:**
|
||||||
|
- Version: [e.g. 1.5.0]
|
||||||
|
- MQTT: [yes/no]
|
||||||
|
- HAN GPIO: [e.g. GPIO5]
|
||||||
|
- Temperature sensors [e.g. 3xDS18B20]
|
||||||
|
|
||||||
|
**Additional context**
|
||||||
|
Add any other context about the problem here.
|
||||||
20
.github/ISSUE_TEMPLATE/feature_request.md
vendored
Normal file
20
.github/ISSUE_TEMPLATE/feature_request.md
vendored
Normal file
@@ -0,0 +1,20 @@
|
|||||||
|
---
|
||||||
|
name: Feature request
|
||||||
|
about: Suggest an idea for this project
|
||||||
|
title: ''
|
||||||
|
labels: ''
|
||||||
|
assignees: ''
|
||||||
|
|
||||||
|
---
|
||||||
|
|
||||||
|
**Is your feature request related to a problem? Please describe.**
|
||||||
|
A clear and concise description of what the problem is. Ex. I'm always frustrated when [...]
|
||||||
|
|
||||||
|
**Describe the solution you'd like**
|
||||||
|
A clear and concise description of what you want to happen.
|
||||||
|
|
||||||
|
**Describe alternatives you've considered**
|
||||||
|
A clear and concise description of any alternative solutions or features you've considered.
|
||||||
|
|
||||||
|
**Additional context**
|
||||||
|
Add any other context or screenshots about the feature request here.
|
||||||
22
.github/ISSUE_TEMPLATE/support.md
vendored
Normal file
22
.github/ISSUE_TEMPLATE/support.md
vendored
Normal file
@@ -0,0 +1,22 @@
|
|||||||
|
---
|
||||||
|
name: Support
|
||||||
|
about: Request support
|
||||||
|
title: ''
|
||||||
|
labels: ''
|
||||||
|
assignees: ''
|
||||||
|
|
||||||
|
---
|
||||||
|
|
||||||
|
**Describe your problem**
|
||||||
|
A clear and concise description of what the problem is.
|
||||||
|
|
||||||
|
**Hardware information:**
|
||||||
|
- Meter: [e.g. Aidon]
|
||||||
|
- AMS reader: [e.g. Pow-U, ESP32 etc]
|
||||||
|
- M-bus adapter (if applicable):
|
||||||
|
|
||||||
|
**Relevant firmware information:**
|
||||||
|
- Version: [e.g. 1.5.0]
|
||||||
|
- MQTT: [yes/no]
|
||||||
|
- HAN GPIO: [e.g. GPIO5]
|
||||||
|
- Temperature sensors [e.g. 3xDS18B20]
|
||||||
@@ -68,6 +68,7 @@ AmsMqttHandler* mqttHandler = NULL;
|
|||||||
HanReader hanReader;
|
HanReader hanReader;
|
||||||
|
|
||||||
Stream *hanSerial;
|
Stream *hanSerial;
|
||||||
|
SoftwareSerial *swSerial = NULL;
|
||||||
|
|
||||||
GpioConfig gpioConfig;
|
GpioConfig gpioConfig;
|
||||||
MeterConfig meterConfig;
|
MeterConfig meterConfig;
|
||||||
@@ -140,21 +141,11 @@ void setup() {
|
|||||||
|
|
||||||
bool shared = false;
|
bool shared = false;
|
||||||
config.getMeterConfig(meterConfig);
|
config.getMeterConfig(meterConfig);
|
||||||
|
Serial.flush();
|
||||||
|
Serial.end();
|
||||||
if(gpioConfig.hanPin == 3) {
|
if(gpioConfig.hanPin == 3) {
|
||||||
shared = true;
|
shared = true;
|
||||||
switch(meterConfig.type) {
|
setupHanPort(gpioConfig.hanPin, meterConfig.type);
|
||||||
case METER_TYPE_KAMSTRUP:
|
|
||||||
case METER_TYPE_OMNIPOWER:
|
|
||||||
Serial.begin(2400, SERIAL_8N1);
|
|
||||||
break;
|
|
||||||
default:
|
|
||||||
Serial.begin(2400, SERIAL_8E1);
|
|
||||||
break;
|
|
||||||
}
|
|
||||||
}
|
|
||||||
|
|
||||||
if(!shared) {
|
|
||||||
Serial.begin(115200);
|
|
||||||
}
|
}
|
||||||
|
|
||||||
DebugConfig debug;
|
DebugConfig debug;
|
||||||
@@ -459,9 +450,11 @@ void setupHanPort(int pin, int newMeterType) {
|
|||||||
debugI("Setting up HAN on pin %d for meter type %d", pin, newMeterType);
|
debugI("Setting up HAN on pin %d for meter type %d", pin, newMeterType);
|
||||||
|
|
||||||
HardwareSerial *hwSerial = NULL;
|
HardwareSerial *hwSerial = NULL;
|
||||||
if(pin == 3) {
|
if(pin == 3 || pin == 113) {
|
||||||
hwSerial = &Serial;
|
hwSerial = &Serial;
|
||||||
}
|
}
|
||||||
|
|
||||||
|
|
||||||
#if defined(ESP32)
|
#if defined(ESP32)
|
||||||
if(pin == 9) {
|
if(pin == 9) {
|
||||||
hwSerial = &Serial1;
|
hwSerial = &Serial1;
|
||||||
@@ -478,7 +471,9 @@ void setupHanPort(int pin, int newMeterType) {
|
|||||||
|
|
||||||
if(hwSerial != NULL) {
|
if(hwSerial != NULL) {
|
||||||
debugD("Hardware serial");
|
debugD("Hardware serial");
|
||||||
Serial.flush();
|
hwSerial->flush();
|
||||||
|
hwSerial->end();
|
||||||
|
|
||||||
switch(newMeterType) {
|
switch(newMeterType) {
|
||||||
case METER_TYPE_KAMSTRUP:
|
case METER_TYPE_KAMSTRUP:
|
||||||
case METER_TYPE_OMNIPOWER:
|
case METER_TYPE_OMNIPOWER:
|
||||||
@@ -488,11 +483,27 @@ void setupHanPort(int pin, int newMeterType) {
|
|||||||
hwSerial->begin(2400, SERIAL_8E1);
|
hwSerial->begin(2400, SERIAL_8E1);
|
||||||
break;
|
break;
|
||||||
}
|
}
|
||||||
|
|
||||||
|
#if defined(ESP8266)
|
||||||
|
if(pin == 3) {
|
||||||
|
debugI("Switching UART0 to pin 1 & 3");
|
||||||
|
Serial.pins(1,3);
|
||||||
|
} else if(pin == 113) {
|
||||||
|
debugI("Switching UART0 to pin 15 & 13");
|
||||||
|
Serial.pins(15,13);
|
||||||
|
}
|
||||||
|
#endif
|
||||||
|
|
||||||
hanSerial = hwSerial;
|
hanSerial = hwSerial;
|
||||||
} else {
|
} else {
|
||||||
debugD("Software serial");
|
debugD("Software serial");
|
||||||
Serial.flush();
|
Serial.flush();
|
||||||
SoftwareSerial *swSerial = new SoftwareSerial(pin);
|
|
||||||
|
if(swSerial != NULL) {
|
||||||
|
swSerial->end();
|
||||||
|
delete swSerial;
|
||||||
|
}
|
||||||
|
swSerial = new SoftwareSerial(pin);
|
||||||
|
|
||||||
switch(newMeterType) {
|
switch(newMeterType) {
|
||||||
case METER_TYPE_KAMSTRUP:
|
case METER_TYPE_KAMSTRUP:
|
||||||
@@ -505,6 +516,7 @@ void setupHanPort(int pin, int newMeterType) {
|
|||||||
}
|
}
|
||||||
hanSerial = swSerial;
|
hanSerial = swSerial;
|
||||||
|
|
||||||
|
Serial.end();
|
||||||
Serial.begin(115200);
|
Serial.begin(115200);
|
||||||
}
|
}
|
||||||
|
|
||||||
|
|||||||
@@ -191,7 +191,7 @@ void AmsWebServer::temperaturePost() {
|
|||||||
delay(1);
|
delay(1);
|
||||||
}
|
}
|
||||||
|
|
||||||
if (debugger->isActive(RemoteDebug::DEBUG)) config->print(debugger);
|
//if (debugger->isActive(RemoteDebug::DEBUG)) config->print(debugger);
|
||||||
if(config->save()) {
|
if(config->save()) {
|
||||||
printD("Successfully saved temperature sensors");
|
printD("Successfully saved temperature sensors");
|
||||||
server.sendHeader("Location", String("/temperature"), true);
|
server.sendHeader("Location", String("/temperature"), true);
|
||||||
@@ -1068,7 +1068,7 @@ void AmsWebServer::handleSave() {
|
|||||||
|
|
||||||
printI("Saving configuration now...");
|
printI("Saving configuration now...");
|
||||||
|
|
||||||
if (debugger->isActive(RemoteDebug::DEBUG)) config->print(debugger);
|
//if (debugger->isActive(RemoteDebug::DEBUG)) config->print(debugger);
|
||||||
if (config->save()) {
|
if (config->save()) {
|
||||||
printI("Successfully saved.");
|
printI("Successfully saved.");
|
||||||
if(config->isWifiChanged()) {
|
if(config->isWifiChanged()) {
|
||||||
@@ -1211,6 +1211,11 @@ String AmsWebServer::getSerialSelectOptions(int selected) {
|
|||||||
#elif defined(ESP8266)
|
#elif defined(ESP8266)
|
||||||
int numGpio = 9;
|
int numGpio = 9;
|
||||||
int gpios[] = {4,5,9,10,12,13,14,15,16};
|
int gpios[] = {4,5,9,10,12,13,14,15,16};
|
||||||
|
if(selected == 113) {
|
||||||
|
gpioOptions += "<option value=\"113\" selected>UART2 (GPIO13)</option>";
|
||||||
|
} else {
|
||||||
|
gpioOptions += "<option value=\"113\">UART2 (GPIO13)</option>";
|
||||||
|
}
|
||||||
#endif
|
#endif
|
||||||
|
|
||||||
for(int i = 0; i < numGpio; i++) {
|
for(int i = 0; i < numGpio; i++) {
|
||||||
|
|||||||
Reference in New Issue
Block a user