Strange problem with OTGW

For OpenTherm-gateway related questions in Domoticz

Moderator: leecollings

Hobbybob

Re: Strange problem with OTGW

Post by Hobbybob »

sincze wrote: Wednesday 16 May 2018 0:41 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
Ah, I see you are having problems as well. I will try to flash the older firmware in a couple of days, and post back the results. If that still doesn't work, I think I will have to try and test if the OTGW is actually good. I don't have much experience in soldering, so it could be something is not quite right, but since it works good when only otmonitor is connected, I was assuming the hardware-side was okay.

Are there any links on testing the hardware? Because I'm afraid that the older firmware will not be the solution, since (as you already said) many people are running this version in combination with Domoticz.
User avatar
sincze
Posts: 1300
Joined: Monday 02 June 2014 22:46
Target OS: Raspberry Pi / ODroid
Domoticz version: 2024.4
Location: Netherlands / Breda Area
Contact:

Re: Strange problem with OTGW

Post by sincze »

I have had problems since last October :)
For debugging hardware
http://otgw.tclcode.com/debugging.html

I have been running with otmonitor and relay enabled for quite some time. Even with that I had my wdt resets.

Currently installed a new pic. Instead of 7-20 resets a day now once every 3 weeks. But the heating does not do a lot these days so don't sure if that was the 100% fix.
Pass2php
LAN: RFLink, P1, OTGW, MySensors
USB: RFXCom, ZWave, Sonoff 3
MQTT: ZIgbee2MQTT,
ZWAVE: Zwave-JS-UI
WIFI: Mi-light, Tasmota, Xiaomi Shelly
Solar: Omnik, PVOutput
Video: Kodi, Harmony HUB, Chromecast
Sensors: You name it I got 1.
svkeulen
Posts: 12
Joined: Wednesday 03 January 2018 10:12
Target OS: -
Domoticz version:
Contact:

Re: Strange problem with OTGW

Post by svkeulen »

I just bought an OTGW with firmware 4.2.5. I noticed that it reports only messages of length 9 (like BC0090000) to domoticz (it says 2018-05-18 19:26:48.619 OTGW: BC0090000) while the source-code of domoticz seems to want to parse other output. I guess it is more like the messagelog of otmanager. Maybe older firmware outputs this type. I dont know because it failed to downgrade. Anyhow... I am rewriting the code (OTGWBase.cpp) of domoticz as we speak. I just finished two messageIDs and it works like a charm. ID 0 Status and 1 Control setpoint.

Now it says: 2018-05-18 19:26:46.808 (OTGW) Temp (Control Setpoint) etc...

When I finish I will share it with you.
Hobbybob

Re: Strange problem with OTGW

Post by Hobbybob »

svkeulen wrote: Friday 18 May 2018 19:37 I just bought an OTGW with firmware 4.2.5. I noticed that it reports only messages of length 9 (like BC0090000) to domoticz (it says 2018-05-18 19:26:48.619 OTGW: BC0090000) while the source-code of domoticz seems to want to parse other output. I guess it is more like the messagelog of otmanager. Maybe older firmware outputs this type. I dont know because it failed to downgrade. Anyhow... I am rewriting the code (OTGWBase.cpp) of domoticz as we speak. I just finished two messageIDs and it works like a charm. ID 0 Status and 1 Control setpoint.

Now it says: 2018-05-18 19:26:46.808 (OTGW) Temp (Control Setpoint) etc...

When I finish I will share it with you.
Oh, that would be awesome!
I don't know if it will solve my problems, but if the other solutions don't work, I'll sure give it a try!
svkeulen
Posts: 12
Joined: Wednesday 03 January 2018 10:12
Target OS: -
Domoticz version:
Contact:

Re: Strange problem with OTGW

Post by svkeulen »

I don't know if it will solve my problems, but if the other solutions don't work, I'll sure give it a try!
If you only see messages of length 9, mostly starting with a B(oiler) or a T(ermostat) in your domoticz log then it would.
Hobbybob

Re: Strange problem with OTGW

Post by Hobbybob »

Okay, so I decided to test the harware first. I disconnected the gateway from everything, and removed the PIC and octocoupler. Then I started to follow everything described on http://otgw.tclcode.com/debugging.html

All the voltages check out, but I don't register any amps on X1... Now I figured my multimeter might be broken, so I got a 100 ohm resistor, and screwed one end in X1, and then measured the voltage between the other end of the resistor and the other side of X1. I am still measuring the exact same voltage as when I don't have the resistor connected.

This is really weird. Am I doing something wrong here?
Hobbybob

Re: Strange problem with OTGW

Post by Hobbybob »

I also posted the question on the domoticaforum.eu-forum, and got a response there. I have been able to get through the whole testing procedure, and it looks like my hardware is okay. I did not immediatly suspect that it would not be, because with otmonitor it worked perfectly, but I just wanted to be sure.

