Page 1 of 2

OTGW and on/off thermostat

Posted: Wed Sep 24, 2014 10:05 am
by Jedi223
I'm working on a heating system at our scouts club house. We just replaced our two old on/off Nefit boilers with new Remeha Calenta's (28solo). (http://www.scouting-bvh.nl/furnacecpu)
My old system used a relay to switch a boiler on/off, the new boilers use the OpenTherm protocol for which I have bought two gateways.
Those gateways are connected to the serials ports of the Arduino Mega in the system, which in turn calculates the desired setpoints and cascade setup.
All that works perfectly fine, though my backup solution of short-circuiting the thermostat pins to set the OTGW to the maximum setpoint does not.
When I short-circuit the thermostat pins the OTGW throws a communication error and stops sending messages to the boiler.

I thought the OTGW would send a maximum setpoint of 90degrees when short-circuiting the thermostat pins?

The hardware seems fine, when I connect a opentherm thermostat to those pins I get the information from that thermostat.

Any ideas as to how I can solve this?

Re: OTGW and on/off thermostat

Posted: Wed Sep 24, 2014 6:14 pm
by hvxl
I'm not sure what you mean by "the OTGW throws a communication error". The firmware doesn't contain any string with any similarity to "communication error". It would also be quite useless because when there's a communication error the gateway would be unable to communicate that fact.

How exactly are you applying the short-circuit to the thermostat pins? Could you possible be shorting them to something more than just each other? Are the 5V and 24V levels still OK when the pins are shorted?

Re: OTGW and on/off thermostat

Posted: Wed Sep 24, 2014 9:14 pm
by Jedi223
Thank you for your quick answer. (and for creating this incredible piece of hard- and software :) )
By 'throwing an error' I mean it's giving 'Error 03' over the serial port. I've also connect a led to LED A and appointed function E (Transmission error has been detected) to it, when I short-circuit the thermostat pins that led also lights up briefly.

The voltage levels are still OK when shorted and only the thermostat pins are being shorted, the PIC also gets a normal 5V supply.

I'll try to post the OTmonitor logs this weekend and do some more measurements, I don't expect anything to be wrong with the hardware though, everything else works as expected.

Re: OTGW and on/off thermostat

Posted: Fri Sep 26, 2014 10:16 am
by manuelito80
Hi,
I also have problems to use the gateway with an on/off thermostat, but doing some debugging it seems that there is little bug in parity bit calculation (opentherm message to the boiler from gateway).

Look at this logfile part:
19:19:06.877893 R90013200 Write-Data Control setpoint: 50.00
19:19:06.968132 BE0010000 Data-Inv Control setpoint: 0.00

Shouldn't be R10013200 the message to be sent to boiler?(even parity, so in this case partiy bit should be cleared, not set).

Hope that Schelte can release a fix.

Best Regards.

Re: OTGW and on/off thermostat

Posted: Fri Sep 26, 2014 2:24 pm
by hvxl
I don't see what the problem is. 90013200 (1001 0000 0000 0001 0011 0010 0000 0000) has 6 bits set to one. So that's correct for even parity. The 10013200 you suggest would only have 5 bits set to one.

Note: The R is not sent to the boiler. It's only used as an indication of the interface and direction of the message.

Re: OTGW and on/off thermostat

Posted: Tue Sep 30, 2014 3:25 pm
by manuelito80
Ok, yes I miusnderstood how the parity bit is calculated.
Now I find why my Riello boiler doesn't accept th CH command that comes from the gateway.
Switching the thermostat from summer mode(DHW enabled) to winter mode(DHW & CH enabled) I saw that the thermostat sends a TSP command to the boiler, once the thermostat has sent this command to the boiler the gateway is able to control the CH.
Isn't possible to inject he command through the gateway(maybe a new serial command, for example TS={paramId}:{paramVal})?

Re: OTGW and on/off thermostat

Posted: Mon Oct 06, 2014 8:41 pm
by boodoopl
Hi,

I am also using OTGW in Stand-alone operation with on/off connected to relay which is closed when head is needed.

The problem is that in about 30% of cases when relay is closed the boiler does not heat.
For sure the contacts are shortcut because I check it with multimeter.

If I run Otmonitor in such situation I can see that setpoint is still set to 10 degrees.
If I send CS=60 command, the boiler start heating immidietly.
Going further: If I open the relay after that, the boiler does not stop heating.
What I need to do is to send CS=10.

Re: OTGW and on/off thermostat

Posted: Wed Oct 15, 2014 5:16 pm
by hvxl
Can you run the command DP=57 and check which values are reported when the boiler doesn't start heating with the thermostat connections of the gateway shorted? The gateway needs to consistently see a value below 6 to recognize a shorted input. If you see higher values, you will need to figure out why there's almost 1V on the analog input. With the inputs shorted, it should be pretty much 0. Alternatively, you can get the source code, increase the 6 on line 1442 of gateway.asm and rebuild the firmware. If you find you need to go above 11, you will also need to increase the 11 on line 1451.

If you see fluctuating values being reported, try to determine what is causing that (perhaps nearby AC power cables?)

Re: OTGW and on/off thermostat

Posted: Thu Oct 23, 2014 4:11 pm
by boodoopl
I've run DP=57 and I always get 00 value when relay is closed and over 70 when it is opened.

But I've discovered two strange behaviors:
* When I close/open relay periodically sometimes I get error 3
* Sometimes I see welcome message on console - it looks like gateway self reset.

