Page 1 of 3
Strange problem with OTGW
Posted: Tuesday 10 April 2018 18:28
by Hobbybob
Hello,
I've built an OTGW with LAN-interface, and when I connected it yesterday, it worked like a charm! However, somewhere during the night, it got in an error, and this morning it didn't work anymore. I restarted the OTGW (unplug and replug the power cable), and sudo-rebooted my RPi. It looked as if it was up again, as the thermostat showed an outside temperature again. This disappeared quickly however, and now it doesn't respond to anything anymore.
The strange thing is: when I look in the Log-tab in Domoticz, I see a lot of communication with the OTGW. Just a small selection (mind you: this is just 12 seconds):
Code: Select all
2018-04-10 18:14:01.499 OTGW: T10010A00
2018-04-10 18:14:01.499 OTGW: BD0010A00
2018-04-10 18:14:01.499 OTGW: T80190000
2018-04-10 18:14:02.499 OTGW: B401938F8
2018-04-10 18:14:02.499 OTGW: T80000200
2018-04-10 18:14:02.499 OTGW: B40000200
2018-04-10 18:14:02.499 OTGW: T80000200
2018-04-10 18:14:03.499 OTGW: B40000200
2018-04-10 18:14:03.499 OTGW: T80000200
2018-04-10 18:14:03.499 OTGW: B40000200
2018-04-10 18:14:04.500 OTGW: T80000200
2018-04-10 18:14:04.500 OTGW: B40000200
2018-04-10 18:14:04.500 OTGW: T80384100
2018-04-10 18:14:04.500 OTGW: B40384100
2018-04-10 18:14:05.500 OTGW: T00395A00
2018-04-10 18:14:05.500 OTGW: BF0390000
2018-04-10 18:14:05.500 OTGW: AC0395A00
2018-04-10 18:14:05.500 OTGW: T10010A00
2018-04-10 18:14:05.500 OTGW: BD0010A00
2018-04-10 18:14:06.500 OTGW: T80000200
2018-04-10 18:14:06.501 OTGW: B40000200
2018-04-10 18:14:06.501 OTGW: T80190000
2018-04-10 18:14:07.501 OTGW: B4019390A
2018-04-10 18:14:07.501 OTGW: T80000200
2018-04-10 18:14:07.501 OTGW: B40000200
2018-04-10 18:14:07.501 OTGW: T80000200
2018-04-10 18:14:08.501 OTGW: B40000200
2018-04-10 18:14:08.501 OTGW: T80000200
2018-04-10 18:14:08.501 OTGW: B40000200
2018-04-10 18:14:09.502 OTGW: T00110000
2018-04-10 18:14:09.502 OTGW: BC0110000
2018-04-10 18:14:09.502 OTGW: T80000200
2018-04-10 18:14:09.502 OTGW: B40000200
2018-04-10 18:14:10.502 OTGW: T80000200
2018-04-10 18:14:10.502 OTGW: B40000200
2018-04-10 18:14:10.502 OTGW: T10010A00
2018-04-10 18:14:10.502 OTGW: BD0010A00
2018-04-10 18:14:11.502 OTGW: T80000200
2018-04-10 18:14:11.503 OTGW: B40000200
2018-04-10 18:14:11.503 OTGW: T80190000
2018-04-10 18:14:12.503 OTGW: B40193911
2018-04-10 18:14:12.503 OTGW: T00120000
2018-04-10 18:14:12.503 OTGW: B4012010F
2018-04-10 18:14:12.503 OTGW: T80000200
When I try to change the setpoint, I get these lines in the log:
Code: Select all
2018-04-10 18:13:45.710 OTGW: Setting Room SetPoint to: 15.0
2018-04-10 18:13:45.714 (OpenTherm Gateway) Thermostat (Thermostaat)
2018-04-10 18:13:46.490 OTGW: OE
2018-04-10 18:13:46.490 OTGW: PR: OpenTherm Gateway 4.2.5
I can also log into the settings-page of the LAN-adapter (USR TCP232-T2)
The log does not show any errors when I click that tab. The log was however cleaned when I rebooted the RPi (It's on a RAM-drive, and I didn't think of saving it first...).
Anybody any idea what it could be, or where I can look into further details?
The room temperature graph also shows hickups during the night:

- temperature.jpg (63.67 KiB) Viewed 10144 times
The room temperature-block in the dashboard shows 0 degrees Celcius, and has a red header. It states the temperature wasn't seen since 7:54 this morning (which is about the time I also got it to show a outside temperature very shortly)
Re: Strange problem with OTGW
Posted: Wednesday 11 April 2018 19:11
by Hobbybob
Okay, follow up. I disconnected the OTGW yesterday before I went to bed (of course unplugging the power, but also the signal-cables to the thermostat and the boiler, and I disabled the OTGW-hardware in Domoticz).
I left it like that until just now. I connected it all together, and enabled the hardware. Now it shows the outside temperature again on the Thermostat, and I get readable entries in the log every thirty seconds:
Code: Select all
2018-04-11 19:03:10.906 (OpenTherm Gateway) Temp (Control Setpoint)
2018-04-11 19:03:10.907 (OpenTherm Gateway) General/Percentage (Maximum Relative Modulation Level)
2018-04-11 19:03:10.911 (OpenTherm Gateway) Thermostat (Thermostaat)
2018-04-11 19:03:10.912 (OpenTherm Gateway) General/Percentage (Relative modulation level)
2018-04-11 19:03:10.913 (OpenTherm Gateway) General/Pressure (CH Water Pressure)
2018-04-11 19:03:10.917 (OpenTherm Gateway) Temp (Temperatuur kamer)
2018-04-11 19:03:10.919 (OpenTherm Gateway) Temp (Boiler Water Temperature)
2018-04-11 19:03:10.920 (OpenTherm Gateway) Temp (DHW Temperature)
2018-04-11 19:03:10.921 (OpenTherm Gateway) Temp (Outside Temperature)
2018-04-11 19:03:10.923 (OpenTherm Gateway) Temp (Return Water Temperature)
2018-04-11 19:03:10.924 (OpenTherm Gateway) Thermostat (DHW Setpoint)
Also changing the setpoint works now.
I'll leave this up for now, and see tomorrow morning if it still works... Fingers crossed, but since it also worked the day before I'm a bit sceptical.
Re: Strange problem with OTGW
Posted: Thursday 12 April 2018 18:29
by Hobbybob
Well, too bad... It didn't work for long.
I turned it on again at 19:00, but the first "weird" log-entries (like the ones I posted in the opening post) started appearing at 19:45. It did work again a couple of times, but after 20:26 it did not come back to life anymore.
I can see multiple log entries "Error: OTGW: Error received!", and I found one entry that said "OTGW: Error 03"
Anybody any idea?
Re: Strange problem with OTGW
Posted: Friday 13 April 2018 2:18
by admin
I have two ideas...
Domoticz sends a special command to set the OTGW in a special mode...
They you do not see those long loss and all is working correctly
Either.. you are using another program or monitor software that puts it in the other move again
Or
It seems it turns itself off and on again
In the hardware setting you can also specify a timeout of 1 minute but this should NOT be needed
Re: Strange problem with OTGW
Posted: Friday 13 April 2018 11:26
by Hobbybob
I don't have other software running at the same time. I have used otmonitor from the OTGW-website when testing it after building, but I don't use that anymore. I can always try to delete the hardware from Domoticz, and re-add it, just to make sure I get a clean start in Domoticz, but i don't think that is the problem because I do have correct readings before it bumps into the error.
I will try to set the timeout tonight, and then I can check tomorrow-evening again. But if this is the problem (the gateway turningitself off and on again), I think I will have to do something else. Could it be that the PIC is not programmed correctly (I bought it pre-programmed since I don't own a PIC-programmer), or would it be more likely that I did something wrong with the assembling/soldering?
Re: Strange problem with OTGW
Posted: Friday 13 April 2018 17:30
by sincze
Hobbybob wrote: ↑Friday 13 April 2018 11:26
I don't have other software running at the same time. I have used otmonitor from the OTGW-website when testing it after building, but I don't use that anymore. I can always try to delete the hardware from Domoticz, and re-add it, just to make sure I get a clean start in Domoticz, but i don't think that is the problem because I do have correct readings before it bumps into the error.
I will try to set the timeout tonight, and then I can check tomorrow-evening again. But if this is the problem (the gateway turningitself off and on again), I think I will have to do something else. Could it be that the PIC is not programmed correctly (I bought it pre-programmed since I don't own a PIC-programmer), or would it be more likely that I did something wrong with the assembling/soldering?
Have a closer look at the amount of "OTGW: Error 03" it is a voltage mismatch that can be corrected.
Domoticz is not good for debugging OTGW, use OTMONITOR
http://otgw.tclcode.com/debugging.html
Re: Strange problem with OTGW
Posted: Friday 13 April 2018 18:16
by Hobbybob
sincze wrote: ↑Friday 13 April 2018 17:30
Hobbybob wrote: ↑Friday 13 April 2018 11:26
I don't have other software running at the same time. I have used otmonitor from the OTGW-website when testing it after building, but I don't use that anymore. I can always try to delete the hardware from Domoticz, and re-add it, just to make sure I get a clean start in Domoticz, but i don't think that is the problem because I do have correct readings before it bumps into the error.
I will try to set the timeout tonight, and then I can check tomorrow-evening again. But if this is the problem (the gateway turningitself off and on again), I think I will have to do something else. Could it be that the PIC is not programmed correctly (I bought it pre-programmed since I don't own a PIC-programmer), or would it be more likely that I did something wrong with the assembling/soldering?
Have a closer look at the amount of "OTGW: Error 03" it is a voltage mismatch that can be corrected.
Domoticz is not good for debugging OTGW, use OTMONITOR
http://otgw.tclcode.com/debugging.html
I have found that, will be looking into that , but I have only once seen an error 03 in the log so I don't think that is the main problem.
Usually it gives the code OE, and according to the site that means "Overrun Error. The processor was busy and failed to process all received characters."
Any ideas how this can be caused, and if it is possible to correct this?
Re: Strange problem with OTGW
Posted: Friday 13 April 2018 18:37
by sincze
Thanks for the update.
Indeed a 1 time error 03 is not an issue
I've to give it a little more thought as I have not seen the OE.
You are totally right here.
Code: Select all
OE - Overrun Error.
The processor was busy and failed to process all received characters.
And I've had my fair share of error messages and resets with OTGW.
Given your logs it seems you receive values just fine.
Normally for OTGW issues I visit the following
https://www.domoticaforum.eu/viewforum.php?f=75
Maybe this helps;
https://www.domoticaforum.eu/viewtopic. ... +OE#p84080
Re: Strange problem with OTGW
Posted: Friday 13 April 2018 18:45
by Hobbybob
sincze wrote: ↑Friday 13 April 2018 18:37
Thanks for the update.
Indeed a 1 time error 03 is not an issue
I've to give it a little more thought as I have not seen the OE.
You are totally right here.
Code: Select all
OE - Overrun Error.
The processor was busy and failed to process all received characters.
And I've had my fair share of error messages and resets with OTGW.
Given your logs it seems you receive values just fine.
Normally for OTGW issues I visit the following
https://www.domoticaforum.eu/viewforum.php?f=75
Maybe this helps;
https://www.domoticaforum.eu/viewtopic. ... +OE#p84080
I'll head over there in a couple of days (I have non-domotica plans tomorrow). I've just turned it all on again after deleting the hardware from Domoticz and re-adding it. I've set the data timeout to 1 minute. It's just started running a couple of minutes ago, so everything is still okay at this moment.
I'll be posting back the results when I have something new. Of course, if someone has experience with the OE-error, I;d still like to hear it! I'll be reading this forum also.
Re: Strange problem with OTGW
Posted: Sunday 15 April 2018 19:05
by Hobbybob
Okay, so I've had another go at it, and tried to get a good log that I could use on the domoticaforum.eu-forum. I downloaded otmonitor.exe from the OTGW-site, and reconnected the gateway to the thermostat- and boiler-wires, and plugged the powercord in. The hardware was still disabled in Domoticz, so that wasn't a problem.
As soon as I fired up otmonitor and put in the correct ip-address and portnumber it started showing all kinds of received info in he log-tab. I let it run, expecting it to run into errors in the first hour or so, just as Domoticz does every time. But this didn't happen. I checked the log-file which runs from 15:18 all the way through to 18:33 (so more than 3 hours) without anything that looks like an error. I did a search in the log for "OE", "Overflow" and "error", but it all turned up clean. The graphs produced in Otmonitor is also not showing any weird reading like my screenshot in the first post does.
So I thought: let's try Domoticz again. I did not pull the plug on the gateway, I just closed otmonitor, and then re-enabled the hardware in Domoticz. It began registering in the log immediatly with the unreadable messages from OTGW, just like the ones I had earlier. It also showed the OE-error, and I also discovered one line in there with the "NG" ("Not good")-message, and one line with the "SE" ("Syntax Error")-message.
After that, I disabled the hardware in Domoticz again, and fired up otmonitor one more time, and that immediatly started showing data again that's correct and without errors...
So, I'm not sure if it is still usefull to start a thread on the domoticaforum.eu-forum, or if it is something in Domoticz that's bothering me... Considering the results I got today, I'm starting to suspect Domoticz. I'm running the latest stable (3.8153) by the way.
Re: Strange problem with OTGW
Posted: Sunday 15 April 2018 19:48
by sincze
Just try with otmonitor and relay to domoticz to see what happens
Re: Strange problem with OTGW
Posted: Saturday 21 April 2018 12:25
by Hobbybob
sincze wrote: ↑Sunday 15 April 2018 19:48
Just try with otmonitor and relay to domoticz to see what happens
Okay, I had a go at this today. I switched everything back on, and set the relay messages-checkbox on in OTMonitor. I then added a second OTGW-hardware in Domoticz with the ip-address of my laptop and the portnumber of OTMonitor. It worked immediatly, showin OTGW-messages in the log and the domoticz-ip in the active connections-box in OTmonitor.
It worked well for a bit, until the log started filling again with the same gibberish I had in earlier attempts.
If I examine the log from domoticz it is the same as before, but in the log-file of OTMonitor I see a coule of entries of commands that are apparently sent by Domoticz:
Code: Select all
12:04:33.830083 Command (via relay server, from 192.168.0.35:46590): SC=12:04/6
12:04:33.858651 OE
12:04:33.870621 Command (via relay server, from 192.168.0.35:46590): PR=G
12:04:33.879377 Command (via relay server, from 192.168.0.35:46590): PR=I
12:04:33.890342 Command (via relay server, from 192.168.0.35:46590): PR=O
12:04:33.901889 Command (via relay server, from 192.168.0.35:46590): PS=1
12:04:33.909426 PR: G=00
12:04:33.929078 PR: I=00
12:04:33.935229 PR: O=N
12:04:34.102348 PS: 1
12:04:34.135880 00000010/00000000,10.00,00000000/00000000,100.00,0/0,15.00,0.00,0.00,23.03,60.69,0.00,0.00,0.00,0/0,0/0,65.00,0.00,0,0,0,0,0,0,0,0
12:05:03.903179 Command (via relay server, from 192.168.0.35:46590): SC=12:05/6
12:05:03.943236 SC: 12:05/6
12:05:03.953064 Command (via relay server, from 192.168.0.35:46590): PR=G
12:05:03.960159 Command (via relay server, from 192.168.0.35:46590): PR=I
12:05:03.969040 Command (via relay server, from 192.168.0.35:46590): PR=O
12:05:03.976229 Command (via relay server, from 192.168.0.35:46590): PS=1
12:05:03.985858 PR: G=00
12:05:04.090766 PR: I=0(SOH)OpenTherm Gateway 4.2.5
12:05:04.979805 T80000200 Read-Data Status: 00000010 00000000
- CH enable: disabled (0)
- DHW enable: enabled (1)
- Cooling enable: disabled (0)
- OTC active: not active (0)
- CH2 enable: disabled (0)
- Summer/winter mode: winter (0)
- DHW blocking: unblocked (0)
12:05:05.145968 B40000200 Read-Ack Status: 00000010 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)
This piece of log was exactly at one of the moments the Domoticz-log started showing gibberish (at 12:04:34 I have correct messages in the log, at 12:05:05 it starts outputting the "T80000200"-type of lines.
The (SOH) on the first line of 12:05:04 I put in there myself as this is what was shown in Notepad++, but I cannot copy it over to this forum.
I think Domoticz is sending messages that the OTGW can't handle for some reason... Is this a known thing anywhere, or does anybody have a clue where to start looking?
Re: Strange problem with OTGW
Posted: Saturday 28 April 2018 18:17
by Hobbybob
Okay, so I also posted my problem on the Domoticaforum.eu-forum, and I got a response from Schelte:
It looks like domoticz bombards the OTGW with commands without waiting for a response. The OTGW was not designed to handle such abuse. Then at some point it resets. That clears the PS=1 mode and the OTGW starts reporting Opentherm messages again (that is not gibberish, it's valuable data).
It may be interesting to check the reason for the reset (PR=Q).
The OE reports also indicate that the gateway is receiving data faster than it can handle. I don't know if domoticz has configuration settings to make it behave nicer, for example by switching off some of the commands it spits out. Otherwise you will have to investigate getting domoticz fixed.
Does anybody else have an idea how to reduce the number of commands from Domoticz? Or has anybody else had this problem with their OTGW and Domoticz?
Re: Strange problem with OTGW
Posted: Sunday 29 April 2018 13:13
by wizjos
Hobbybob wrote: ↑Saturday 28 April 2018 18:17Does anybody else have an idea how to reduce the number of commands from Domoticz? Or has anybody else had this problem with their OTGW and Domoticz?
Alas I can confirm this behaviour. Happens a lot of times, although I cannot detect a pattern... Most of the times only a hard reset of the OTGW (power off and on) helps (sometimes even need to repeat this a few times before I have it responding again in Domoticz).
I don't know if it is possible to reduce the number of calls, but if not I hope it can be implemented!
Regards,
Wizjos
Re: Strange problem with OTGW
Posted: Sunday 06 May 2018 12:24
by Hobbybob
Anybody any idea?
Re: Strange problem with OTGW
Posted: Tuesday 15 May 2018 9:07
by vasco
Maybe you already did this but just for the record because I saw your screenshot with settings on the other topic;
Did you have the settings for the USR TCP232-T2 correct?
- The wrong baud rate can cause problems with the communication
- Set it as a server only on port 23
- Disable Similar RFC2217, can also cause problems with the communication
I also posted my
screenshot with the correct settings in that other topic.
I will take a look at some other settings when I'm home because I had some of these issues too when I started this project but at my place it is running fine now. I've got two domotica systems (Domoticz and Homeseer) parallel and both are communicating fine simultaneously with the OTGW over the USR TCP232-T2.
[EDIT]
Another thing I thought right now is the firmware version on the OTGW. I had a lot of trouble with the latest firmware in combination with Domoticz and Homeseer. So I re-flashed firmware version 3.4 from 2015 back in the OTGW and as I remember all was fine after that. Firmware version 4.0 and above caused lots of the errors you wrote about.
Re: Strange problem with OTGW
Posted: Tuesday 15 May 2018 18:55
by Hobbybob
vasco wrote: ↑Tuesday 15 May 2018 9:07
Maybe you already did this but just for the record because I saw your screenshot with settings on the other topic;
Did you have the settings for the USR TCP232-T2 correct?
- The wrong baud rate can cause problems with the communication
- Set it as a server only on port 23
- Disable Similar RFC2217, can also cause problems with the communication
I also posted my
screenshot with the correct settings in that other topic.
I will take a look at some other settings when I'm home because I had some of these issues too when I started this project but at my place it is running fine now. I've got two domotica systems (Domoticz and Homeseer) parallel and both are communicating fine simultaneously with the OTGW over the USR TCP232-T2.
[EDIT]
Another thing I thought right now is the firmware version on the OTGW. I had a lot of trouble with the latest firmware in combination with Domoticz and Homeseer. So I re-flashed firmware version 3.4 from 2015 back in the OTGW and as I remember all was fine after that. Firmware version 4.0 and above caused lots of the errors you wrote about.
Hey vasco! Thanks for your input! As I said: I was completely stuck on this one.
I'll try out the settings of the USR TCP232-T2 first, as that is something I can easily change. Obviously I did get it to communicate, so I found the client/server-dropdown, but I had a different portnumber, and I had "Similar RFC2217" checked. I've changed those, so they now match your example. I've removed the old hardware-entry from Domoticz, and added it again (with the new port-number). Now it's fingers crossed!
If that does not work, I'll have to reflash the OTGW it seems. I don't own a programmer (I bought a pre-programmed PIC), but I seem to remember I can reflash it with otmonitor.exe and the OTGW attached through the USB-cable, correct?
Re: Strange problem with OTGW
Posted: Tuesday 15 May 2018 20:18
by sincze
Flashing can be done with otmonitor indeed. No pic programmer needed. Let's hope you don't have to flash and it is solved now

Re: Strange problem with OTGW
Posted: Tuesday 15 May 2018 21:23
by Hobbybob
sincze wrote: ↑Tuesday 15 May 2018 20:18
Flashing can be done with otmonitor indeed. No pic programmer needed. Let's hope you don't have to flash and it is solved now
Aaaah, too bad...
After connecting everyting together, at first it starts to show the raw lines to the log, and after a coupe of seconds the messages become readable.
It ran without a problem for 55 minutes, then the fist "OTGW: NG" showed up, and a minute later the first "OTGW: OE"-error.
After that, they become more often, and "OTGW: PR :BV" also shows up a couple of times.
After an hour and 15 minutes it gives one final error: "OTGW: WDT reset!". After that, nothing anymore.
I can't find the meaning of "WDT reset!" on the OTGW-page anywhere. Does anybody know?
Looks like I'll have to flash the older firmware. I'll have a read into the steps that I need to make for that.
Re: Strange problem with OTGW
Posted: Wednesday 16 May 2018 0:41
by sincze
Hobbybob wrote: ↑Tuesday 15 May 2018 21:23
sincze wrote: ↑Tuesday 15 May 2018 20:18
Flashing can be done with otmonitor indeed. No pic programmer needed. Let's hope you don't have to flash and it is solved now
Aaaah, too bad...
I can't find the meaning of "WDT reset!" on the OTGW-page anywhere. Does anybody know?
That would mean the watchdog kicked in and a failure within the firmware itself. However as 4.2.5 has been running in a lot of gateways flawless (even in nine). That would be strange
.
http://www.domoticaforum.eu/viewtopic.php?f=75&t=11257