It looks like I have to flash the older firmware. @sincze Do you have 3.4 anywhere? I can't find it on the otgw-website.
User avatar
sincze
Posts: 1300
Joined: Monday 02 June 2014 22:46
Target OS: Raspberry Pi / ODroid
Domoticz version: 2024.4
Location: Netherlands / Breda Area
Contact:

Re: Strange problem with OTGW

Post by sincze »

Oldest I have is 4.0.
Pass2php
LAN: RFLink, P1, OTGW, MySensors
USB: RFXCom, ZWave, Sonoff 3
MQTT: ZIgbee2MQTT,
ZWAVE: Zwave-JS-UI
WIFI: Mi-light, Tasmota, Xiaomi Shelly
Solar: Omnik, PVOutput
Video: Kodi, Harmony HUB, Chromecast
Sensors: You name it I got 1.
Domotibart
Posts: 38
Joined: Tuesday 06 December 2016 18:53
Target OS: NAS (Synology & others)
Domoticz version: V3.8153
Location: holland
Contact:

Re: Strange problem with OTGW

Post by Domotibart »

Joining in the discussion.

I have excactly the same problem. everything starts ok but after some hours i only get an endless stream of data from the gateway.
I do not think it has something to with the opentherm firmware. I have an older gateway with the serial/usb connection. It worked for 2 tears in a row using the USB port on teh gateway.
Only when i used a usb/serial to lan converter (ESP8266) the problem occured. When using the otmonitor and the lan setup everything works fine!
I think it has got something to do with the serial to lan communication between domoticz and the otmonitor.
Synology DS214play - esp8266 Opentherm Gateway - esp8266 somfyremote - esp8266 poolcontrol - esp8266 energyreader - zwave - Philips hue
User avatar
sincze
Posts: 1300
Joined: Monday 02 June 2014 22:46
Target OS: Raspberry Pi / ODroid
Domoticz version: 2024.4
Location: Netherlands / Breda Area
Contact:

Re: Strange problem with OTGW

Post by sincze »

Thanks for this update. It is now pointing in a direction finally. :)
Pass2php
LAN: RFLink, P1, OTGW, MySensors
USB: RFXCom, ZWave, Sonoff 3
MQTT: ZIgbee2MQTT,
ZWAVE: Zwave-JS-UI
WIFI: Mi-light, Tasmota, Xiaomi Shelly
Solar: Omnik, PVOutput
Video: Kodi, Harmony HUB, Chromecast
Sensors: You name it I got 1.
Hobbybob

Re: Strange problem with OTGW

Post by Hobbybob »

Domotibart wrote: Tuesday 22 May 2018 12:20 Joining in the discussion.

I have excactly the same problem. everything starts ok but after some hours i only get an endless stream of data from the gateway.
I do not think it has something to with the opentherm firmware. I have an older gateway with the serial/usb connection. It worked for 2 tears in a row using the USB port on teh gateway.
Only when i used a usb/serial to lan converter (ESP8266) the problem occured. When using the otmonitor and the lan setup everything works fine!
I think it has got something to do with the serial to lan communication between domoticz and the otmonitor.
Thanks for the information! It seems this problem is more common than I thought...

Any idea as to where the solution should be found in your opinion? Should the gateway firmware be changed, or Domoticz?
svkeulen
Posts: 12
Joined: Wednesday 03 January 2018 10:12
Target OS: -
Domoticz version:
Contact:

Re: Strange problem with OTGW

Post by svkeulen »

Domotibart wrote: Tuesday 22 May 2018 12:20 I think it has got something to do with the serial to lan communication between domoticz and the otmonitor.
I think you are right. I just finished rewriting the code (everything works flawless now) and discovered I made a terrible mistake. The good side is that I now know the cause of most problems.

I forgot to connect the Tx from my FTDI USB serial device to the OTGW from the beginning. So I only received B and T traffic as described above. It did not even respond to my command like PR=A (duh!). So I rewrote the domoticz code to parse this messages.

It seems that the old code relied on sending PS=1 to get a status report. If there is something wrong with the serial connection (bad signals due to long cables or in my case no Tx signal) domoticz receives nothing at all. It also send more than just one command (PR=G, PR=O and PR=I). This is not a good idea because this generates a lot of responses and everything have to work together. So just listening and not relying on sending a status report command is more error prone.

I attached my code so you can try (on your own risk :lol: ). I will review and test it a bit more before submitting it to domoticz github. I also documented the code. I will add more status reports and error handling. (I just finished reading the OpenTherm protocol specification) Hope you will give me some feedback on it so we can improve it more.
Attachments
OTGWBase.h
(2.21 KiB) Downloaded 111 times
OTGWBase.cpp
(24.49 KiB) Downloaded 106 times
Hobbybob

Re: Strange problem with OTGW

Post by Hobbybob »

svkeulen wrote: Friday 25 May 2018 8:46
Domotibart wrote: Tuesday 22 May 2018 12:20 I think it has got something to do with the serial to lan communication between domoticz and the otmonitor.
I think you are right. I just finished rewriting the code (everything works flawless now) and discovered I made a terrible mistake. The good side is that I now know the cause of most problems.