I've also checked what is the gateway status in the described situation, so I made the steps:
* Open console
* Enable DP=57 report
* I get 57=00 constantly - it confirms that gateway sees short circuit
* Disable debugging: DP=00
* Close console
* Open OpenthermMonitor
* The logs confirm that OTGW does not set the CH enable flag and CS is set to 10:
R00000000 Read-Data Status: 00000000 00000000
- CH enable: disabled (0)
- DHW enable: disabled (0)
- Cooling enable: disabled (0)
- OTC active: not active (0)
- CH2 enable: disabled (0)
- Summer/winter mode: winter (0)
- DHW blocking: unblocked (0)
15:53:25.290252 BC0000000 Read-Ack Status: 00000000 00000000
- Fault indication: no fault (0)
- CH mode: not active (0)
- DHW mode: not active (0)
- Flame status: flame off (0)
- Cooling status: not active (0)
- CH2 mode: not active (0)
- Diagnostic indication: no diagnostics (0)
- Electricity production: not active (0)
15:53:26.167278 R80190000 Read-Data Boiler water temperature: 0.00
15:53:26.290871 BC0192966 Read-Ack Boiler water temperature: 41.40
15:53:27.200384 R10010A00 Write-Data Control setpoint: 10.00
15:53:27.292867 BD0010A00 Write-Ack Control setpoint: 10.00
In my opinion there is a problem with proper reading of relay status after reset, I would say "initial state problem", because when I open relay and close it again CS and CH enable are set properly.

The second problem is why I get welcome message periodically. Is it fore sure reset? Is it possible to check reset reason in some register?

Re: OTGW and on/off thermostat

Posted: Sun Oct 26, 2014 11:30 am
by hvxl
Your switching between different programs makes what you're doing a bit hard to follow. Why don't you just stick with otmonitor?

I've ran the situation you describe (thermostat lines shorted at powerup/reset) through the simulator and it works as expected. After the welcome message, the gateway reports "Thermostat disconnected" and then sends R80000100, i.e.: The CH enable bit is set.

I then even ripped my own thermostat off the wall, shorted the wires, and reset the gateway. It also worked as advertised:

Code: Select all

09:55:51.100367  OpenTherm Gateway 4.0.1
09:55:51.101453  Thermostat disconnected
09:55:55.220376  R80000100  Read-Data   Status: 00000001 00000000
09:55:55.310582  B4000010A  Read-Ack    Status: 00000001 00001010
09:55:56.251942  R80190000  Read-Data   Boiler water temperature: 0.00
09:55:56.412039  B40191B99  Read-Ack    Boiler water temperature: 27.60
09:55:57.292583  R10015A00  Write-Data  Control setpoint: 90.00
09:55:57.391933  BD0015A00  Write-Ack   Control setpoint: 90.00
The welcome message is printed on reset and in response to a PR=A command. Note that otmonitor will issue the PR=A command on startup to determine which functions are available in the gateway. If you get the welcome message without "PR: A=" in front of it, it means the gateway went through a reset.

The PIC used in the gateway has 4 types of reset: Power on reset, External reset, Brown-out reset, and Watchdog timer (WDT) reset. In case a WDT reset happens (due to a firmware bug), the gateway will report "WDT reset!". I didn't put in the code that would be needed to differentiate between the other reset types.

Re: OTGW and on/off thermostat

Posted: Fri Dec 26, 2014 2:48 pm
by ABSolute
I have a sort of similar problem.
I'm trying to control a Remeha Avanta via the OTGW and a simple on/off thermostat.

What I encounter is that after a boot or GW=R reset the OTGW will switch on the CH with "Control setpoint: 75.00" and "Maximum relative modulation level: 100.00" when the temperature reaches a temp below the setpoint on the thermostat.
Once the temperature is above the setpoint of the thermostat the OTGW switches off the CH with "Control setpoint: 10.00" and "Maximum relative modulation level: 100.00"

After this the OTGW will not switch on the CH anymore eventhough the temperature in the room will go below the setpoint of the thermostat.
Only way to switch on the CH again is to powercycle to OTGW or via an "GW=R" reset.

I have measured the voltage over X1 when the CH should be on, this is 0V, when it should be off it is 24.3V

What could be the issue here?

Re: OTGW and on/off thermostat

Posted: Fri Dec 26, 2014 11:25 pm
by hvxl
Assuming this is with firmware 4.1, can you issue the command DP=57 (via Options -> Miscellaneous) and then collect a log showing the scenario you just described?

Re: OTGW and on/off thermostat

Posted: Sat Dec 27, 2014 12:03 pm
by ABSolute
Yes, this is with 4.1 SW.
When the thermostat is on DP=00, thermostat off it fluctuates between 8B and 95
Log has been send

Re: OTGW and on/off thermostat

Posted: Sun Dec 28, 2014 12:01 pm
by hvxl
I confirm your conclusion that this is not working as expected. A quick glance at the logs revealed no clue about why it's not reacting to the second heat demand by the thermostat. It will take me some time to figure out what the problem is.

If you understand how to read individual bits in a hex value and you are willing to do some more testing, you can repeat the test with DP=61. Bit 2 of the printed value should always be set, indicating that the gateway doesn't see an opentherm thermostat. Bit 3 should be set when the thermostat is on. Knowing if that bit correctly reflects the state of the thermostat will help narrow down where to look.

Re: OTGW and on/off thermostat

Posted: Sun Dec 28, 2014 12:40 pm
by ABSolute
After a reset with the thermostat switched to on:
61=0F

Thermostat switched off:
61=07

Thermostat switched on:
61=07 (it will stay on this value no matter what the state of the thermostat is)

I have seen that the OTGW will start the CH for one cycle directly after midnight.