Commit 31356f111e2a2e6f2aafcd33b1a48c67ca26fb50

Authored by Jeroen88
1 parent 6f1fbc5c

Rename Test Boiler Communication

examples/Test_Boiler_Communication/Test_Boiler_Communication.ino
@@ -46,29 +46,29 @@ void setup() { @@ -46,29 +46,29 @@ void setup() {
46 46
47 void loop() { 47 void loop() {
48 // put your main code here, to run repeatedly: 48 // put your main code here, to run repeatedly:
49 - static OpenTherm master(OT_RX_PIN, OT_TX_PIN); // Create an OpenTherm master (is thermostat; boiler is slave) with GPIO34 to receive data from boiler and GPIO17 to send data to boiler 49 + static OpenTherm thermostat(OT_RX_PIN, OT_TX_PIN); // Create an OpenTherm thermostat (is primary device; boiler is secondary device ) with OT_RX_PIN to receive data from boiler and GPIO17 to send data to boiler
50 50
51 - // First try to connect to the boiler to read it's capabilities. The boiler returns an 8 bit slaveFlags and each bit has a meaning. The bits are defined in enum class OpenTherm::CONFIGURATION_FLAGS  
52 - // The slaveMemberIDCode identifies the manufacturer of the boiler  
53 - uint8_t slaveFlags;  
54 - uint8_t slaveMemberIDCode;  
55 - if(master.read(OpenTherm::READ_DATA_ID::SLAVE_CONFIGURATION, slaveFlags, slaveMemberIDCode)) { // Mandatory support 51 + // First try to connect to the boiler to read it's capabilities. The boiler returns an 8 bit secondaryFlags and each bit has a meaning. The bits are defined in enum class OpenTherm::CONFIGURATION_FLAGS
  52 + // The secondaryMemberIDCode identifies the manufacturer of the boiler
  53 + uint8_t secondaryFlags;
  54 + uint8_t secondaryMemberIDCode;
  55 + if(thermostat.read(OpenTherm::READ_DATA_ID::SECONDARY_CONFIGURATION, secondaryFlags, secondaryMemberIDCode)) { // Mandatory support
56 Serial.println("Your setup is working! A frame was send to the boiler and the boiler responded with a valid frame."); 56 Serial.println("Your setup is working! A frame was send to the boiler and the boiler responded with a valid frame.");
57 - Serial.printf("Slave configuration flags is 0x%02x, slave member ID is %d (0x%02x).\n", slaveFlags, slaveMemberIDCode, slaveMemberIDCode); 57 + Serial.printf("Secondary configuration flags is 0x%02x, boiler manufacturer's ID is %d (0x%02x).\n", secondaryFlags, secondaryMemberIDCode, secondaryMemberIDCode);
58 Serial.println("Here is the meanining of each bit in these flags:"); 58 Serial.println("Here is the meanining of each bit in these flags:");
59 - if(slaveFlags & uint8_t(OpenTherm::CONFIGURATION_FLAGS::SLAVE_DHW_PRESENT)) Serial.println("DHW present"); else Serial.println("DHW not present");  
60 - if(slaveFlags & uint8_t(OpenTherm::CONFIGURATION_FLAGS::SLAVE_CONTROL_TYPE)) Serial.println("Control type on/off"); else Serial.println("Control type modulating");  
61 - if(slaveFlags & uint8_t(OpenTherm::CONFIGURATION_FLAGS::SLAVE_COOLING)) Serial.println("Cooling supprted"); else Serial.println("Cooling not supported");  
62 - if(slaveFlags & uint8_t(OpenTherm::CONFIGURATION_FLAGS::SLAVE_DHW)) Serial.println("DHW storage tank"); else Serial.println("DHW instantaneous or not-specified");  
63 - if(slaveFlags & uint8_t(OpenTherm::CONFIGURATION_FLAGS::SLAVE_LOW_OFF_PUMP_CTRL)) Serial.println("Low off and pump control not allowed"); else Serial.println("Low off and pump control allowed");  
64 - if(slaveFlags & uint8_t(OpenTherm::CONFIGURATION_FLAGS::SLAVE_CH2_PRESENT)) Serial.println("CH2 present"); else Serial.println("CH2 not present"); 59 + if(secondaryFlags & uint8_t(OpenTherm::CONFIGURATION_FLAGS::SECONDARY_DHW_PRESENT)) Serial.println("Domestic Hot Water (DHW) present"); else Serial.println("Domestic Hot Water (DHW) not present");
  60 + if(secondaryFlags & uint8_t(OpenTherm::CONFIGURATION_FLAGS::SECONDARY_CONTROL_TYPE)) Serial.println("Control type on/off"); else Serial.println("Control type modulating");
  61 + if(secondaryFlags & uint8_t(OpenTherm::CONFIGURATION_FLAGS::SECONDARY_COOLING)) Serial.println("Cooling supprted"); else Serial.println("Cooling not supported");
  62 + if(secondaryFlags & uint8_t(OpenTherm::CONFIGURATION_FLAGS::SECONDARY_DHW)) Serial.println("Domestic Hot Water (DHW) storage tank"); else Serial.println("Domestic Hot Water (DHW) instantaneous or not-specified");
  63 + if(secondaryFlags & uint8_t(OpenTherm::CONFIGURATION_FLAGS::SECONDARY_LOW_OFF_PUMP_CTRL)) Serial.println("Low off and pump control not allowed"); else Serial.println("Low off and pump control allowed");
  64 + if(secondaryFlags & uint8_t(OpenTherm::CONFIGURATION_FLAGS::SECONDARY_CH2_PRESENT)) Serial.println("Second Central Heating system (CH2) present"); else Serial.println("Second Central Heating system (CH2) not present");
65 } else { 65 } else {
66 - slaveFlags = 0; 66 + secondaryFlags = 0;
67 67
68 - if(master.error() == OpenTherm::ERROR_CODES::UNKNOWN_DATA_ID) {  
69 - // Valid data is received but the for boilers mandatory DATA-ID OpenTherm::READ_DATA_ID::SLAVE_CONFIGURATION is not recognised. This is not a boiler but another device! 68 + if(thermostat.error() == OpenTherm::ERROR_CODES::UNKNOWN_DATA_ID) {
  69 + // Valid data is received but the for boilers mandatory DATA-ID OpenTherm::READ_DATA_ID::SECONDARY_CONFIGURATION is not recognised. This is not a boiler but another device!
70 Serial.println("Your setup is working correctly but the remote device is not a boiler."); 70 Serial.println("Your setup is working correctly but the remote device is not a boiler.");
71 - Serial.println("Look in EasyOpenTherm.h for the HVAC_SLAVE_CONFIGURATION or SOLAR_SLAVE_CONFIGURATION\n DATA-ID and the corresponding master and slave flags."); 71 + Serial.println("Look in EasyOpenTherm.h for the HVAC_SECONDARY_CONFIGURATION or SOLAR_SECONDARY_CONFIGURATION\n DATA-ID and the corresponding primary and secondary flags.");
72 } else { 72 } else {
73 // No data or invalid data received 73 // No data or invalid data received
74 Serial.println("Your setup is not working yet. Please check:"); 74 Serial.println("Your setup is not working yet. Please check:");
@@ -77,7 +77,7 @@ void loop() { @@ -77,7 +77,7 @@ void loop() {
77 Serial.printf("Is the OpenTherm controller TxD pin connected to the microcontroller's Rx pin as specified by\n #define OT_RX_PIN? Currently this pin is defined as %d.\n", OT_RX_PIN); 77 Serial.printf("Is the OpenTherm controller TxD pin connected to the microcontroller's Rx pin as specified by\n #define OT_RX_PIN? Currently this pin is defined as %d.\n", OT_RX_PIN);
78 Serial.printf("Is the OpenTherm controller RxD pin connected to the microcontroller's Tx pin as specified by\n #define OT_TX_PIN? Currently this pin is defined as %d.\n", OT_TX_PIN); 78 Serial.printf("Is the OpenTherm controller RxD pin connected to the microcontroller's Tx pin as specified by\n #define OT_TX_PIN? Currently this pin is defined as %d.\n", OT_TX_PIN);
79 Serial.printf("Is the microcontroller's Tx pin (currently pin %d} not an 'input only' pin?\n", OT_TX_PIN); 79 Serial.printf("Is the microcontroller's Tx pin (currently pin %d} not an 'input only' pin?\n", OT_TX_PIN);
80 - Serial.printf("Is in your software the OpenTherm object defined as OpenTherm master(OT_RX_PIN, OT_TX_PIN);\n Currently this expands to OpenTherm master(%d, %d);\n", OT_RX_PIN, OT_TX_PIN); 80 + Serial.printf("Is in your software the OpenTherm object defined as OpenTherm thermostat(OT_RX_PIN, OT_TX_PIN);\n Currently this expands to OpenTherm thermostat(%d, %d);\n", OT_RX_PIN, OT_TX_PIN);
81 Serial.println("\n"); 81 Serial.println("\n");
82 } 82 }
83 } 83 }