I forgot to connect the Tx from my FTDI USB serial device to the OTGW from the beginning. So I only received B and T traffic as described above. It did not even respond to my command like PR=A (duh!). So I rewrote the domoticz code to parse this messages.

It seems that the old code relied on sending PS=1 to get a status report. If there is something wrong with the serial connection (bad signals due to long cables or in my case no Tx signal) domoticz receives nothing at all. It also send more than just one command (PR=G, PR=O and PR=I). This is not a good idea because this generates a lot of responses and everything have to work together. So just listening and not relying on sending a status report command is more error prone.

I attached my code so you can try (on your own risk :lol: ). I will review and test it a bit more before submitting it to domoticz github. I also documented the code. I will add more status reports and error handling. (I just finished reading the OpenTherm protocol specification) Hope you will give me some feedback on it so we can improve it more.
I would like to try this out! Is it just a matter of replacing files twith these, or do I have to do something more than that?
Also: if there is anything I can do to help you with this (send log-files, or whatever), I'd be more than happy to do so. Just let me know.
svkeulen
Posts: 12
Joined: Wednesday 03 January 2018 10:12
Target OS: -
Domoticz version:
Contact:

Re: Strange problem with OTGW

Post by svkeulen »

I attached a screenshot. I connected domoticz via otmanager so there is more to see. Oh forgot to say I changed the devices IDs of the switches and sensors in domoticz to the corresponding OpenTherm message IDs. So you need to delete the OTGW devices from domoticz. It will make new devices with the correct IDs.
https://imgur.com/a/eMJovpa
Attachments
OTGW_domoticz_resultaat.JPG
OTGW_domoticz_resultaat.JPG (329.2 KiB) Viewed 4539 times
Hobbybob

Re: Strange problem with OTGW

Post by Hobbybob »

svkeulen wrote: Friday 25 May 2018 8:46 I attached my code so you can try (on your own risk :lol: ). I will review and test it a bit more before submitting it to domoticz github. I also documented the code. I will add more status reports and error handling. (I just finished reading the OpenTherm protocol specification) Hope you will give me some feedback on it so we can improve it more.
I downloaded the files, but I have been looking around on my RPi, and I can't seem to find these files...

How do I install these?
svkeulen
Posts: 12
Joined: Wednesday 03 January 2018 10:12
Target OS: -
Domoticz version:
Contact:

Re: Strange problem with OTGW

Post by svkeulen »

I downloaded the files, but I have been looking around on my RPi, and I can't seem to find these files...
How do I install these?
The are sourcefiles and you need to compile it. Did you install your RPi the easy way or did you compile it from source? If you never done it, maybe I can send you my compiled domoticz file for my RPi if you have the same. I have a RPi 3 B+ and you? The good thing is you can stop your version and start my version for testing. If you put it in a different location you keep your good working version.
Hobbybob

Re: Strange problem with OTGW

Post by Hobbybob »

svkeulen wrote: Saturday 26 May 2018 11:54
I downloaded the files, but I have been looking around on my RPi, and I can't seem to find these files...
How do I install these?
The are sourcefiles and you need to compile it. Did you install your RPi the easy way or did you compile it from source? If you never done it, maybe I can send you my compiled domoticz file for my RPi if you have the same. I have a RPi 3 B+ and you? The good thing is you can stop your version and start my version for testing. If you put it in a different location you keep your good working version.
I installed it the easy way. I'm running a RPi 3, not sure from the top of my head if it is a 3B or not, but definitly bot a 3B+. I'm running raspbian Jessie.

You can send it to me, I'll give it a try, but I will need some pointers on installing it I think.
sexyboy
Posts: 14
Joined: Tuesday 25 September 2018 16:34
Target OS: Linux
Domoticz version:
Contact:

Re: Strange problem with OTGW

Post by sexyboy »

Hi guys,

I've been suffering with the same issues and the posted 2 files it seems like solving the issues.
It seems like this code change has never been merged into to development branch.

I'm just curious why? Do you guys know perhaps?

Regards,
Oszkar
svkeulen
Posts: 12
Joined: Wednesday 03 January 2018 10:12
Target OS: -
Domoticz version:
Contact:

Re: Strange problem with OTGW

Post by svkeulen »

The code never ended up in the development branch. Maybe it is a good idea that I contact the developers about it. I think it is wise to add an extra device (to the source) instead of replacing the current one. Maybe there are people using the code of the "old" device.
svkeulen
Posts: 12
Joined: Wednesday 03 January 2018 10:12
Target OS: -
Domoticz version:
Contact:

Re: Strange problem with OTGW

Post by svkeulen »

I just created an issue on GitHub: https://github.com/domoticz/domoticz/issues/3943. See what happens... :geek:
Post Reply

Who is online

Users browsing this forum: No registered users and 1 guest