Skip to content

Commit 95d171b

Browse files
authored
fix(serial): allow serial configuration from configuration file (#88)
1 parent 1a6dfcf commit 95d171b

File tree

7 files changed

+44
-18
lines changed

7 files changed

+44
-18
lines changed

AquaMQTT/include/config/Configuration.h

Lines changed: 12 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -59,6 +59,18 @@ constexpr bool OVERRIDE_TIME_AND_DATE_IN_MITM = true;
5959
*/
6060
constexpr bool DEBUG_RAW_SERIAL_MESSAGES = false;
6161

62+
/**
63+
* Default serial configuration uses two stop bits SERIAL_8N2, but there are heatpumps
64+
* such as the Thermor Aeromax 5 (E/H) #80 which require SERIAL_8N1 here. Else messages
65+
* are most of the time not complete, causing missing attributes in MQTT.
66+
*/
67+
constexpr auto DEFAULT_SERIAL_CONFIGURATION = SERIAL_8N2;
68+
69+
/**
70+
* Default serial configuration uses baud rate of 9550 / determined using logic analyzer
71+
*/
72+
constexpr unsigned long DEFAULT_SERIAL_BAUD = 9550;
73+
6274
/**
6375
* Choose to collect the message sequence and frequencies in LISTENER mode.
6476
* Will provide timings to /stats/timing on topics such as "67-217": 100ms

AquaMQTT/src/task/ControllerTask.cpp

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -41,7 +41,7 @@ void ControllerTask::spawn()
4141

4242
void ControllerTask::setup() // NOLINT(*-convert-member-functions-to-static)
4343
{
44-
Serial2.begin(9550, SERIAL_8N2, config::GPIO_MAIN_RX, config::GPIO_MAIN_TX);
44+
Serial2.begin(config::DEFAULT_SERIAL_BAUD, config::DEFAULT_SERIAL_CONFIGURATION, config::GPIO_MAIN_RX, config::GPIO_MAIN_TX);
4545
pinMode(config::GPIO_ENABLE_TX_MAIN, OUTPUT);
4646
}
4747

AquaMQTT/src/task/HMITask.cpp

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -46,7 +46,7 @@ void HMITask::spawn()
4646

4747
void HMITask::setup() // NOLINT(*-convert-member-functions-to-static)
4848
{
49-
Serial1.begin(9550, SERIAL_8N2, config::GPIO_HMI_RX, config::GPIO_HMI_TX);
49+
Serial1.begin(config::DEFAULT_SERIAL_BAUD, config::DEFAULT_SERIAL_CONFIGURATION, config::GPIO_HMI_RX, config::GPIO_HMI_TX);
5050
pinMode(config::GPIO_ENABLE_TX_HMI, OUTPUT);
5151
}
5252

AquaMQTT/src/task/ListenerTask.cpp

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -33,7 +33,7 @@ void ListenerTask::spawn()
3333
void ListenerTask::setup() // NOLINT(*-convert-member-functions-to-static)
3434
{
3535
// if passthrough jumper is set, it doesn't make a difference if we read from Serial1 or Serial2
36-
Serial2.begin(9550, SERIAL_8N2, config::GPIO_MAIN_RX, config::GPIO_MAIN_TX);
36+
Serial2.begin(config::DEFAULT_SERIAL_BAUD, config::DEFAULT_SERIAL_CONFIGURATION, config::GPIO_MAIN_RX, config::GPIO_MAIN_TX);
3737
}
3838

3939
void ListenerTask::loop()

DEVICES.md

Lines changed: 16 additions & 14 deletions
Original file line numberDiff line numberDiff line change
@@ -4,20 +4,22 @@
44

55
These devices have been tested succesfully by the community. Currently there are no insights if the software version indicitates compatibilty to the AquaMQTT implementation.
66

7-
| Name | HMI Software Version | Controller Software Version | Observed Protocol / Checksum | Other Information | Installation Date |
8-
|----------------------------------------------------------------------------------------------------|----------------------|-----------------------------|--------------------------------------|-------------------------------------|-------------------|
9-
| [Atlantic Calypso Split Inverter 270l (BmdOnline)](https://github.com/tspopp/AquaMQTT/issues/64) | F | G | [LEGACY](PROTOCOL.md) / XOR | [Rev 1.0 PCB: Adapter is recommended](./pcb) | |
10-
| [Atlantic Calypso VR (Arrnooo, Quentin90000, sebcaps)](https://github.com/tspopp/AquaMQTT/issues/67) | E | F | [LEGACY](PROTOCOL.md) | [Rev 2.0 PCB required](./pcb) | |
11-
| [Atlantic Explorer 270/V3 (Silmo)](https://github.com/tspopp/AquaMQTT/pull/52) | E | E | [NEXT](PROTOCOL_NEXT.md) / XOR | | |
12-
| [Atlantic Explorer (ALENOC)](https://github.com/tspopp/AquaMQTT/issues/14#issuecomment-2501636900) | E | E | [NEXT](PROTOCOL_NEXT.md) / XOR | | |
13-
| [Atlantic Odyssee Pi (FSlunkk)](https://github.com/tspopp/AquaMQTT/issues/68) | B | B | [ODYSSEE](PROTOCOL_ODYSSEE.md) / XOR | | 2015 |
14-
| [Atlantic Explorer V4](https://github.com/tspopp/AquaMQTT/issues/14) | B | B | [LEGACY](PROTOCOL.md) / CRC16 | | |
15-
| [Austria Email Explorer Evo 2](https://github.com/tspopp/AquaMQTT/issues/22) | ? | ? | [LEGACY](PROTOCOL.md) / CRC16 | | |
16-
| Austria Email Explorer Evo 2 260L + HX (Dominik) | B | B | [LEGACY](PROTOCOL.md) | | 2023 |
17-
| [Austria Email BWWP 200 WT SMART COZY (taloriko)](https://github.com/tspopp/AquaMQTT/issues/45) | E | E | [NEXT](PROTOCOL_NEXT.md) / XOR | | |
18-
| [Thermor Aeromax 5](https://github.com/tspopp/AquaMQTT/issues/18) | ? | ? | [LEGACY](PROTOCOL.md) / CRC16 | [Rev 1.0 PCB: Adapter is recommended](./pcb) | |
19-
| [Thermor Aeromax 5](https://github.com/tspopp/AquaMQTT/issues/51) | E | G | [LEGACY](PROTOCOL.md) / CRC16 | [Rev 1.0 PCB: Adapter is recommended](./pcb) | |
20-
| Windhager Aquawin Air 3 | B | B | [LEGACY](PROTOCOL.md) / CRC16 | | 2021 |
7+
| Name | HMI Software Version | Controller Software Version | Observed Protocol / Checksum | Other Information | Installation Date |
8+
|------------------------------------------------------------------------------------------------------|----------------------|-----------------------------|--------------------------------------|----------------------------------------------------------------------------------------------------------------------------------------|-------------------|
9+
| [Atlantic Calypso Split Inverter 270l (BmdOnline)](https://github.com/tspopp/AquaMQTT/issues/64) | F | G | [LEGACY](PROTOCOL.md) / XOR | [Rev 1.0 PCB: Adapter is recommended](./pcb) | |
10+
| [Atlantic Calypso VR (Arrnooo, Quentin90000, sebcaps)](https://github.com/tspopp/AquaMQTT/issues/67) | E | F | [LEGACY](PROTOCOL.md) | [Rev 2.0 PCB required](./pcb) | |
11+
| [Atlantic Explorer 270/V3 (Silmo)](https://github.com/tspopp/AquaMQTT/pull/52) | E | E | [NEXT](PROTOCOL_NEXT.md) / XOR | | |
12+
| [Atlantic Explorer (ALENOC)](https://github.com/tspopp/AquaMQTT/issues/14#issuecomment-2501636900) | E | E | [NEXT](PROTOCOL_NEXT.md) / XOR | | |
13+
| [Atlantic Odyssee Pi (FSlunkk)](https://github.com/tspopp/AquaMQTT/issues/68) | B | B | [ODYSSEE](PROTOCOL_ODYSSEE.md) / XOR | | 2015 |
14+
| [Atlantic Explorer V4](https://github.com/tspopp/AquaMQTT/issues/14) | B | B | [LEGACY](PROTOCOL.md) / CRC16 | | |
15+
| [Austria Email Explorer Evo 2](https://github.com/tspopp/AquaMQTT/issues/22) | ? | ? | [LEGACY](PROTOCOL.md) / CRC16 | | |
16+
| Austria Email Explorer Evo 2 260L + HX (Dominik) | B | B | [LEGACY](PROTOCOL.md) | | 2023 |
17+
| [Austria Email BWWP 200 WT SMART COZY (taloriko)](https://github.com/tspopp/AquaMQTT/issues/45) | E | E | [NEXT](PROTOCOL_NEXT.md) / XOR | | |
18+
| [Thermor Aeromax 5](https://github.com/tspopp/AquaMQTT/issues/18) | ? | ? | [LEGACY](PROTOCOL.md) / CRC16 | [Rev 1.0 PCB: Adapter is recommended](./pcb) | |
19+
| [Thermor Aeromax 5](https://github.com/tspopp/AquaMQTT/issues/51) | E | G | [LEGACY](PROTOCOL.md) / CRC16 | [Rev 1.0 PCB: Adapter is recommended](./pcb) | |
20+
| [Thermor Aeromax 5](https://github.com/tspopp/AquaMQTT/issues/80) | E | H | [LEGACY](PROTOCOL.md) / CRC16 | [Rev 1.0 PCB: Adapter is recommended](./pcb) <br><br> Requires `DEFAULT_SERIAL_CONFIGURATION` set to `Serial_8N1` in `Configuration.h` | 2024 |
21+
| Windhager Aquawin Air 2 AWA272 (Gwabo) | E | E | [NEXT](PROTOCOL_NEXT.md) | | 2022? |
22+
| Windhager Aquawin Air 3 AWA273 | B | B | [LEGACY](PROTOCOL.md) / CRC16 | | 2021 |
2123

2224

2325
## Potential compatible devices

tools/AquaDebug/include/config/Configuration.h

Lines changed: 12 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -29,6 +29,18 @@ constexpr uint16_t WIFI_RECONNECT_CYCLE_S = 10;
2929
constexpr uint8_t MQTT_MAX_TOPIC_SIZE = 80;
3030
constexpr uint8_t MQTT_MAX_PAYLOAD_SIZE = 255;
3131

32+
/**
33+
* Default serial configuration uses two stop bits SERIAL_8N2, but there are heatpumps
34+
* such as the Thermor Aeromax 5 (E/H) #80 which require SERIAL_8N1 here. Else messages
35+
* are most of the time not complete.
36+
*/
37+
constexpr auto DEFAULT_SERIAL_CONFIGURATION = SERIAL_8N2;
38+
39+
/**
40+
* Default serial configuration uses baud rate of 9550 / determined using logic analyzer
41+
*/
42+
constexpr unsigned long DEFAULT_SERIAL_BAUD = 9550;
43+
3244
/**
3345
* Pin assignments for AquaMQTT Board Rev 1.0
3446
* There are different GPIO ports depending on the hardware.

tools/AquaDebug/src/main.cpp

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -110,5 +110,5 @@ void setup()
110110
mMQTTClient.begin(aquamqtt::config::brokerAddr, aquamqtt::config::brokerPort, mWiFiClient);
111111

112112
// setup serial port
113-
Serial2.begin(9550, SERIAL_8N2, aquamqtt::config::GPIO_MAIN_RX, aquamqtt::config::GPIO_MAIN_TX);
113+
Serial2.begin(aquamqtt::config::DEFAULT_SERIAL_BAUD, aquamqtt::config::DEFAULT_SERIAL_CONFIGURATION, aquamqtt::config::GPIO_MAIN_RX, aquamqtt::config::GPIO_MAIN_TX);
114114
}

0 commit comments

Comments
 (0)