Commit 279fc68d4273d097ea23b0a777d3dae7d0de9e66
1 parent
08a9ec6b
Add error handling information to README.md
Showing
1 changed file
with
13 additions
and
0 deletions
README.md
| @@ -46,6 +46,19 @@ All these functions take an OpenTherm DATA-ID as _first_ parameter. The DATA-ID | @@ -46,6 +46,19 @@ All these functions take an OpenTherm DATA-ID as _first_ parameter. The DATA-ID | ||
| 46 | - float marked as f8.8 (because actually it is a sint16_t / 256) | 46 | - float marked as f8.8 (because actually it is a sint16_t / 256) |
| 47 | - Two times a uint8_t marked as flag8, u8 or s8. If it is a flag the meaning of bits is defined in an enum class with a name ending in _FLAG, e.g. ```enum class STATUS_FLAGS``` | 47 | - Two times a uint8_t marked as flag8, u8 or s8. If it is a flag the meaning of bits is defined in an enum class with a name ending in _FLAG, e.g. ```enum class STATUS_FLAGS``` |
| 48 | 48 | ||
| 49 | +## Error handling | ||
| 50 | +The function ```error()``` is used to get information about the last call to one of the functions ```read()```, ```write()``` or ```readWrite()```. All these functions return ```false``` if an | ||
| 51 | +error occurred in the _communication_ between thermostat (primary) and boiler or HVAC (secondary). These functions return ```true``` if everything is fine, but also upon an error on | ||
| 52 | +_application level_. You will get this error if e.g. you _read out_ your boiler or HVAC with a DATA-ID that is not supported. Also, if you _write data to_ your boiler or HVAC, the value can be out of range, e.g. a setpoint is to low or to high. In this case ```error()``` will return ```INVALID_DATA```. Note that the exact behaviour is not specified in the OpenTherm specification, so if you get this error you'll know that the value you sent was out of bounds, but if you do not get this error the value still might not got accepted by the boiler or HVAC. | ||
| 53 | + | ||
| 54 | +All error codes: | ||
| 55 | +- ```OK```: everything is fine! | ||
| 56 | +- ```UNKNOWN_DATA_ID```: your boiler or HVAC does not support the DATA-ID you requested. | ||
| 57 | +- ```INVALID_DATA```: the DATA-ID you sent with ```write()``` or ```readWrite()``` is correct but _the value_ you sent is out of bounds | ||
| 58 | +- ```SEND_TIMEOUT```: a timeout occurred while sending the request to the boiler or HVAC. Check if the timeout value in the OpenTherm constructor is OK (should be less than 1,000 ms, defaults to 900 ms) | ||
| 59 | +- ```RECEIVE_TIMEOUT```: a timeout occurred while sending the request to the boiler or HVAC. Most of the time this indicates problems with wiring. If wiring is OK, did you check if your boiler actually does support the OpenTherm protocol? | ||
| 60 | +- ```PARITY_ERROR```: the parity check failed. | ||
| 61 | + | ||
| 49 | ## Glossary | 62 | ## Glossary |
| 50 | - _primary_: the device issuing the requests, in this context also called _thermostat_ | 63 | - _primary_: the device issuing the requests, in this context also called _thermostat_ |
| 51 | - _secondary_: the device handling the requests and sending responses, also called _boiler_ or _HVAC_ | 64 | - _secondary_: the device handling the requests and sending responses, also called _boiler_ or _HVAC_ |