Compare commits

...

3 Commits

Author SHA1 Message Date
Gunnar Skjold
254e010594 Fixed save crash 2021-11-16 20:40:21 +01:00
Gunnar Skjold
4c92e592d6 Added support for uart_swap for ESP8266 2021-11-08 12:05:48 +01:00
Gunnar Skjold
72bdb6e363 Update issue templates 2021-11-01 07:14:54 +01:00
5 changed files with 115 additions and 18 deletions

38
.github/ISSUE_TEMPLATE/bug_report.md vendored Normal file
View 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.

View 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
View 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]

View File

@@ -68,6 +68,7 @@ AmsMqttHandler* mqttHandler = NULL;
HanReader hanReader;
Stream *hanSerial;
SoftwareSerial *swSerial = NULL;
GpioConfig gpioConfig;
MeterConfig meterConfig;
@@ -140,21 +141,11 @@ void setup() {
bool shared = false;
config.getMeterConfig(meterConfig);
Serial.flush();
Serial.end();
if(gpioConfig.hanPin == 3) {
shared = true;
switch(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);
setupHanPort(gpioConfig.hanPin, meterConfig.type);
}
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);
HardwareSerial *hwSerial = NULL;
if(pin == 3) {
if(pin == 3 || pin == 113) {
hwSerial = &Serial;
}
#if defined(ESP32)
if(pin == 9) {
hwSerial = &Serial1;
@@ -478,7 +471,9 @@ void setupHanPort(int pin, int newMeterType) {
if(hwSerial != NULL) {
debugD("Hardware serial");
Serial.flush();
hwSerial->flush();
hwSerial->end();
switch(newMeterType) {
case METER_TYPE_KAMSTRUP:
case METER_TYPE_OMNIPOWER:
@@ -488,11 +483,27 @@ void setupHanPort(int pin, int newMeterType) {
hwSerial->begin(2400, SERIAL_8E1);
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;
} else {
debugD("Software serial");
Serial.flush();
SoftwareSerial *swSerial = new SoftwareSerial(pin);
if(swSerial != NULL) {
swSerial->end();
delete swSerial;
}
swSerial = new SoftwareSerial(pin);
switch(newMeterType) {
case METER_TYPE_KAMSTRUP:
@@ -505,6 +516,7 @@ void setupHanPort(int pin, int newMeterType) {
}
hanSerial = swSerial;
Serial.end();
Serial.begin(115200);
}

View File

@@ -191,7 +191,7 @@ void AmsWebServer::temperaturePost() {
delay(1);
}
if (debugger->isActive(RemoteDebug::DEBUG)) config->print(debugger);
//if (debugger->isActive(RemoteDebug::DEBUG)) config->print(debugger);
if(config->save()) {
printD("Successfully saved temperature sensors");
server.sendHeader("Location", String("/temperature"), true);
@@ -1068,7 +1068,7 @@ void AmsWebServer::handleSave() {
printI("Saving configuration now...");
if (debugger->isActive(RemoteDebug::DEBUG)) config->print(debugger);
//if (debugger->isActive(RemoteDebug::DEBUG)) config->print(debugger);
if (config->save()) {
printI("Successfully saved.");
if(config->isWifiChanged()) {
@@ -1211,6 +1211,11 @@ String AmsWebServer::getSerialSelectOptions(int selected) {
#elif defined(ESP8266)
int numGpio = 9;
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
for(int i = 0; i < numGpio; i++) {